| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 15 #include "content/public/browser/indexed_db_context.h" | 16 #include "content/public/browser/indexed_db_context.h" |
| 16 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 17 #include "webkit/quota/quota_types.h" | 18 #include "webkit/quota/quota_types.h" |
| 18 | 19 |
| 19 class GURL; | 20 class GURL; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // The indexed db file extension. | 53 // The indexed db file extension. |
| 53 static const base::FilePath::CharType kIndexedDBExtension[]; | 54 static const base::FilePath::CharType kIndexedDBExtension[]; |
| 54 | 55 |
| 55 // Disables the exit-time deletion of session-only data. | 56 // Disables the exit-time deletion of session-only data. |
| 56 void SetForceKeepSessionState() { | 57 void SetForceKeepSessionState() { |
| 57 force_keep_session_state_ = true; | 58 force_keep_session_state_ = true; |
| 58 } | 59 } |
| 59 | 60 |
| 60 // IndexedDBContext implementation: | 61 // IndexedDBContext implementation: |
| 61 virtual std::vector<GURL> GetAllOrigins() OVERRIDE; | 62 virtual std::vector<GURL> GetAllOrigins() OVERRIDE; |
| 63 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() OVERRIDE; |
| 62 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; | 64 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; |
| 63 virtual base::Time GetOriginLastModified(const GURL& origin_url) OVERRIDE; | 65 virtual base::Time GetOriginLastModified(const GURL& origin_url) OVERRIDE; |
| 64 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE; | 66 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE; |
| 65 virtual base::FilePath GetFilePathForTesting( | 67 virtual base::FilePath GetFilePathForTesting( |
| 66 const string16& origin_id) const OVERRIDE; | 68 const string16& origin_id) const OVERRIDE; |
| 67 | 69 |
| 68 // Methods called by IndexedDBDispatcherHost for quota support. | 70 // Methods called by IndexedDBDispatcherHost for quota support. |
| 69 void ConnectionOpened(const GURL& origin_url, WebKit::WebIDBDatabase*); | 71 void ConnectionOpened(const GURL& origin_url, WebKit::WebIDBDatabase*); |
| 70 void ConnectionClosed(const GURL& origin_url, WebKit::WebIDBDatabase*); | 72 void ConnectionClosed(const GURL& origin_url, WebKit::WebIDBDatabase*); |
| 71 void TransactionComplete(const GURL& origin_url); | 73 void TransactionComplete(const GURL& origin_url); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 OriginToSizeMap space_available_map_; | 131 OriginToSizeMap space_available_map_; |
| 130 typedef std::set<WebKit::WebIDBDatabase*> ConnectionSet; | 132 typedef std::set<WebKit::WebIDBDatabase*> ConnectionSet; |
| 131 std::map<GURL, ConnectionSet> connections_; | 133 std::map<GURL, ConnectionSet> connections_; |
| 132 | 134 |
| 133 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); | 135 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); |
| 134 }; | 136 }; |
| 135 | 137 |
| 136 } // namespace content | 138 } // namespace content |
| 137 | 139 |
| 138 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ | 140 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONTEXT_IMPL_H_ |
| OLD | NEW |