| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 ProfileImplIOData::Handle::~Handle() { | 50 ProfileImplIOData::Handle::~Handle() { |
| 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 52 if (main_request_context_getter_) | 52 if (main_request_context_getter_) |
| 53 main_request_context_getter_->CleanupOnUIThread(); | 53 main_request_context_getter_->CleanupOnUIThread(); |
| 54 if (media_request_context_getter_) | 54 if (media_request_context_getter_) |
| 55 media_request_context_getter_->CleanupOnUIThread(); | 55 media_request_context_getter_->CleanupOnUIThread(); |
| 56 if (extensions_request_context_getter_) | 56 if (extensions_request_context_getter_) |
| 57 extensions_request_context_getter_->CleanupOnUIThread(); | 57 extensions_request_context_getter_->CleanupOnUIThread(); |
| 58 | 58 |
| 59 // TODO(rlp): Remove CHECKs once we have determined the cause for flakiness | 59 if (io_data_->predictor_.get() != NULL) { |
| 60 // during predictor shutdown. See http://crosbug.com/20407. | 60 // io_data_->predictor_ might be NULL if Init() was never called |
| 61 CHECK(profile_ != NULL); | 61 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). |
| 62 PrefService* user_prefs = profile_->GetPrefs(); | 62 PrefService* user_prefs = profile_->GetPrefs(); |
| 63 CHECK(io_data_->predictor_.get() != NULL); | 63 io_data_->predictor_->ShutdownOnUIThread(user_prefs); |
| 64 io_data_->predictor_->ShutdownOnUIThread(user_prefs); | 64 } |
| 65 | 65 |
| 66 // Clean up all isolated app request contexts. | 66 // Clean up all isolated app request contexts. |
| 67 for (ChromeURLRequestContextGetterMap::iterator iter = | 67 for (ChromeURLRequestContextGetterMap::iterator iter = |
| 68 app_request_context_getter_map_.begin(); | 68 app_request_context_getter_map_.begin(); |
| 69 iter != app_request_context_getter_map_.end(); | 69 iter != app_request_context_getter_map_.end(); |
| 70 ++iter) { | 70 ++iter) { |
| 71 iter->second->CleanupOnUIThread(); | 71 iter->second->CleanupOnUIThread(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 io_data_->ShutdownOnUIThread(); | 74 io_data_->ShutdownOnUIThread(); |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 scoped_refptr<ChromeURLRequestContext> | 462 scoped_refptr<ChromeURLRequestContext> |
| 463 ProfileImplIOData::AcquireIsolatedAppRequestContext( | 463 ProfileImplIOData::AcquireIsolatedAppRequestContext( |
| 464 scoped_refptr<ChromeURLRequestContext> main_context, | 464 scoped_refptr<ChromeURLRequestContext> main_context, |
| 465 const std::string& app_id) const { | 465 const std::string& app_id) const { |
| 466 // We create per-app contexts on demand, unlike the others above. | 466 // We create per-app contexts on demand, unlike the others above. |
| 467 scoped_refptr<ChromeURLRequestContext> app_request_context = | 467 scoped_refptr<ChromeURLRequestContext> app_request_context = |
| 468 InitializeAppRequestContext(main_context, app_id); | 468 InitializeAppRequestContext(main_context, app_id); |
| 469 DCHECK(app_request_context); | 469 DCHECK(app_request_context); |
| 470 return app_request_context; | 470 return app_request_context; |
| 471 } | 471 } |
| OLD | NEW |