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 408cccc737a15a2a863092a8093bbbcdeeb3e9a9..c0be1dde57d444919ad0c25f033d9fa8a7dfb3c9 100644 |
--- a/content/browser/in_process_webkit/indexed_db_context.h |
+++ b/content/browser/in_process_webkit/indexed_db_context.h |
@@ -6,6 +6,8 @@ |
#define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
#pragma once |
+#include <map> |
+ |
#include "base/basictypes.h" |
#include "base/file_path.h" |
#include "base/memory/ref_counted.h" |
@@ -53,17 +55,21 @@ class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> { |
clear_local_state_on_exit_ = clear_local_state; |
} |
- // Deletes a single indexed db file. |
- void DeleteIndexedDBFile(const FilePath& file_path); |
- |
// Deletes all indexed db files for the given origin. |
- void DeleteIndexedDBForOrigin(const string16& origin_id); |
+ void DeleteIndexedDBForOrigin(const GURL& origin_url); |
// Does a particular origin get unlimited storage? |
bool IsUnlimitedStorageGranted(const GURL& origin) const; |
void GetAllOriginIdentifiers(std::vector<string16>* origin_ids); |
+ void ConnectionOpened(const GURL& origin_url); |
+ void TransactionComplete(const GURL& origin_url); |
+ void ConnectionClosed(const GURL& origin_url); |
+ int64 InitializeDiskUsage(const GURL& origin_url); |
+ bool WouldBeOverQuota(const GURL& origin_url, int64 additional_bytes); |
+ bool IsOverQuota(const GURL& origin_url); |
+ |
quota::QuotaManagerProxy* quota_manager_proxy(); |
#ifdef UNIT_TEST |
@@ -72,6 +78,14 @@ class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> { |
#endif |
private: |
+ typedef std::map<GURL, int64> OriginToSizeMap; |
+ class IndexedDBGetUsageAndQuotaCallback; |
+ |
+ int64 ReadUsageFromDisk(const GURL& origin_url) const; |
+ void QueryAvailableQuota(const GURL& origin_url); |
+ void QueryDiskAndUpdateQuotaUsage(const GURL& origin_url); |
+ void GotUpdatedQuota(const GURL& origin_url, int64 usage, int64 quota); |
+ |
scoped_ptr<WebKit::WebIDBFactory> idb_factory_; |
// Path where the indexed db data is stored |
@@ -84,6 +98,10 @@ class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> { |
scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
+ OriginToSizeMap origin_size_map_; |
+ OriginToSizeMap space_available_map_; |
+ std::map<GURL, unsigned int> connection_count_; |
+ |
DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); |
}; |