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

Unified Diff: content/browser/in_process_webkit/indexed_db_context.h

Issue 7053030: Initial IndexedDBQuotaClient implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: custom struct for refptr to use on Destruct Created 9 years, 7 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
« no previous file with comments | « chrome/test/testing_profile.cc ('k') | content/browser/in_process_webkit/indexed_db_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/in_process_webkit/indexed_db_context.h
diff --git a/content/browser/in_process_webkit/indexed_db_context.h b/content/browser/in_process_webkit/indexed_db_context.h
index 2bd32e500405d5b363c84799975cd93cb739a156..849a97ab74d0c1dfead5a0dd3159f29fca88a3e0 100644
--- a/content/browser/in_process_webkit/indexed_db_context.h
+++ b/content/browser/in_process_webkit/indexed_db_context.h
@@ -10,6 +10,7 @@
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "content/browser/browser_thread.h"
class GURL;
class FilePath;
@@ -19,14 +20,26 @@ namespace WebKit {
class WebIDBFactory;
}
+namespace base {
+class MessageLoopProxy;
+}
+
namespace quota {
+class QuotaManagerProxy;
class SpecialStoragePolicy;
}
-class IndexedDBContext {
+struct DeleteOnWebKitThread;
+
+class IndexedDBContext :
+ public base::RefCountedThreadSafe<IndexedDBContext,
+ DeleteOnWebKitThread> {
jam 2011/05/28 03:08:51 if you want to handle the leak in unittests, then
dgrogan 2011/05/31 23:26:07 Thanks. Done.
public:
IndexedDBContext(WebKitContext* webkit_context,
- quota::SpecialStoragePolicy* special_storage_policy);
+ quota::SpecialStoragePolicy* special_storage_policy,
+ quota::QuotaManagerProxy* quota_manager_proxy,
+ base::MessageLoopProxy* webkit_thread_loop);
+
~IndexedDBContext();
WebKit::WebIDBFactory* GetIDBFactory();
@@ -69,7 +82,26 @@ class IndexedDBContext {
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
+ scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
+
DISALLOW_COPY_AND_ASSIGN(IndexedDBContext);
};
+// This was copied from browser_thread.h and modified.
+struct DeleteOnWebKitThread {
+ static void Destruct(const IndexedDBContext* x) {
+ BrowserThread::ID thread = BrowserThread::WEBKIT;
+ if (BrowserThread::CurrentlyOn(thread)) {
+ delete x;
+ } else {
+ if (!BrowserThread::DeleteSoon(thread, FROM_HERE, x)) {
+#if defined(UNIT_TEST)
+ LOG(INFO) << "DeleteSoon failed on thread, deleting locally" << thread;
+ delete x;
+#endif // UNIT_TEST
+ }
+ }
+ }
+};
+
#endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_
« no previous file with comments | « chrome/test/testing_profile.cc ('k') | content/browser/in_process_webkit/indexed_db_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698