OLD | NEW |
---|---|
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 ) const { | 61 ) const { |
62 HttpTransactionFactory* transaction_factory = http_transaction_factory(); | 62 HttpTransactionFactory* transaction_factory = http_transaction_factory(); |
63 if (!transaction_factory) | 63 if (!transaction_factory) |
64 return NULL; | 64 return NULL; |
65 HttpNetworkSession* network_session = transaction_factory->GetSession(); | 65 HttpNetworkSession* network_session = transaction_factory->GetSession(); |
66 if (!network_session) | 66 if (!network_session) |
67 return NULL; | 67 return NULL; |
68 return &network_session->params(); | 68 return &network_session->params(); |
69 } | 69 } |
70 | 70 |
71 URLRequest* URLRequestContext::CreateRequest( | 71 URLRequest* URLRequestContext::CreateRequest(const GURL& url, |
72 const GURL& url, URLRequest::Delegate* delegate) const { | 72 RequestPriority priority, |
73 return new URLRequest(url, delegate, this, network_delegate_); | 73 URLRequest::Delegate* delegate) |
74 const { | |
mmenke
2013/10/30 15:27:11
nit: Const should go on same line as last argumen
akalin
2013/10/30 21:44:37
Done.
| |
75 return new URLRequest(url, priority, delegate, this, network_delegate_); | |
74 } | 76 } |
75 | 77 |
76 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { | 78 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
77 cookie_store_ = cookie_store; | 79 cookie_store_ = cookie_store; |
78 } | 80 } |
79 | 81 |
80 std::string URLRequestContext::GetAcceptLanguage() const { | 82 std::string URLRequestContext::GetAcceptLanguage() const { |
81 return http_user_agent_settings_ ? | 83 return http_user_agent_settings_ ? |
82 http_user_agent_settings_->GetAcceptLanguage() : EmptyString(); | 84 http_user_agent_settings_->GetAcceptLanguage() : EmptyString(); |
83 } | 85 } |
(...skipping 20 matching lines...) Expand all Loading... | |
104 base::debug::Alias(&num_requests); | 106 base::debug::Alias(&num_requests); |
105 base::debug::Alias(&has_delegate); | 107 base::debug::Alias(&has_delegate); |
106 base::debug::Alias(&load_flags); | 108 base::debug::Alias(&load_flags); |
107 base::debug::Alias(&stack_trace); | 109 base::debug::Alias(&stack_trace); |
108 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " | 110 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " |
109 << request->url().spec().c_str() << "."; | 111 << request->url().spec().c_str() << "."; |
110 } | 112 } |
111 } | 113 } |
112 | 114 |
113 } // namespace net | 115 } // namespace net |
OLD | NEW |