summaryrefslogtreecommitdiffstats
path: root/chrome/browser/transport_security_persister.h
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-14 00:16:15 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-14 00:16:15 +0000
commit4cc5a8747adf8327ba0df645237c1d5f52690caf (patch)
tree9b0fbabaa157fd1e8221d12b40451d4eee973d1f /chrome/browser/transport_security_persister.h
parent3d66e35568b1ed073bbec5dd489997134c6a7d9f (diff)
downloadchromium_src-4cc5a8747adf8327ba0df645237c1d5f52690caf.zip
chromium_src-4cc5a8747adf8327ba0df645237c1d5f52690caf.tar.gz
chromium_src-4cc5a8747adf8327ba0df645237c1d5f52690caf.tar.bz2
Remove locks from StrictTransportSecurityState.
These locks can cause the IO thread to block on the FILE thread writing to disk, which is bad news bears. BUG=21518 TEST=No behavior change. Review URL: http://codereview.chromium.org/904005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/transport_security_persister.h')
-rw-r--r--chrome/browser/transport_security_persister.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/chrome/browser/transport_security_persister.h b/chrome/browser/transport_security_persister.h
index 660faa7..5e006ea 100644
--- a/chrome/browser/transport_security_persister.h
+++ b/chrome/browser/transport_security_persister.h
@@ -30,12 +30,13 @@
// copies the current state of the TransportSecurityState, serialises
// and writes to disk.
-#ifndef CHROME_BROWSER_STRICT_TRANSPORT_SECURITY_PERSISTER_H_
-#define CHROME_BROWSER_STRICT_TRANSPORT_SECURITY_PERSISTER_H_
+#ifndef CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_
+#define CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_
#include "base/file_path.h"
#include "base/lock.h"
#include "base/ref_counted.h"
+#include "base/task.h"
#include "net/base/transport_security_state.h"
class TransportSecurityPersister
@@ -54,22 +55,20 @@ class TransportSecurityPersister
~TransportSecurityPersister();
- // a Task callback for when the state needs to be written out.
- void SerialiseState();
+ void Load();
+ void CompleteLoad(const std::string& state);
- // a Task callback for when the state needs to be loaded from disk at startup.
- void LoadState();
+ void Save();
+ void CompleteSave(const std::string& state);
- Lock lock_; // protects all the members
-
- // true when the state object has signaled that we're dirty and we haven't
- // serialised the state yet.
- bool state_is_dirty_;
+ // Used on the IO thread to coalesce writes to disk.
+ ScopedRunnableMethodFactory<TransportSecurityPersister> save_coalescer_;
scoped_refptr<net::TransportSecurityState>
- transport_security_state_;
+ transport_security_state_; // IO thread only.
+
// The path to the file in which we store the serialised state.
FilePath state_file_;
};
-#endif // CHROME_BROWSER_STRICT_TRANSPORT_SECURITY_PERSISTER_H_
+#endif // CHROME_BROWSER_TRANSPORT_SECURITY_PERSISTER_H_