OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "net/spdy/spdy_session_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // A delegate that opens a new session when it is closed. | 57 // A delegate that opens a new session when it is closed. |
58 class SessionOpeningDelegate : public SpdyStream::Delegate { | 58 class SessionOpeningDelegate : public SpdyStream::Delegate { |
59 public: | 59 public: |
60 SessionOpeningDelegate(SpdySessionPool* spdy_session_pool, | 60 SessionOpeningDelegate(SpdySessionPool* spdy_session_pool, |
61 const SpdySessionKey& key) | 61 const SpdySessionKey& key) |
62 : spdy_session_pool_(spdy_session_pool), | 62 : spdy_session_pool_(spdy_session_pool), |
63 key_(key) {} | 63 key_(key) {} |
64 | 64 |
65 virtual ~SessionOpeningDelegate() {} | 65 virtual ~SessionOpeningDelegate() {} |
66 | 66 |
67 virtual void OnRequestHeadersSent() OVERRIDE {} | 67 virtual void OnRequestHeadersSent() override {} |
68 | 68 |
69 virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated( | 69 virtual SpdyResponseHeadersStatus OnResponseHeadersUpdated( |
70 const SpdyHeaderBlock& response_headers) OVERRIDE { | 70 const SpdyHeaderBlock& response_headers) override { |
71 return RESPONSE_HEADERS_ARE_COMPLETE; | 71 return RESPONSE_HEADERS_ARE_COMPLETE; |
72 } | 72 } |
73 | 73 |
74 virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE {} | 74 virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override {} |
75 | 75 |
76 virtual void OnDataSent() OVERRIDE {} | 76 virtual void OnDataSent() override {} |
77 | 77 |
78 virtual void OnClose(int status) OVERRIDE { | 78 virtual void OnClose(int status) override { |
79 ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_)); | 79 ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_)); |
80 } | 80 } |
81 | 81 |
82 private: | 82 private: |
83 SpdySessionPool* const spdy_session_pool_; | 83 SpdySessionPool* const spdy_session_pool_; |
84 const SpdySessionKey key_; | 84 const SpdySessionKey key_; |
85 }; | 85 }; |
86 | 86 |
87 // Set up a SpdyStream to create a new session when it is closed. | 87 // Set up a SpdyStream to create a new session when it is closed. |
88 // CloseCurrentSessions should not close the newly-created session. | 88 // CloseCurrentSessions should not close the newly-created session. |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 EXPECT_TRUE(delegateA.StreamIsClosed()); | 611 EXPECT_TRUE(delegateA.StreamIsClosed()); |
612 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); | 612 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); |
613 EXPECT_TRUE(delegateB.StreamIsClosed()); | 613 EXPECT_TRUE(delegateB.StreamIsClosed()); |
614 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); | 614 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); |
615 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 615 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
616 } | 616 } |
617 | 617 |
618 } // namespace | 618 } // namespace |
619 | 619 |
620 } // namespace net | 620 } // namespace net |
OLD | NEW |