Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 2159133002: Shutdown StoragePartition before ProfileIOData is being shut down (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fix Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ProfileImplIOData::Handle::Handle(Profile* profile) 109 ProfileImplIOData::Handle::Handle(Profile* profile)
110 : io_data_(new ProfileImplIOData), 110 : io_data_(new ProfileImplIOData),
111 profile_(profile), 111 profile_(profile),
112 initialized_(false) { 112 initialized_(false) {
113 DCHECK_CURRENTLY_ON(BrowserThread::UI); 113 DCHECK_CURRENTLY_ON(BrowserThread::UI);
114 DCHECK(profile); 114 DCHECK(profile);
115 } 115 }
116 116
117 ProfileImplIOData::Handle::~Handle() { 117 ProfileImplIOData::Handle::~Handle() {
118 DCHECK_CURRENTLY_ON(BrowserThread::UI); 118 DCHECK_CURRENTLY_ON(BrowserThread::UI);
119 profile_->ShutdownStoragePartitions();
mmenke 2016/07/19 17:55:20 This doesn't seem like a good place for this - thi
kinuko 2016/07/21 03:06:25 I think we can, and yeah that'd be better. Done.
120
119 if (io_data_->predictor_ != NULL) { 121 if (io_data_->predictor_ != NULL) {
120 // io_data_->predictor_ might be NULL if Init() was never called 122 // io_data_->predictor_ might be NULL if Init() was never called
121 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). 123 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called).
122 bool save_prefs = true; 124 bool save_prefs = true;
123 #if defined(OS_CHROMEOS) 125 #if defined(OS_CHROMEOS)
124 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); 126 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_);
125 #endif 127 #endif
126 if (save_prefs) 128 if (save_prefs)
127 io_data_->predictor_->SaveStateForNextStartup(); 129 io_data_->predictor_->SaveStateForNextStartup();
128 io_data_->predictor_->ShutdownOnUIThread(); 130 io_data_->predictor_->ShutdownOnUIThread();
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 const base::Closure& completion) { 794 const base::Closure& completion) {
793 DCHECK_CURRENTLY_ON(BrowserThread::IO); 795 DCHECK_CURRENTLY_ON(BrowserThread::IO);
794 DCHECK(initialized()); 796 DCHECK(initialized());
795 797
796 DCHECK(transport_security_state()); 798 DCHECK(transport_security_state());
797 // Completes synchronously. 799 // Completes synchronously.
798 transport_security_state()->DeleteAllDynamicDataSince(time); 800 transport_security_state()->DeleteAllDynamicDataSince(time);
799 DCHECK(http_server_properties_manager_); 801 DCHECK(http_server_properties_manager_);
800 http_server_properties_manager_->Clear(completion); 802 http_server_properties_manager_->Clear(completion);
801 } 803 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698