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

Side by Side Diff: net/url_request/url_request.cc

Issue 1128083003: Converted bare pointer to scoped_ptr in net/url_request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted the comment desciption. Created 5 years, 7 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
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_job.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) 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/url_request/url_request.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (calling_delegate_ || !blocked_by_.empty()) { 272 if (calling_delegate_ || !blocked_by_.empty()) {
273 return LoadStateWithParam( 273 return LoadStateWithParam(
274 LOAD_STATE_WAITING_FOR_DELEGATE, 274 LOAD_STATE_WAITING_FOR_DELEGATE,
275 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) : 275 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) :
276 base::string16()); 276 base::string16());
277 } 277 }
278 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, 278 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE,
279 base::string16()); 279 base::string16());
280 } 280 }
281 281
282 base::Value* URLRequest::GetStateAsValue() const { 282 scoped_ptr<base::Value> URLRequest::GetStateAsValue() const {
283 base::DictionaryValue* dict = new base::DictionaryValue(); 283 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
284 dict->SetString("url", original_url().possibly_invalid_spec()); 284 dict->SetString("url", original_url().possibly_invalid_spec());
285 285
286 if (url_chain_.size() > 1) { 286 if (url_chain_.size() > 1) {
287 scoped_ptr<base::ListValue> list(new base::ListValue()); 287 scoped_ptr<base::ListValue> list(new base::ListValue());
288 for (const GURL& url : url_chain_) { 288 for (const GURL& url : url_chain_) {
289 list->AppendString(url.possibly_invalid_spec()); 289 list->AppendString(url.possibly_invalid_spec());
290 } 290 }
291 dict->Set("url_chain", list.Pass()); 291 dict->Set("url_chain", list.Pass());
292 } 292 }
293 293
(...skipping 22 matching lines...) Expand all
316 break; 316 break;
317 case URLRequestStatus::CANCELED: 317 case URLRequestStatus::CANCELED:
318 dict->SetString("status", "CANCELED"); 318 dict->SetString("status", "CANCELED");
319 break; 319 break;
320 case URLRequestStatus::FAILED: 320 case URLRequestStatus::FAILED:
321 dict->SetString("status", "FAILED"); 321 dict->SetString("status", "FAILED");
322 break; 322 break;
323 } 323 }
324 if (status_.error() != OK) 324 if (status_.error() != OK)
325 dict->SetInteger("net_error", status_.error()); 325 dict->SetInteger("net_error", status_.error());
326 return dict; 326 return dict.Pass();
327 } 327 }
328 328
329 void URLRequest::LogBlockedBy(const char* blocked_by) { 329 void URLRequest::LogBlockedBy(const char* blocked_by) {
330 DCHECK(blocked_by); 330 DCHECK(blocked_by);
331 DCHECK_GT(strlen(blocked_by), 0u); 331 DCHECK_GT(strlen(blocked_by), 0u);
332 332
333 // Only log information to NetLog during startup and certain deferring calls 333 // Only log information to NetLog during startup and certain deferring calls
334 // to delegates. For all reads but the first, do nothing. 334 // to delegates. For all reads but the first, do nothing.
335 if (!calling_delegate_ && !response_info_.request_time.is_null()) 335 if (!calling_delegate_ && !response_info_.request_time.is_null())
336 return; 336 return;
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 new base::debug::StackTrace(NULL, 0); 1183 new base::debug::StackTrace(NULL, 0);
1184 *stack_trace_copy = stack_trace; 1184 *stack_trace_copy = stack_trace;
1185 stack_trace_.reset(stack_trace_copy); 1185 stack_trace_.reset(stack_trace_copy);
1186 } 1186 }
1187 1187
1188 const base::debug::StackTrace* URLRequest::stack_trace() const { 1188 const base::debug::StackTrace* URLRequest::stack_trace() const {
1189 return stack_trace_.get(); 1189 return stack_trace_.get();
1190 } 1190 }
1191 1191
1192 } // namespace net 1192 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698