OLD | NEW |
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 <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <map> | 11 #include <map> |
9 #include <string> | 12 #include <string> |
10 | 13 |
11 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
13 #include "net/tools/balsa/balsa_headers.h" | 17 #include "net/tools/balsa/balsa_headers.h" |
14 #include "net/tools/balsa/balsa_visitor_interface.h" | 18 #include "net/tools/balsa/balsa_visitor_interface.h" |
15 #include "net/tools/flip_server/constants.h" | 19 #include "net/tools/flip_server/constants.h" |
16 | 20 |
17 namespace net { | 21 namespace net { |
18 | 22 |
19 class StoreBodyAndHeadersVisitor : public BalsaVisitorInterface { | 23 class StoreBodyAndHeadersVisitor : public BalsaVisitorInterface { |
20 public: | 24 public: |
21 void HandleError() { error_ = true; } | 25 void HandleError() { error_ = true; } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 priority(0), | 100 priority(0), |
97 transformed_header(false), | 101 transformed_header(false), |
98 body_bytes_consumed(0), | 102 body_bytes_consumed(0), |
99 stream_id(0), | 103 stream_id(0), |
100 max_segment_size(kInitialDataSendersThreshold), | 104 max_segment_size(kInitialDataSendersThreshold), |
101 bytes_sent(0) {} | 105 bytes_sent(0) {} |
102 FileData* file_data; | 106 FileData* file_data; |
103 int priority; | 107 int priority; |
104 bool transformed_header; | 108 bool transformed_header; |
105 size_t body_bytes_consumed; | 109 size_t body_bytes_consumed; |
106 uint32 stream_id; | 110 uint32_t stream_id; |
107 uint32 max_segment_size; | 111 uint32_t max_segment_size; |
108 size_t bytes_sent; | 112 size_t bytes_sent; |
109 }; | 113 }; |
110 | 114 |
111 class MemoryCache { | 115 class MemoryCache { |
112 public: | 116 public: |
113 typedef std::map<std::string, FileData*> Files; | 117 typedef std::map<std::string, FileData*> Files; |
114 | 118 |
115 public: | 119 public: |
116 MemoryCache(); | 120 MemoryCache(); |
117 virtual ~MemoryCache(); | 121 virtual ~MemoryCache(); |
(...skipping 26 matching lines...) Expand all Loading... |
144 | 148 |
145 class NotifierInterface { | 149 class NotifierInterface { |
146 public: | 150 public: |
147 virtual ~NotifierInterface() {} | 151 virtual ~NotifierInterface() {} |
148 virtual void Notify() = 0; | 152 virtual void Notify() = 0; |
149 }; | 153 }; |
150 | 154 |
151 } // namespace net | 155 } // namespace net |
152 | 156 |
153 #endif // NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_ | 157 #endif // NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_ |
OLD | NEW |