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

Side by Side Diff: net/spdy/spdy_websocket_stream_spdy3_unittest.cc

Issue 17382012: [SPDY] Refactor SpdyStream's handling of response headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More updates from rebase Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_websocket_stream_spdy2_unittest.cc ('k') | net/websockets/websocket_job.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_websocket_stream.h" 5 #include "net/spdy/spdy_websocket_stream.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 virtual void OnSentSpdyHeaders() OVERRIDE { 89 virtual void OnSentSpdyHeaders() OVERRIDE {
90 events_.push_back( 90 events_.push_back(
91 SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_SENT_HEADERS, 91 SpdyWebSocketStreamEvent(SpdyWebSocketStreamEvent::EVENT_SENT_HEADERS,
92 SpdyHeaderBlock(), 92 SpdyHeaderBlock(),
93 OK, 93 OK,
94 std::string())); 94 std::string()));
95 if (!on_sent_data_.is_null()) 95 if (!on_sent_data_.is_null())
96 on_sent_data_.Run(&events_.back()); 96 on_sent_data_.Run(&events_.back());
97 } 97 }
98 virtual int OnReceivedSpdyResponseHeader( 98 virtual void OnSpdyResponseHeadersUpdated(
99 const SpdyHeaderBlock& headers, int status) OVERRIDE { 99 const SpdyHeaderBlock& response_headers) OVERRIDE {
100 events_.push_back( 100 events_.push_back(
101 SpdyWebSocketStreamEvent( 101 SpdyWebSocketStreamEvent(
102 SpdyWebSocketStreamEvent::EVENT_RECEIVED_HEADER, 102 SpdyWebSocketStreamEvent::EVENT_RECEIVED_HEADER,
103 headers, 103 response_headers,
104 status, 104 OK,
105 std::string())); 105 std::string()));
106 if (!on_received_header_.is_null()) 106 if (!on_received_header_.is_null())
107 on_received_header_.Run(&events_.back()); 107 on_received_header_.Run(&events_.back());
108 return status;
109 } 108 }
110 virtual void OnSentSpdyData(size_t bytes_sent) OVERRIDE { 109 virtual void OnSentSpdyData(size_t bytes_sent) OVERRIDE {
111 events_.push_back( 110 events_.push_back(
112 SpdyWebSocketStreamEvent( 111 SpdyWebSocketStreamEvent(
113 SpdyWebSocketStreamEvent::EVENT_SENT_DATA, 112 SpdyWebSocketStreamEvent::EVENT_SENT_DATA,
114 SpdyHeaderBlock(), 113 SpdyHeaderBlock(),
115 static_cast<int>(bytes_sent), 114 static_cast<int>(bytes_sent),
116 std::string())); 115 std::string()));
117 if (!on_sent_data_.is_null()) 116 if (!on_sent_data_.is_null())
118 on_sent_data_.Run(&events_.back()); 117 on_sent_data_.Run(&events_.back());
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 EXPECT_EQ(OK, events[7].result); 617 EXPECT_EQ(OK, events[7].result);
619 618
620 // EOF close SPDY session. 619 // EOF close SPDY session.
621 EXPECT_TRUE(!http_session_->spdy_session_pool()->HasSession( 620 EXPECT_TRUE(!http_session_->spdy_session_pool()->HasSession(
622 spdy_session_key_)); 621 spdy_session_key_));
623 EXPECT_TRUE(data()->at_read_eof()); 622 EXPECT_TRUE(data()->at_read_eof());
624 EXPECT_TRUE(data()->at_write_eof()); 623 EXPECT_TRUE(data()->at_write_eof());
625 } 624 }
626 625
627 } // namespace net 626 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_websocket_stream_spdy2_unittest.cc ('k') | net/websockets/websocket_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698