| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 it->second->AssertNoURLRequests(); | 220 it->second->AssertNoURLRequests(); |
| 221 delete it->second; | 221 delete it->second; |
| 222 current_context++; | 222 current_context++; |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| 226 // static | 226 // static |
| 227 bool ChromeBrowserStateIOData::IsHandledProtocol(const std::string& scheme) { | 227 bool ChromeBrowserStateIOData::IsHandledProtocol(const std::string& scheme) { |
| 228 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); | 228 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); |
| 229 static const char* const kProtocolList[] = { | 229 static const char* const kProtocolList[] = { |
| 230 url::kFileScheme, kChromeUIScheme, url::kDataScheme, url::kAboutScheme, | 230 url::kFileScheme, kChromeUIScheme, url::kDataScheme, url::kAboutScheme, |
| 231 url::kHttpScheme, url::kHttpsScheme, url::kWsScheme, url::kWssScheme, |
| 231 }; | 232 }; |
| 232 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 233 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
| 233 if (scheme == kProtocolList[i]) | 234 if (scheme == kProtocolList[i]) |
| 234 return true; | 235 return true; |
| 235 } | 236 } |
| 236 return net::URLRequest::IsHandledProtocol(scheme); | 237 return false; |
| 237 } | 238 } |
| 238 | 239 |
| 239 // static | 240 // static |
| 240 void ChromeBrowserStateIOData::InstallProtocolHandlers( | 241 void ChromeBrowserStateIOData::InstallProtocolHandlers( |
| 241 net::URLRequestJobFactoryImpl* job_factory, | 242 net::URLRequestJobFactoryImpl* job_factory, |
| 242 ProtocolHandlerMap* protocol_handlers) { | 243 ProtocolHandlerMap* protocol_handlers) { |
| 243 for (ProtocolHandlerMap::iterator it = protocol_handlers->begin(); | 244 for (ProtocolHandlerMap::iterator it = protocol_handlers->begin(); |
| 244 it != protocol_handlers->end(); ++it) { | 245 it != protocol_handlers->end(); ++it) { |
| 245 bool set_protocol = job_factory->SetProtocolHandler( | 246 bool set_protocol = job_factory->SetProtocolHandler( |
| 246 it->first, base::WrapUnique(it->second.release())); | 247 it->first, base::WrapUnique(it->second.release())); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 return std::unique_ptr<net::HttpCache>( | 480 return std::unique_ptr<net::HttpCache>( |
| 480 new net::HttpCache(session, std::move(main_backend), true)); | 481 new net::HttpCache(session, std::move(main_backend), true)); |
| 481 } | 482 } |
| 482 | 483 |
| 483 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 484 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
| 484 net::HttpNetworkSession* shared_session, | 485 net::HttpNetworkSession* shared_session, |
| 485 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 486 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
| 486 return std::unique_ptr<net::HttpCache>( | 487 return std::unique_ptr<net::HttpCache>( |
| 487 new net::HttpCache(shared_session, std::move(backend), true)); | 488 new net::HttpCache(shared_session, std::move(backend), true)); |
| 488 } | 489 } |
| OLD | NEW |