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 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | 293 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
294 file_user_blocking_thread_.reset( | 294 file_user_blocking_thread_.reset( |
295 new base::Thread("Chrome File User Blocking Thread")); | 295 new base::Thread("Chrome File User Blocking Thread")); |
296 file_user_blocking_thread_->StartWithOptions( | 296 file_user_blocking_thread_->StartWithOptions( |
297 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | 297 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
298 | 298 |
299 // The network change notifier must be initialized so that registered | 299 // The network change notifier must be initialized so that registered |
300 // delegates will receive callbacks. | 300 // delegates will receive callbacks. |
301 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 301 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
302 proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService( | 302 proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService( |
303 network_io_thread_->task_runner(), nullptr); | 303 network_io_thread_->task_runner()); |
304 | 304 |
305 main_context_getter_ = new CrNetURLRequestContextGetter( | 305 main_context_getter_ = new CrNetURLRequestContextGetter( |
306 main_context_.get(), network_io_thread_->task_runner()); | 306 main_context_.get(), network_io_thread_->task_runner()); |
307 base::subtle::MemoryBarrier(); | 307 base::subtle::MemoryBarrier(); |
308 PostToNetworkThread(FROM_HERE, | 308 PostToNetworkThread(FROM_HERE, |
309 base::Bind(&CrNetEnvironment::InitializeOnNetworkThread, | 309 base::Bind(&CrNetEnvironment::InitializeOnNetworkThread, |
310 base::Unretained(this))); | 310 base::Unretained(this))); |
311 | 311 |
312 SetRequestFilterBlock(nil); | 312 SetRequestFilterBlock(nil); |
313 } | 313 } |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 | 512 |
513 return user_agent_settings->GetUserAgent(); | 513 return user_agent_settings->GetUserAgent(); |
514 } | 514 } |
515 | 515 |
516 void CrNetEnvironment::ClearCache(ClearCacheCallback callback) { | 516 void CrNetEnvironment::ClearCache(ClearCacheCallback callback) { |
517 PostToNetworkThread( | 517 PostToNetworkThread( |
518 FROM_HERE, base::Bind(&net::ClearHttpCache, main_context_getter_, | 518 FROM_HERE, base::Bind(&net::ClearHttpCache, main_context_getter_, |
519 network_io_thread_->task_runner(), base::Time(), | 519 network_io_thread_->task_runner(), base::Time(), |
520 base::Time::Max(), base::BindBlockArc(callback))); | 520 base::Time::Max(), base::BindBlockArc(callback))); |
521 } | 521 } |
OLD | NEW |