1
// Copyright 2011 Google Inc.
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
7
// http://www.apache.org/licenses/LICENSE-2.0
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
15
#ifndef MOD_SPDY_COMMON_SPDY_SERVER_PUSH_INTERFACE_H_
16
#define MOD_SPDY_COMMON_SPDY_SERVER_PUSH_INTERFACE_H_
18
#include "base/basictypes.h"
19
#include "net/spdy/spdy_framer.h"
20
#include "net/spdy/spdy_protocol.h"
24
class SpdyServerPushInterface {
26
SpdyServerPushInterface();
27
virtual ~SpdyServerPushInterface();
30
// PUSH_STARTED: The server push was started successfully.
32
// INVALID_REQUEST_HEADERS: The given request headers were invalid for a
33
// server push (e.g. because required headers were missing).
34
INVALID_REQUEST_HEADERS,
35
// ASSOCIATED_STREAM_INACTIVE: The push could not be started because the
36
// associated stream is not currently active.
37
ASSOCIATED_STREAM_INACTIVE,
38
// CANNOT_PUSH_EVER_AGAIN: We can't do any more pushes on this session,
39
// either because the client has already sent us a GOAWAY frame, or the
40
// session has been open so long that we've run out of stream IDs.
41
CANNOT_PUSH_EVER_AGAIN,
42
// TOO_MANY_CONCURRENT_PUSHES: The push could not be started right now
43
// because there are too many currently active push streams.
44
TOO_MANY_CONCURRENT_PUSHES,
45
// PUSH_INTERNAL_ERROR: There was an internal error in the SpdySession
46
// (typically something that caused a LOG(DFATAL).
50
// Initiate a SPDY server push, roughly by pretending that the client sent a
51
// SYN_STREAM with the given headers. To repeat: the headers argument is
52
// _not_ the headers that the server will send to the client, but rather the
53
// headers to _pretend_ that the client sent to the server.
54
virtual PushStatus StartServerPush(
55
net::SpdyStreamId associated_stream_id,
56
int32 server_push_depth,
57
net::SpdyPriority priority,
58
const net::SpdyHeaderBlock& request_headers) = 0;
61
DISALLOW_COPY_AND_ASSIGN(SpdyServerPushInterface);
64
} // namespace mod_spdy
66
#endif // MOD_SPDY_COMMON_SPDY_SERVER_PUSH_INTERFACE_H_