| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/crnet/crnet_environment.h" | 5 #include "ios/crnet/crnet_environment.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 12 #include "base/atomicops.h" | 12 #include "base/atomicops.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/feature_list.h" | 14 #include "base/feature_list.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
| 17 #include "base/files/scoped_file.h" | 17 #include "base/files/scoped_file.h" |
| 18 #include "base/i18n/icu_util.h" | |
| 19 #include "base/json/json_writer.h" | 18 #include "base/json/json_writer.h" |
| 20 #include "base/mac/bind_objc_block.h" | 19 #include "base/mac/bind_objc_block.h" |
| 21 #include "base/mac/bundle_locations.h" | 20 #include "base/mac/bundle_locations.h" |
| 22 #include "base/mac/foundation_util.h" | 21 #include "base/mac/foundation_util.h" |
| 23 #include "base/mac/scoped_block.h" | 22 #include "base/mac/scoped_block.h" |
| 24 #include "base/macros.h" | 23 #include "base/macros.h" |
| 25 #include "base/memory/ptr_util.h" | 24 #include "base/memory/ptr_util.h" |
| 26 #include "base/metrics/statistics_recorder.h" | 25 #include "base/metrics/statistics_recorder.h" |
| 27 #include "base/path_service.h" | 26 #include "base/path_service.h" |
| 28 #include "base/single_thread_task_runner.h" | 27 #include "base/single_thread_task_runner.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 58 #include "net/url_request/data_protocol_handler.h" | 57 #include "net/url_request/data_protocol_handler.h" |
| 59 #include "net/url_request/file_protocol_handler.h" | 58 #include "net/url_request/file_protocol_handler.h" |
| 60 #include "net/url_request/sdch_dictionary_fetcher.h" | 59 #include "net/url_request/sdch_dictionary_fetcher.h" |
| 61 #include "net/url_request/static_http_user_agent_settings.h" | 60 #include "net/url_request/static_http_user_agent_settings.h" |
| 62 #include "net/url_request/url_request_context_getter.h" | 61 #include "net/url_request/url_request_context_getter.h" |
| 63 #include "net/url_request/url_request_context_storage.h" | 62 #include "net/url_request/url_request_context_storage.h" |
| 64 #include "net/url_request/url_request_job_factory_impl.h" | 63 #include "net/url_request/url_request_job_factory_impl.h" |
| 65 #include "url/url_features.h" | 64 #include "url/url_features.h" |
| 66 #include "url/url_util.h" | 65 #include "url/url_util.h" |
| 67 | 66 |
| 67 #if !BUILDFLAG(USE_PLATFORM_ICU_ALTERNATIVES) |
| 68 #include "base/i18n/icu_util.h" // nogncheck |
| 69 #endif |
| 70 |
| 68 namespace { | 71 namespace { |
| 69 | 72 |
| 70 base::AtExitManager* g_at_exit_ = nullptr; | 73 base::AtExitManager* g_at_exit_ = nullptr; |
| 71 | 74 |
| 72 // Request context getter for CrNet. | 75 // Request context getter for CrNet. |
| 73 class CrNetURLRequestContextGetter : public net::URLRequestContextGetter { | 76 class CrNetURLRequestContextGetter : public net::URLRequestContextGetter { |
| 74 public: | 77 public: |
| 75 CrNetURLRequestContextGetter( | 78 CrNetURLRequestContextGetter( |
| 76 net::URLRequestContext* context, | 79 net::URLRequestContext* context, |
| 77 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) | 80 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 | 493 |
| 491 return user_agent_settings->GetUserAgent(); | 494 return user_agent_settings->GetUserAgent(); |
| 492 } | 495 } |
| 493 | 496 |
| 494 void CrNetEnvironment::ClearCache(ClearCacheCallback callback) { | 497 void CrNetEnvironment::ClearCache(ClearCacheCallback callback) { |
| 495 PostToNetworkThread( | 498 PostToNetworkThread( |
| 496 FROM_HERE, | 499 FROM_HERE, |
| 497 base::Bind(&net::ClearHttpCache, main_context_getter_, | 500 base::Bind(&net::ClearHttpCache, main_context_getter_, |
| 498 network_io_thread_->task_runner(), base::BindBlock(callback))); | 501 network_io_thread_->task_runner(), base::BindBlock(callback))); |
| 499 } | 502 } |
| OLD | NEW |