diff options
author | msarda@google.com <msarda@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-19 17:35:02 +0000 |
---|---|---|
committer | msarda@google.com <msarda@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-19 17:35:02 +0000 |
commit | 8019eb614727ffbec095cb644a9e1f5b227d5854 (patch) | |
tree | 7e19a9127b0b27f2a0a1705b1270f7a02d6884db /chrome/browser/profiles | |
parent | ea4d28563b477015dbd4ff7bdcc442d4b3011a10 (diff) | |
download | chromium_src-8019eb614727ffbec095cb644a9e1f5b227d5854.zip chromium_src-8019eb614727ffbec095cb644a9e1f5b227d5854.tar.gz chromium_src-8019eb614727ffbec095cb644a9e1f5b227d5854.tar.bz2 |
Initialize the profile IO data before clearing the history.
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/10070006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profiles')
-rw-r--r-- | chrome/browser/profiles/profile_impl_io_data.cc | 26 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl_io_data.h | 3 |
2 files changed, 16 insertions, 13 deletions
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 96c853f..6f760db0 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc @@ -32,17 +32,6 @@ using content::BrowserThread; -namespace { - -void ClearNetworkingHistorySinceOnIOThread( - ProfileImplIOData* io_data, base::Time time) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - io_data->transport_security_state()->DeleteSince(time); - io_data->http_server_properties_manager()->Clear(); -} - -} // namespace - ProfileImplIOData::Handle::Handle(Profile* profile) : io_data_(new ProfileImplIOData), profile_(profile), @@ -216,8 +205,8 @@ void ProfileImplIOData::Handle::ClearNetworkingHistorySince( BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( - &ClearNetworkingHistorySinceOnIOThread, - io_data_, + &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread, + base::Unretained(io_data_), time)); } @@ -513,3 +502,14 @@ ProfileImplIOData::AcquireIsolatedAppRequestContext( DCHECK(app_request_context); return app_request_context; } + +void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( + base::Time time) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + LazyInitialize(); + + DCHECK(transport_security_state()); + transport_security_state()->DeleteSince(time); + DCHECK(http_server_properties_manager()); + http_server_properties_manager()->Clear(); +} diff --git a/chrome/browser/profiles/profile_impl_io_data.h b/chrome/browser/profiles/profile_impl_io_data.h index 5a2aea4..7cbb9fb 100644 --- a/chrome/browser/profiles/profile_impl_io_data.h +++ b/chrome/browser/profiles/profile_impl_io_data.h @@ -135,6 +135,9 @@ class ProfileImplIOData : public ProfileIOData { scoped_refptr<ChromeURLRequestContext> main_context, const std::string& app_id) const OVERRIDE; + // Clears the networking history since |time|. + void ClearNetworkingHistorySinceOnIOThread(base::Time time); + // Lazy initialization params. mutable scoped_ptr<LazyParams> lazy_params_; |