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

Unified Diff: chrome/browser/transport_security_persister.cc

Issue 7966005: Move TransportSecurityPersister completely to IO thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/transport_security_persister.cc
diff --git a/chrome/browser/transport_security_persister.cc b/chrome/browser/transport_security_persister.cc
index 59f093a31451cf0f10885359808bde497721f94e..d1fd6e142aa8d5f18b37be2197bdf34fd35e2b59 100644
--- a/chrome/browser/transport_security_persister.cc
+++ b/chrome/browser/transport_security_persister.cc
@@ -20,12 +20,14 @@ TransportSecurityPersister::TransportSecurityPersister(
writer_(profile_path.AppendASCII("TransportSecurity"),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)),
readonly_(readonly) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
transport_security_state_->SetDelegate(this);
}
TransportSecurityPersister::~TransportSecurityPersister() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
if (writer_.HasPendingWrite())
writer_.DoScheduledWrite();
@@ -33,7 +35,7 @@ TransportSecurityPersister::~TransportSecurityPersister() {
}
void TransportSecurityPersister::Init() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
BrowserThread::PostTask(
willchan no longer on Chromium 2011/09/20 01:29:51 Can you use BrowserThread::PostTaskAndReply() and
BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(this, &TransportSecurityPersister::Load));
@@ -75,5 +77,6 @@ void TransportSecurityPersister::StateIsDirty(
}
bool TransportSecurityPersister::SerializeData(std::string* data) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
return transport_security_state_->Serialise(data);
}

Powered by Google App Engine
This is Rietveld 408576698