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

Unified Diff: components/filesystem/lock_table.h

Issue 1737933002: mojo leveldb: Get profile and leveldb connected to DOMStorageContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge tot Created 4 years, 9 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: components/filesystem/lock_table.h
diff --git a/components/filesystem/lock_table.h b/components/filesystem/lock_table.h
index 9be4ca695dfc5b1765bc7a8c89d6507bc778836d..73674ac2211ba5224ba2fd6717354a8946fe0bef 100644
--- a/components/filesystem/lock_table.h
+++ b/components/filesystem/lock_table.h
@@ -8,6 +8,7 @@
#include <set>
#include "base/files/file.h"
+#include "base/memory/ref_counted.h"
namespace filesystem {
@@ -16,10 +17,9 @@ class FileImpl;
// A table of all locks held by this process. We have one global table owned by
// the app, but accessible by everything just in case two connections from the
// same origin try to lock the same file.
-class LockTable {
+class LockTable : public base::RefCounted<LockTable> {
public:
LockTable();
- ~LockTable();
// Locks a file.
base::File::Error LockFile(FileImpl* file);
@@ -33,6 +33,9 @@ class LockTable {
void RemoveFromLockTable(const base::FilePath& path);
private:
+ friend class base::RefCounted<LockTable>;
+ ~LockTable();
+
// Open, locked files. We keep track of this so we quickly error when we try
// to double lock a file.
std::set<base::FilePath> locked_files_;

Powered by Google App Engine
This is Rietveld 408576698