| 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 <inttypes.h> | 7 #include <inttypes.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 HttpNetworkSession* network_session = transaction_factory->GetSession(); | 100 HttpNetworkSession* network_session = transaction_factory->GetSession(); |
| 101 if (!network_session) | 101 if (!network_session) |
| 102 return nullptr; | 102 return nullptr; |
| 103 return &network_session->params(); | 103 return &network_session->params(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 std::unique_ptr<URLRequest> URLRequestContext::CreateRequest( | 106 std::unique_ptr<URLRequest> URLRequestContext::CreateRequest( |
| 107 const GURL& url, | 107 const GURL& url, |
| 108 RequestPriority priority, | 108 RequestPriority priority, |
| 109 URLRequest::Delegate* delegate) const { | 109 URLRequest::Delegate* delegate) const { |
| 110 return base::WrapUnique( | 110 return CreateRequest(url, priority, delegate, MISSING_TRAFFIC_ANNOTATION); |
| 111 new URLRequest(url, priority, delegate, this, network_delegate_)); | |
| 112 } | 111 } |
| 113 | 112 |
| 114 std::unique_ptr<URLRequest> URLRequestContext::CreateRequest( | 113 std::unique_ptr<URLRequest> URLRequestContext::CreateRequest( |
| 115 const GURL& url, | 114 const GURL& url, |
| 116 RequestPriority priority, | 115 RequestPriority priority, |
| 117 URLRequest::Delegate* delegate, | 116 URLRequest::Delegate* delegate, |
| 118 NetworkTrafficAnnotationTag traffic_annotation) const { | 117 NetworkTrafficAnnotationTag traffic_annotation) const { |
| 119 // |traffic_annotation| is just a tag that is extracted during static | 118 return base::WrapUnique(new URLRequest( |
| 120 // code analysis and can be ignored here. | 119 url, priority, delegate, this, network_delegate_, traffic_annotation)); |
| 121 return CreateRequest(url, priority, delegate); | |
| 122 } | 120 } |
| 123 | 121 |
| 124 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { | 122 void URLRequestContext::set_cookie_store(CookieStore* cookie_store) { |
| 125 cookie_store_ = cookie_store; | 123 cookie_store_ = cookie_store; |
| 126 } | 124 } |
| 127 | 125 |
| 128 bool URLRequestContext::AddToAddressMap(const void* const address) { | 126 bool URLRequestContext::AddToAddressMap(const void* const address) { |
| 129 int count = ++address_map_[address]; | 127 int count = ++address_map_[address]; |
| 130 if (!has_reported_too_many_outstanding_requests_ && count > 1000) { | 128 if (!has_reported_too_many_outstanding_requests_ && count > 1000) { |
| 131 has_reported_too_many_outstanding_requests_ = true; | 129 has_reported_too_many_outstanding_requests_ = true; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 HttpCache* http_cache = transaction_factory->GetCache(); | 196 HttpCache* http_cache = transaction_factory->GetCache(); |
| 199 if (http_cache) | 197 if (http_cache) |
| 200 http_cache->DumpMemoryStats(pmd, dump->absolute_name()); | 198 http_cache->DumpMemoryStats(pmd, dump->absolute_name()); |
| 201 } | 199 } |
| 202 if (sdch_manager_) | 200 if (sdch_manager_) |
| 203 sdch_manager_->DumpMemoryStats(pmd, dump_name); | 201 sdch_manager_->DumpMemoryStats(pmd, dump_name); |
| 204 return true; | 202 return true; |
| 205 } | 203 } |
| 206 | 204 |
| 207 } // namespace net | 205 } // namespace net |
| OLD | NEW |