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

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

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month 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_network_transaction_unittest.cc ('k') | net/spdy/spdy_session.cc » ('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) 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 #include "net/spdy/spdy_proxy_client_socket.h" 5 #include "net/spdy/spdy_proxy_client_socket.h"
6 6
7 #include <algorithm> // min 7 #include <algorithm> // min
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 OnIOComplete(status); 398 OnIOComplete(status);
399 399
400 return OK; 400 return OK;
401 } 401 }
402 402
403 // Called when data is received. 403 // Called when data is received.
404 void SpdyProxyClientSocket::OnDataReceived(const char* data, int length) { 404 void SpdyProxyClientSocket::OnDataReceived(const char* data, int length) {
405 if (length > 0) { 405 if (length > 0) {
406 // Save the received data. 406 // Save the received data.
407 scoped_refptr<IOBuffer> io_buffer = new IOBuffer(length); 407 scoped_refptr<IOBuffer> io_buffer(new IOBuffer(length));
408 memcpy(io_buffer->data(), data, length); 408 memcpy(io_buffer->data(), data, length);
409 read_buffer_.push_back(new DrainableIOBuffer(io_buffer, length)); 409 read_buffer_.push_back(new DrainableIOBuffer(io_buffer, length));
410 } 410 }
411 411
412 if (read_callback_) { 412 if (read_callback_) {
413 int rv = PopulateUserReadBuffer(); 413 int rv = PopulateUserReadBuffer();
414 CompletionCallback* c = read_callback_; 414 CompletionCallback* c = read_callback_;
415 read_callback_ = NULL; 415 read_callback_ = NULL;
416 user_buffer_ = NULL; 416 user_buffer_ = NULL;
417 c->Run(rv); 417 c->Run(rv);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 read_callback->Run(status); 461 read_callback->Run(status);
462 } else if (read_callback_) { 462 } else if (read_callback_) {
463 // If we have a read_callback, the we need to make sure we call it back 463 // If we have a read_callback, the we need to make sure we call it back
464 OnDataReceived(NULL, 0); 464 OnDataReceived(NULL, 0);
465 } 465 }
466 if (write_callback) 466 if (write_callback)
467 write_callback->Run(ERR_CONNECTION_CLOSED); 467 write_callback->Run(ERR_CONNECTION_CLOSED);
468 } 468 }
469 469
470 } // namespace net 470 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698