Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: net/tools/flip_server/mem_cache.h

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/flip_server/http_interface_test.cc ('k') | net/tools/flip_server/mem_cache_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_ 5 #ifndef NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_
6 #define NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_ 6 #define NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "net/tools/balsa/balsa_headers.h" 13 #include "net/tools/balsa/balsa_headers.h"
14 #include "net/tools/balsa/balsa_visitor_interface.h" 14 #include "net/tools/balsa/balsa_visitor_interface.h"
15 #include "net/tools/flip_server/constants.h" 15 #include "net/tools/flip_server/constants.h"
16 16
17 namespace net { 17 namespace net {
18 18
19 class StoreBodyAndHeadersVisitor : public BalsaVisitorInterface { 19 class StoreBodyAndHeadersVisitor : public BalsaVisitorInterface {
20 public: 20 public:
21 void HandleError() { error_ = true; } 21 void HandleError() { error_ = true; }
22 22
23 // BalsaVisitorInterface: 23 // BalsaVisitorInterface:
24 virtual void ProcessBodyInput(const char* input, size_t size) override {} 24 void ProcessBodyInput(const char* input, size_t size) override {}
25 virtual void ProcessBodyData(const char* input, size_t size) override; 25 void ProcessBodyData(const char* input, size_t size) override;
26 virtual void ProcessHeaderInput(const char* input, size_t size) override {} 26 void ProcessHeaderInput(const char* input, size_t size) override {}
27 virtual void ProcessTrailerInput(const char* input, size_t size) override {} 27 void ProcessTrailerInput(const char* input, size_t size) override {}
28 virtual void ProcessHeaders(const BalsaHeaders& headers) override { 28 void ProcessHeaders(const BalsaHeaders& headers) override {
29 // nothing to do here-- we're assuming that the BalsaFrame has 29 // nothing to do here-- we're assuming that the BalsaFrame has
30 // been handed our headers. 30 // been handed our headers.
31 } 31 }
32 virtual void ProcessRequestFirstLine(const char* line_input, 32 void ProcessRequestFirstLine(const char* line_input,
33 size_t line_length, 33 size_t line_length,
34 const char* method_input, 34 const char* method_input,
35 size_t method_length, 35 size_t method_length,
36 const char* request_uri_input, 36 const char* request_uri_input,
37 size_t request_uri_length, 37 size_t request_uri_length,
38 const char* version_input, 38 const char* version_input,
39 size_t version_length) override {} 39 size_t version_length) override {}
40 virtual void ProcessResponseFirstLine(const char* line_input, 40 void ProcessResponseFirstLine(const char* line_input,
41 size_t line_length, 41 size_t line_length,
42 const char* version_input, 42 const char* version_input,
43 size_t version_length, 43 size_t version_length,
44 const char* status_input, 44 const char* status_input,
45 size_t status_length, 45 size_t status_length,
46 const char* reason_input, 46 const char* reason_input,
47 size_t reason_length) override {} 47 size_t reason_length) override {}
48 virtual void ProcessChunkLength(size_t chunk_length) override {} 48 void ProcessChunkLength(size_t chunk_length) override {}
49 virtual void ProcessChunkExtensions(const char* input, size_t size) override { 49 void ProcessChunkExtensions(const char* input, size_t size) override {}
50 } 50 void HeaderDone() override {}
51 virtual void HeaderDone() override {} 51 void MessageDone() override {}
52 virtual void MessageDone() override {} 52 void HandleHeaderError(BalsaFrame* framer) override;
53 virtual void HandleHeaderError(BalsaFrame* framer) override; 53 void HandleHeaderWarning(BalsaFrame* framer) override;
54 virtual void HandleHeaderWarning(BalsaFrame* framer) override; 54 void HandleChunkingError(BalsaFrame* framer) override;
55 virtual void HandleChunkingError(BalsaFrame* framer) override; 55 void HandleBodyError(BalsaFrame* framer) override;
56 virtual void HandleBodyError(BalsaFrame* framer) override;
57 56
58 BalsaHeaders headers; 57 BalsaHeaders headers;
59 std::string body; 58 std::string body;
60 bool error_; 59 bool error_;
61 }; 60 };
62 61
63 class FileData { 62 class FileData {
64 public: 63 public:
65 FileData(); 64 FileData();
66 FileData(const BalsaHeaders* headers, 65 FileData(const BalsaHeaders* headers,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 144
146 class NotifierInterface { 145 class NotifierInterface {
147 public: 146 public:
148 virtual ~NotifierInterface() {} 147 virtual ~NotifierInterface() {}
149 virtual void Notify() = 0; 148 virtual void Notify() = 0;
150 }; 149 };
151 150
152 } // namespace net 151 } // namespace net
153 152
154 #endif // NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_ 153 #endif // NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_
OLDNEW
« no previous file with comments | « net/tools/flip_server/http_interface_test.cc ('k') | net/tools/flip_server/mem_cache_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698