OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #ifdef _WIN32 | 9 #ifdef _WIN32 |
10 #include <winsock2.h> | 10 #include <winsock2.h> |
11 #else | 11 #else |
12 #include <arpa/inet.h> | 12 #include <arpa/inet.h> |
13 #endif | 13 #endif |
14 #include <list> | 14 #include <list> |
15 #include <map> | 15 #include <map> |
16 #include <string> | 16 #include <string> |
17 #include <utility> | 17 #include <utility> |
18 | 18 |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/gtest_prod_util.h" | 20 #include "base/gtest_prod_util.h" |
21 #include "base/scoped_ptr.h" | 21 #include "base/scoped_ptr.h" |
22 #include "net/spdy/spdy_protocol.h" | 22 #include "net/spdy/spdy_protocol.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 HttpNetworkTransactionTest; |
29 class SpdyHttpStreamTest; | |
30 class SpdyNetworkTransactionTest; | 29 class SpdyNetworkTransactionTest; |
31 class SpdyProxyClientSocketTest; | |
32 class SpdySessionTest; | 30 class SpdySessionTest; |
33 class SpdyStreamTest; | 31 class SpdyStreamTest; |
| 32 class SpdyHttpStreamTest; |
34 } | 33 } |
35 | 34 |
36 namespace spdy { | 35 namespace spdy { |
37 | 36 |
38 class SpdyFramer; | 37 class SpdyFramer; |
39 class SpdyFramerTest; | 38 class SpdyFramerTest; |
40 | 39 |
41 namespace test { | 40 namespace test { |
42 class TestSpdyVisitor; | 41 class TestSpdyVisitor; |
43 void FramerSetEnableCompressionHelper(SpdyFramer* framer, bool compress); | 42 void FramerSetEnableCompressionHelper(SpdyFramer* framer, bool compress); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 static void set_protocol_version(int version) { spdy_version_= version; } | 241 static void set_protocol_version(int version) { spdy_version_= version; } |
243 static int protocol_version() { return spdy_version_; } | 242 static int protocol_version() { return spdy_version_; } |
244 | 243 |
245 // Export the compression dictionary | 244 // Export the compression dictionary |
246 static const char kDictionary[]; | 245 static const char kDictionary[]; |
247 static const int kDictionarySize; | 246 static const int kDictionarySize; |
248 | 247 |
249 protected: | 248 protected: |
250 FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest, DataCompression); | 249 FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest, DataCompression); |
251 FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest, UnclosedStreamDataCompressors); | 250 FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest, UnclosedStreamDataCompressors); |
| 251 friend class net::SpdyNetworkTransactionTest; |
| 252 friend class net::HttpNetworkTransactionTest; |
252 friend class net::HttpNetworkLayer; // This is temporary for the server. | 253 friend class net::HttpNetworkLayer; // This is temporary for the server. |
253 friend class net::HttpNetworkTransactionTest; | 254 friend class net::SpdySessionTest; |
254 friend class net::SpdyHttpStreamTest; | 255 friend class net::SpdyHttpStreamTest; |
255 friend class net::SpdyNetworkTransactionTest; | |
256 friend class net::SpdyProxyClientSocketTest; | |
257 friend class net::SpdySessionTest; | |
258 friend class net::SpdyStreamTest; | 256 friend class net::SpdyStreamTest; |
259 friend class test::TestSpdyVisitor; | 257 friend class test::TestSpdyVisitor; |
260 friend void test::FramerSetEnableCompressionHelper(SpdyFramer* framer, | 258 friend void test::FramerSetEnableCompressionHelper(SpdyFramer* framer, |
261 bool compress); | 259 bool compress); |
262 | 260 |
263 // For ease of testing we can tweak compression on/off. | 261 // For ease of testing we can tweak compression on/off. |
264 void set_enable_compression(bool value); | 262 void set_enable_compression(bool value); |
265 static void set_enable_compression_default(bool value); | 263 static void set_enable_compression_default(bool value); |
266 | 264 |
267 private: | 265 private: |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 328 |
331 SpdyFramerVisitorInterface* visitor_; | 329 SpdyFramerVisitorInterface* visitor_; |
332 | 330 |
333 static bool compression_default_; | 331 static bool compression_default_; |
334 static int spdy_version_; | 332 static int spdy_version_; |
335 }; | 333 }; |
336 | 334 |
337 } // namespace spdy | 335 } // namespace spdy |
338 | 336 |
339 #endif // NET_SPDY_SPDY_FRAMER_H_ | 337 #endif // NET_SPDY_SPDY_FRAMER_H_ |
OLD | NEW |