| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 21 #include "webkit/quota/quota_types.h" |
| 21 | 22 |
| 22 class GURL; | 23 class GURL; |
| 23 class FilePath; | 24 class FilePath; |
| 24 class WebKitContext; | 25 class WebKitContext; |
| 25 | 26 |
| 26 namespace WebKit { | 27 namespace WebKit { |
| 27 class WebIDBFactory; | 28 class WebIDBFactory; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace base { | 31 namespace base { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 FRIEND_TEST(IndexedDBBrowserTest, ClearSessionOnlyDatabases); | 88 FRIEND_TEST(IndexedDBBrowserTest, ClearSessionOnlyDatabases); |
| 88 friend class IndexedDBQuotaClientTest; | 89 friend class IndexedDBQuotaClientTest; |
| 89 | 90 |
| 90 typedef std::map<GURL, int64> OriginToSizeMap; | 91 typedef std::map<GURL, int64> OriginToSizeMap; |
| 91 class IndexedDBGetUsageAndQuotaCallback; | 92 class IndexedDBGetUsageAndQuotaCallback; |
| 92 | 93 |
| 93 FilePath GetIndexedDBFilePath(const string16& origin_id) const; | 94 FilePath GetIndexedDBFilePath(const string16& origin_id) const; |
| 94 int64 ReadUsageFromDisk(const GURL& origin_url) const; | 95 int64 ReadUsageFromDisk(const GURL& origin_url) const; |
| 95 void EnsureDiskUsageCacheInitialized(const GURL& origin_url); | 96 void EnsureDiskUsageCacheInitialized(const GURL& origin_url); |
| 96 void QueryDiskAndUpdateQuotaUsage(const GURL& origin_url); | 97 void QueryDiskAndUpdateQuotaUsage(const GURL& origin_url); |
| 98 void GotUsageAndQuota(const GURL& origin_url, quota::QuotaStatusCode, |
| 99 int64 usage, int64 quota); |
| 97 void GotUpdatedQuota(const GURL& origin_url, int64 usage, int64 quota); | 100 void GotUpdatedQuota(const GURL& origin_url, int64 usage, int64 quota); |
| 98 void QueryAvailableQuota(const GURL& origin_url); | 101 void QueryAvailableQuota(const GURL& origin_url); |
| 99 | 102 |
| 100 std::set<GURL>* GetOriginSet(); | 103 std::set<GURL>* GetOriginSet(); |
| 101 bool AddToOriginSet(const GURL& origin_url) { | 104 bool AddToOriginSet(const GURL& origin_url) { |
| 102 return GetOriginSet()->insert(origin_url).second; | 105 return GetOriginSet()->insert(origin_url).second; |
| 103 } | 106 } |
| 104 void RemoveFromOriginSet(const GURL& origin_url) { | 107 void RemoveFromOriginSet(const GURL& origin_url) { |
| 105 GetOriginSet()->erase(origin_url); | 108 GetOriginSet()->erase(origin_url); |
| 106 } | 109 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 119 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | 122 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
| 120 scoped_ptr<std::set<GURL> > origin_set_; | 123 scoped_ptr<std::set<GURL> > origin_set_; |
| 121 OriginToSizeMap origin_size_map_; | 124 OriginToSizeMap origin_size_map_; |
| 122 OriginToSizeMap space_available_map_; | 125 OriginToSizeMap space_available_map_; |
| 123 std::map<GURL, unsigned int> connection_count_; | 126 std::map<GURL, unsigned int> connection_count_; |
| 124 | 127 |
| 125 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); | 128 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); |
| 126 }; | 129 }; |
| 127 | 130 |
| 128 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 131 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| OLD | NEW |