Chromium Code Reviews| 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 "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 // Set up an empty default cache, with default size. | 321 // Set up an empty default cache, with default size. |
| 322 // TODO(droger): If the NSURLCache is to be used, its size should most | 322 // TODO(droger): If the NSURLCache is to be used, its size should most |
| 323 // likely be changed. On an iPod2 with iOS4, the default size is 512k. | 323 // likely be changed. On an iPod2 with iOS4, the default size is 512k. |
| 324 [NSURLCache setSharedURLCache:[[[NSURLCache alloc] init] autorelease]]; | 324 [NSURLCache setSharedURLCache:[[[NSURLCache alloc] init] autorelease]]; |
| 325 [NSURLProtocol unregisterClass:[CRNPauseableHTTPProtocolHandler class]]; | 325 [NSURLProtocol unregisterClass:[CRNPauseableHTTPProtocolHandler class]]; |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 void CrNetEnvironment::ConfigureSdchOnNetworkThread() { | 329 void CrNetEnvironment::ConfigureSdchOnNetworkThread() { |
| 330 DCHECK(base::MessageLoop::current() == network_io_thread_->message_loop()); | 330 DCHECK(base::MessageLoop::current() == network_io_thread_->message_loop()); |
| 331 net::URLRequestContext* context = | |
| 332 main_context_getter_->GetURLRequestContext(); | |
| 333 LOG(ERROR) << "ConfigureSdch: " << sdch_enabled_; | |
|
droger
2015/08/17 15:47:30
Remove LOG
Elly Fong-Jones
2015/08/17 17:26:49
Done.
| |
| 331 | 334 |
| 332 if (!sdch_enabled_) { | 335 if (!sdch_enabled_) { |
| 333 net::SdchManager::EnableSdchSupport(false); | 336 DCHECK_EQ(static_cast<net::SdchManager*>(nullptr), context->sdch_manager()); |
| 334 return; | 337 return; |
| 335 } | 338 } |
| 336 | 339 |
| 337 sdch_manager_.reset(new net::SdchManager()); | 340 sdch_manager_.reset(new net::SdchManager()); |
| 338 net::URLRequestContext* context = | |
| 339 main_context_getter_->GetURLRequestContext(); | |
| 340 sdch_owner_.reset(new net::SdchOwner(sdch_manager_.get(), context)); | 341 sdch_owner_.reset(new net::SdchOwner(sdch_manager_.get(), context)); |
| 341 if (!sdch_pref_store_filename_.empty()) { | 342 if (!sdch_pref_store_filename_.empty()) { |
| 342 base::FilePath path(sdch_pref_store_filename_); | 343 base::FilePath path(sdch_pref_store_filename_); |
| 343 pref_store_worker_pool_ = file_user_blocking_thread_->task_runner(); | 344 pref_store_worker_pool_ = file_user_blocking_thread_->task_runner(); |
| 344 net_pref_store_ = new JsonPrefStore( | 345 net_pref_store_ = new JsonPrefStore( |
| 345 path, | 346 path, |
| 346 pref_store_worker_pool_.get(), | 347 pref_store_worker_pool_.get(), |
| 347 scoped_ptr<PrefFilter>()); | 348 scoped_ptr<PrefFilter>()); |
| 348 net_pref_store_->ReadPrefsAsync(nullptr); | 349 net_pref_store_->ReadPrefsAsync(nullptr); |
| 349 sdch_owner_->EnablePersistentStorage(net_pref_store_.get()); | 350 sdch_owner_->EnablePersistentStorage(net_pref_store_.get()); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 494 if (backend) | 495 if (backend) |
| 495 backend->DoomAllEntries(client_callback); | 496 backend->DoomAllEntries(client_callback); |
| 496 }); | 497 }); |
| 497 int rc = cache->GetBackend(&backend, doom_callback); | 498 int rc = cache->GetBackend(&backend, doom_callback); |
| 498 if (rc != net::ERR_IO_PENDING) { | 499 if (rc != net::ERR_IO_PENDING) { |
| 499 // GetBackend doesn't call the callback if it completes synchronously, so | 500 // GetBackend doesn't call the callback if it completes synchronously, so |
| 500 // call it directly here. | 501 // call it directly here. |
| 501 doom_callback.Run(rc); | 502 doom_callback.Run(rc); |
| 502 } | 503 } |
| 503 } | 504 } |
| OLD | NEW |