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

Side by Side Diff: components/cronet/android/url_request_adapter.cc

Issue 1445003002: Use std::default_delete as the default deleter for scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: How many trial and errors before this builds on the Windows bots Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "url_request_adapter.h" 5 #include "url_request_adapter.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 chunked_upload_ = true; 79 chunked_upload_ = true;
80 } 80 }
81 81
82 void URLRequestAdapter::AppendChunk(const char* bytes, int bytes_len, 82 void URLRequestAdapter::AppendChunk(const char* bytes, int bytes_len,
83 bool is_last_chunk) { 83 bool is_last_chunk) {
84 VLOG(1) << "AppendChunk, len: " << bytes_len << ", last: " << is_last_chunk; 84 VLOG(1) << "AppendChunk, len: " << bytes_len << ", last: " << is_last_chunk;
85 scoped_ptr<char[]> buf(new char[bytes_len]); 85 scoped_ptr<char[]> buf(new char[bytes_len]);
86 memcpy(buf.get(), bytes, bytes_len); 86 memcpy(buf.get(), bytes, bytes_len);
87 context_->PostTaskToNetworkThread( 87 context_->PostTaskToNetworkThread(
88 FROM_HERE, 88 FROM_HERE,
89 base::Bind(&URLRequestAdapter::OnAppendChunk, 89 base::Bind(&URLRequestAdapter::OnAppendChunk, base::Unretained(this),
90 base::Unretained(this), 90 base::Passed(&buf), bytes_len, is_last_chunk));
91 Passed(buf.Pass()),
92 bytes_len,
93 is_last_chunk));
94 } 91 }
95 92
96 std::string URLRequestAdapter::GetHeader(const std::string& name) const { 93 std::string URLRequestAdapter::GetHeader(const std::string& name) const {
97 std::string value; 94 std::string value;
98 if (url_request_ != NULL) { 95 if (url_request_ != NULL) {
99 url_request_->GetResponseHeaderByName(name, &value); 96 url_request_->GetResponseHeaderByName(name, &value);
100 } 97 }
101 return value; 98 return value;
102 } 99 }
103 100
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 unsigned char* URLRequestAdapter::Data() const { 319 unsigned char* URLRequestAdapter::Data() const {
323 DCHECK(OnNetworkThread()); 320 DCHECK(OnNetworkThread());
324 return reinterpret_cast<unsigned char*>(read_buffer_->data()); 321 return reinterpret_cast<unsigned char*>(read_buffer_->data());
325 } 322 }
326 323
327 bool URLRequestAdapter::OnNetworkThread() const { 324 bool URLRequestAdapter::OnNetworkThread() const {
328 return context_->GetNetworkTaskRunner()->BelongsToCurrentThread(); 325 return context_->GetNetworkTaskRunner()->BelongsToCurrentThread();
329 } 326 }
330 327
331 } // namespace cronet 328 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_url_request_context_adapter.cc ('k') | components/gcm_driver/fake_gcm_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698