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

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

Issue 197043005: original change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix other build error Created 6 years, 9 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/url_request/url_request_context.h ('k') | net/url_request/url_request_http_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_context.h" 5 #include "net/url_request/url_request_context.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/debug/alias.h" 8 #include "base/debug/alias.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return NULL; 66 return NULL;
67 HttpNetworkSession* network_session = transaction_factory->GetSession(); 67 HttpNetworkSession* network_session = transaction_factory->GetSession();
68 if (!network_session) 68 if (!network_session)
69 return NULL; 69 return NULL;
70 return &network_session->params(); 70 return &network_session->params();
71 } 71 }
72 72
73 scoped_ptr<URLRequest> URLRequestContext::CreateRequest( 73 scoped_ptr<URLRequest> URLRequestContext::CreateRequest(
74 const GURL& url, 74 const GURL& url,
75 RequestPriority priority, 75 RequestPriority priority,
76 URLRequest::Delegate* delegate) const { 76 URLRequest::Delegate* delegate,
77 return scoped_ptr<URLRequest>(new URLRequest(url, priority, delegate, this)); 77 CookieStore* cookie_store) const {
78 return scoped_ptr<URLRequest>(
79 new URLRequest(url, priority, delegate, this, cookie_store));
78 } 80 }
79 81
80 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { 82 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) {
81 cookie_store_ = cookie_store; 83 cookie_store_ = cookie_store;
82 } 84 }
83 85
84 void URLRequestContext::AssertNoURLRequests() const { 86 void URLRequestContext::AssertNoURLRequests() const {
85 int num_requests = url_requests_->size(); 87 int num_requests = url_requests_->size();
86 if (num_requests != 0) { 88 if (num_requests != 0) {
87 // We're leaking URLRequests :( Dump the URL of the first one and record how 89 // We're leaking URLRequests :( Dump the URL of the first one and record how
(...skipping 10 matching lines...) Expand all
98 base::debug::Alias(&num_requests); 100 base::debug::Alias(&num_requests);
99 base::debug::Alias(&has_delegate); 101 base::debug::Alias(&has_delegate);
100 base::debug::Alias(&load_flags); 102 base::debug::Alias(&load_flags);
101 base::debug::Alias(&stack_trace); 103 base::debug::Alias(&stack_trace);
102 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " 104 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: "
103 << request->url().spec().c_str() << "."; 105 << request->url().spec().c_str() << ".";
104 } 106 }
105 } 107 }
106 108
107 } // namespace net 109 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context.h ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698