~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/mod_spdy/src/mod_spdy/common/spdy_server_push_interface.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 Google Inc.
2
 
//
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
6
 
//
7
 
//      http://www.apache.org/licenses/LICENSE-2.0
8
 
//
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.
14
 
 
15
 
#ifndef MOD_SPDY_COMMON_SPDY_SERVER_PUSH_INTERFACE_H_
16
 
#define MOD_SPDY_COMMON_SPDY_SERVER_PUSH_INTERFACE_H_
17
 
 
18
 
#include "base/basictypes.h"
19
 
#include "net/spdy/spdy_framer.h"
20
 
#include "net/spdy/spdy_protocol.h"
21
 
 
22
 
namespace mod_spdy {
23
 
 
24
 
class SpdyServerPushInterface {
25
 
 public:
26
 
  SpdyServerPushInterface();
27
 
  virtual ~SpdyServerPushInterface();
28
 
 
29
 
  enum PushStatus {
30
 
    // PUSH_STARTED: The server push was started successfully.
31
 
    PUSH_STARTED,
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).
47
 
    PUSH_INTERNAL_ERROR,
48
 
  };
49
 
 
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;
59
 
 
60
 
 private:
61
 
  DISALLOW_COPY_AND_ASSIGN(SpdyServerPushInterface);
62
 
};
63
 
 
64
 
}  // namespace mod_spdy
65
 
 
66
 
#endif  // MOD_SPDY_COMMON_SPDY_SERVER_PUSH_INTERFACE_H_