| 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> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 // Methods called by IndexedDBDispatcherHost for quota support. | 69 // Methods called by IndexedDBDispatcherHost for quota support. |
| 70 void ConnectionOpened(const GURL& origin_url); | 70 void ConnectionOpened(const GURL& origin_url); |
| 71 void ConnectionClosed(const GURL& origin_url); | 71 void ConnectionClosed(const GURL& origin_url); |
| 72 void TransactionComplete(const GURL& origin_url); | 72 void TransactionComplete(const GURL& origin_url); |
| 73 bool WouldBeOverQuota(const GURL& origin_url, int64 additional_bytes); | 73 bool WouldBeOverQuota(const GURL& origin_url, int64 additional_bytes); |
| 74 bool IsOverQuota(const GURL& origin_url); | 74 bool IsOverQuota(const GURL& origin_url); |
| 75 | 75 |
| 76 quota::QuotaManagerProxy* quota_manager_proxy(); | 76 quota::QuotaManagerProxy* quota_manager_proxy(); |
| 77 | 77 |
| 78 #ifdef UNIT_TEST | |
| 79 // For unit tests allow to override the |data_path_|. | 78 // For unit tests allow to override the |data_path_|. |
| 80 void set_data_path(const FilePath& data_path) { data_path_ = data_path; } | 79 void set_data_path_for_testing(const FilePath& data_path) { |
| 81 #endif | 80 data_path_ = data_path; |
| 81 } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 FRIEND_TEST(ExtensionServiceTest, ClearExtensionData); | 84 FRIEND_TEST(ExtensionServiceTest, ClearExtensionData); |
| 85 FRIEND_TEST(ExtensionServiceTest, ClearAppData); | 85 FRIEND_TEST(ExtensionServiceTest, ClearAppData); |
| 86 FRIEND_TEST(IndexedDBBrowserTest, ClearLocalState); | 86 FRIEND_TEST(IndexedDBBrowserTest, ClearLocalState); |
| 87 FRIEND_TEST(IndexedDBBrowserTest, ClearSessionOnlyDatabases); | 87 FRIEND_TEST(IndexedDBBrowserTest, ClearSessionOnlyDatabases); |
| 88 friend class IndexedDBQuotaClientTest; | 88 friend class IndexedDBQuotaClientTest; |
| 89 | 89 |
| 90 typedef std::map<GURL, int64> OriginToSizeMap; | 90 typedef std::map<GURL, int64> OriginToSizeMap; |
| 91 class IndexedDBGetUsageAndQuotaCallback; | 91 class IndexedDBGetUsageAndQuotaCallback; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 119 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | 119 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
| 120 scoped_ptr<std::set<GURL> > origin_set_; | 120 scoped_ptr<std::set<GURL> > origin_set_; |
| 121 OriginToSizeMap origin_size_map_; | 121 OriginToSizeMap origin_size_map_; |
| 122 OriginToSizeMap space_available_map_; | 122 OriginToSizeMap space_available_map_; |
| 123 std::map<GURL, unsigned int> connection_count_; | 123 std::map<GURL, unsigned int> connection_count_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); | 125 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 128 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| OLD | NEW |