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

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

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const-ify HUAS getters Created 8 years, 1 month 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 | Annotate | Revision Log
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 "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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 ProfileImplIOData::Handle::Handle(Profile* profile) 44 ProfileImplIOData::Handle::Handle(Profile* profile)
45 : io_data_(new ProfileImplIOData), 45 : io_data_(new ProfileImplIOData),
46 profile_(profile), 46 profile_(profile),
47 initialized_(false) { 47 initialized_(false) {
48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
49 DCHECK(profile); 49 DCHECK(profile);
50 } 50 }
51 51
52 ProfileImplIOData::Handle::~Handle() { 52 ProfileImplIOData::Handle::~Handle() {
53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
54 if (main_request_context_getter_)
55 main_request_context_getter_->CleanupOnUIThread();
56 if (media_request_context_getter_)
57 media_request_context_getter_->CleanupOnUIThread();
58 if (extensions_request_context_getter_)
59 extensions_request_context_getter_->CleanupOnUIThread();
60 54
61 if (io_data_->predictor_.get() != NULL) { 55 if (io_data_->predictor_.get() != NULL) {
62 // io_data_->predictor_ might be NULL if Init() was never called 56 // io_data_->predictor_ might be NULL if Init() was never called
63 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). 57 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called).
64 PrefService* user_prefs = profile_->GetPrefs(); 58 PrefService* user_prefs = profile_->GetPrefs();
65 io_data_->predictor_->ShutdownOnUIThread(user_prefs); 59 io_data_->predictor_->ShutdownOnUIThread(user_prefs);
66 } 60 }
67 61
68 // Clean up all isolated app request contexts.
69 for (ChromeURLRequestContextGetterMap::iterator iter =
70 app_request_context_getter_map_.begin();
71 iter != app_request_context_getter_map_.end();
72 ++iter) {
73 iter->second->CleanupOnUIThread();
74 }
75
76 // Clean up all isolated media request contexts.
77 for (ChromeURLRequestContextGetterMap::iterator iter =
78 isolated_media_request_context_getter_map_.begin();
79 iter != isolated_media_request_context_getter_map_.end();
80 ++iter) {
81 iter->second->CleanupOnUIThread();
82 }
83
84 if (io_data_->http_server_properties_manager()) 62 if (io_data_->http_server_properties_manager())
85 io_data_->http_server_properties_manager()->ShutdownOnUIThread(); 63 io_data_->http_server_properties_manager()->ShutdownOnUIThread();
86 io_data_->ShutdownOnUIThread(); 64 io_data_->ShutdownOnUIThread();
87 } 65 }
88 66
89 void ProfileImplIOData::Handle::Init( 67 void ProfileImplIOData::Handle::Init(
90 const FilePath& cookie_path, 68 const FilePath& cookie_path,
91 const FilePath& server_bound_cert_path, 69 const FilePath& server_bound_cert_path,
92 const FilePath& cache_path, 70 const FilePath& cache_path,
93 int cache_max_size, 71 int cache_max_size,
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( 643 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
666 base::Time time) { 644 base::Time time) {
667 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 645 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
668 LazyInitialize(); 646 LazyInitialize();
669 647
670 DCHECK(transport_security_state()); 648 DCHECK(transport_security_state());
671 transport_security_state()->DeleteSince(time); 649 transport_security_state()->DeleteSince(time);
672 DCHECK(http_server_properties_manager()); 650 DCHECK(http_server_properties_manager());
673 http_server_properties_manager()->Clear(); 651 http_server_properties_manager()->Clear();
674 } 652 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698