Chromium Code Reviews| 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_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 namespace content { | 21 namespace content { |
| 22 | 22 |
| 23 // Represents the per-BrowserContext IndexedDB data. | 23 // Represents the per-BrowserContext IndexedDB data. |
| 24 // Call these methods only via the exposed TaskRunner. | 24 // Call these methods only via the exposed TaskRunner. |
| 25 class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> { | 25 class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> { |
| 26 public: | 26 public: |
| 27 // Only call the below methods by posting to this TaskRunner. | 27 // Only call the below methods by posting to this TaskRunner. |
| 28 virtual base::TaskRunner* TaskRunner() const = 0; | 28 virtual base::TaskRunner* TaskRunner() const = 0; |
| 29 | 29 |
| 30 // Methods used in response to QuotaManager requests. | 30 // Methods used in response to QuotaManager requests. |
| 31 virtual std::vector<GURL> GetAllOrigins() = 0; | |
|
jsbell
2013/11/14 23:34:12
Cool - these are called via impl now from the IDB
| |
| 32 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() = 0; | 31 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() = 0; |
| 33 virtual int64 GetOriginDiskUsage(const GURL& origin_url) = 0; | 32 virtual int64 GetOriginDiskUsage(const GURL& origin_url) = 0; |
| 34 virtual base::Time GetOriginLastModified(const GURL& origin_url) = 0; | |
| 35 | 33 |
| 36 // Deletes all indexed db files for the given origin. | 34 // Deletes all indexed db files for the given origin. |
| 37 virtual void DeleteForOrigin(const GURL& origin_url) = 0; | 35 virtual void DeleteForOrigin(const GURL& origin_url) = 0; |
| 38 | 36 |
| 39 // Get the file name of the local storage file for the given origin. | 37 // Get the file name of the local storage file for the given origin. |
| 40 virtual base::FilePath GetFilePathForTesting( | 38 virtual base::FilePath GetFilePathForTesting( |
| 41 const std::string& origin_id) const = 0; | 39 const std::string& origin_id) const = 0; |
| 42 // Set the task runner for tests if browser main loop is not initialized. | 40 // Set the task runner for tests if browser main loop is not initialized. |
| 43 virtual void SetTaskRunnerForTesting( | 41 virtual void SetTaskRunnerForTesting( |
| 44 base::SequencedTaskRunner* task_runner) = 0; | 42 base::SequencedTaskRunner* task_runner) = 0; |
| 45 | 43 |
| 46 protected: | 44 protected: |
| 47 friend class base::RefCountedThreadSafe<IndexedDBContext>; | 45 friend class base::RefCountedThreadSafe<IndexedDBContext>; |
| 48 virtual ~IndexedDBContext() {} | 46 virtual ~IndexedDBContext() {} |
| 49 }; | 47 }; |
| 50 | 48 |
| 51 } // namespace content | 49 } // namespace content |
| 52 | 50 |
| 53 #endif // CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_ | 51 #endif // CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_ |
| OLD | NEW |