~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/http_response_visitor_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 2010 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_HTTP_RESPONSE_VISITOR_INTERFACE_H_
16
 
#define MOD_SPDY_COMMON_HTTP_RESPONSE_VISITOR_INTERFACE_H_
17
 
 
18
 
#include "base/basictypes.h"
19
 
#include "base/string_piece.h"
20
 
 
21
 
namespace mod_spdy {
22
 
 
23
 
// Interface that gets called back as an HTTP response is visited.
24
 
class HttpResponseVisitorInterface {
25
 
 public:
26
 
  HttpResponseVisitorInterface();
27
 
  virtual ~HttpResponseVisitorInterface();
28
 
 
29
 
  // Called when an HTTP response status line is visited.  Indicates that a new
30
 
  // HTTP response is being visited.
31
 
  virtual void OnStatusLine(const base::StringPiece& version,
32
 
                            const base::StringPiece& status_code,
33
 
                            const base::StringPiece& status_phrase) = 0;
34
 
 
35
 
  // Called zero or more times, once for each leading (i.e. normal, not
36
 
  // trailing) HTTP header.  This is called after OnStatusLine but before
37
 
  // OnLeadingHeadersComplete.
38
 
  virtual void OnLeadingHeader(const base::StringPiece& key,
39
 
                               const base::StringPiece& value) = 0;
40
 
 
41
 
  // Called after the leading HTTP headers have been visited.  This will be
42
 
  // called exactly once when the leading headers are done (even if there were
43
 
  // no leading headers).  If the `fin` argument is true, the response is now
44
 
  // complete (i.e. it has no body) and no more methods will be called.
45
 
  virtual void OnLeadingHeadersComplete(bool fin) = 0;
46
 
 
47
 
  // Called zero or more times, after OnLeadingHeadersComplete.  If the `fin`
48
 
  // argument is true, the response is now complete and no more methods will be
49
 
  // called.
50
 
  virtual void OnData(const base::StringPiece& data, bool fin) = 0;
51
 
 
52
 
 private:
53
 
  DISALLOW_COPY_AND_ASSIGN(HttpResponseVisitorInterface);
54
 
};
55
 
 
56
 
}  // namespace mod_spdy
57
 
 
58
 
#endif  // MOD_SPDY_COMMON_HTTP_RESPONSE_VISITOR_INTERFACE_H_