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

Unified Diff: net/websockets/websocket_job.cc

Issue 13990005: [SPDY] Replace SpdyIOBuffer with new SpdyBuffer class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missing include Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/websockets/websocket_job.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_job.cc
diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc
index 3aeb8aa778a40e9655afca76afd8537d972f96aa..53e0eda0dbf031f0ffb6f6ea9f394e1fbeb12090 100644
--- a/net/websockets/websocket_job.cc
+++ b/net/websockets/websocket_job.cc
@@ -9,10 +9,10 @@
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "googleurl/src/gurl.h"
+#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
#include "net/cookies/cookie_store.h"
-#include "net/base/io_buffer.h"
#include "net/http/http_network_session.h"
#include "net/http/http_transaction_factory.h"
#include "net/http/http_util.h"
@@ -330,14 +330,19 @@ void WebSocketJob::OnSentSpdyData(size_t bytes_sent) {
OnSentData(socket_, static_cast<int>(bytes_sent));
}
-void WebSocketJob::OnReceivedSpdyData(const char* data, int length) {
+void WebSocketJob::OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) {
DCHECK_NE(INITIALIZED, state_);
DCHECK_NE(CONNECTING, state_);
if (state_ == CLOSED)
return;
if (!spdy_websocket_stream_.get())
return;
- OnReceivedData(socket_, data, length);
+ if (buffer) {
+ OnReceivedData(socket_, buffer->GetRemainingData(),
+ buffer->GetRemainingSize());
+ } else {
+ OnReceivedData(socket_, NULL, 0);
+ }
}
void WebSocketJob::OnCloseSpdyStream() {
« no previous file with comments | « net/websockets/websocket_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698