OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_SPDY_SPDY_FRAMER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAMER_H_ |
6 #define NET_SPDY_SPDY_FRAMER_H_ | 6 #define NET_SPDY_SPDY_FRAMER_H_ |
7 | 7 |
8 #ifdef _WIN32 | 8 #ifdef _WIN32 |
9 #include <winsock2.h> | 9 #include <winsock2.h> |
10 #else | 10 #else |
11 #include <arpa/inet.h> | 11 #include <arpa/inet.h> |
12 #endif | 12 #endif |
13 #include <list> | 13 #include <list> |
14 #include <map> | 14 #include <map> |
15 #include <string> | 15 #include <string> |
16 #include <utility> | 16 #include <utility> |
17 | 17 |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
21 #include "net/spdy/spdy_protocol.h" | 21 #include "net/spdy/spdy_protocol.h" |
22 #include "testing/gtest/include/gtest/gtest_prod.h" | 22 #include "testing/gtest/include/gtest/gtest_prod.h" |
23 | 23 |
24 typedef struct z_stream_s z_stream; // Forward declaration for zlib. | 24 typedef struct z_stream_s z_stream; // Forward declaration for zlib. |
25 | 25 |
26 namespace net { | 26 namespace net { |
27 class HttpNetworkLayer; | 27 class HttpNetworkLayer; |
| 28 class HttpNetworkTransactionTest; |
28 class SpdyNetworkTransactionTest; | 29 class SpdyNetworkTransactionTest; |
29 } | 30 } |
30 | 31 |
31 namespace spdy { | 32 namespace spdy { |
32 | 33 |
33 class SpdyFramer; | 34 class SpdyFramer; |
34 class SpdyFramerTest; | 35 class SpdyFramerTest; |
35 | 36 |
36 namespace test { | 37 namespace test { |
37 class TestSpdyVisitor; | 38 class TestSpdyVisitor; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 static const char* StateToString(int state); | 231 static const char* StateToString(int state); |
231 static const char* ErrorCodeToString(int error_code); | 232 static const char* ErrorCodeToString(int error_code); |
232 | 233 |
233 // Export the compression dictionary | 234 // Export the compression dictionary |
234 static const char kDictionary[]; | 235 static const char kDictionary[]; |
235 static const int kDictionarySize; | 236 static const int kDictionarySize; |
236 | 237 |
237 protected: | 238 protected: |
238 FRIEND_TEST(SpdyFramerTest, HeaderBlockBarfsOnOutOfOrderHeaders); | 239 FRIEND_TEST(SpdyFramerTest, HeaderBlockBarfsOnOutOfOrderHeaders); |
239 friend class net::SpdyNetworkTransactionTest; | 240 friend class net::SpdyNetworkTransactionTest; |
| 241 friend class net::HttpNetworkTransactionTest; |
240 friend class net::HttpNetworkLayer; // This is temporary for the server. | 242 friend class net::HttpNetworkLayer; // This is temporary for the server. |
241 friend class test::TestSpdyVisitor; | 243 friend class test::TestSpdyVisitor; |
242 friend void test::FramerSetEnableCompressionHelper(SpdyFramer* framer, | 244 friend void test::FramerSetEnableCompressionHelper(SpdyFramer* framer, |
243 bool compress); | 245 bool compress); |
244 | 246 |
245 // For ease of testing we can tweak compression on/off. | 247 // For ease of testing we can tweak compression on/off. |
246 void set_enable_compression(bool value); | 248 void set_enable_compression(bool value); |
247 static void set_enable_compression_default(bool value); | 249 static void set_enable_compression_default(bool value); |
248 | 250 |
249 private: | 251 private: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 scoped_ptr<z_stream> compressor_; | 287 scoped_ptr<z_stream> compressor_; |
286 scoped_ptr<z_stream> decompressor_; | 288 scoped_ptr<z_stream> decompressor_; |
287 SpdyFramerVisitorInterface* visitor_; | 289 SpdyFramerVisitorInterface* visitor_; |
288 | 290 |
289 static bool compression_default_; | 291 static bool compression_default_; |
290 }; | 292 }; |
291 | 293 |
292 } // namespace spdy | 294 } // namespace spdy |
293 | 295 |
294 #endif // NET_SPDY_SPDY_FRAMER_H_ | 296 #endif // NET_SPDY_SPDY_FRAMER_H_ |
295 | |
OLD | NEW |