Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: content/public/browser/indexed_db_context.h

Issue 17518004: Move IndexedDB from WEBKIT_DEPRECATED to dedicated thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: IOS build fix Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "content/public/browser/indexed_db_info.h" 14 #include "content/public/browser/indexed_db_info.h"
15 15
16 namespace base {
17 class SequencedTaskRunner;
18 class TaskRunner;
19 }
20
16 namespace content { 21 namespace content {
17 22
18 // Represents the per-BrowserContext IndexedDB data. 23 // Represents the per-BrowserContext IndexedDB data.
19 // Call these methods only on the WebKit thread. 24 // Call these methods only via the exposed TaskRunner.
20 class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> { 25 class IndexedDBContext : public base::RefCountedThreadSafe<IndexedDBContext> {
21 public: 26 public:
27 // Only call the below methods by posting to this TaskRunner.
28 virtual base::TaskRunner* TaskRunner() const = 0;
29
22 // Methods used in response to QuotaManager requests. 30 // Methods used in response to QuotaManager requests.
23 virtual std::vector<GURL> GetAllOrigins() = 0; 31 virtual std::vector<GURL> GetAllOrigins() = 0;
24 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() = 0; 32 virtual std::vector<IndexedDBInfo> GetAllOriginsInfo() = 0;
25 virtual int64 GetOriginDiskUsage(const GURL& origin_url) = 0; 33 virtual int64 GetOriginDiskUsage(const GURL& origin_url) = 0;
26 virtual base::Time GetOriginLastModified(const GURL& origin_url) = 0; 34 virtual base::Time GetOriginLastModified(const GURL& origin_url) = 0;
27 35
28 // Deletes all indexed db files for the given origin. 36 // Deletes all indexed db files for the given origin.
29 virtual void DeleteForOrigin(const GURL& origin_url) = 0; 37 virtual void DeleteForOrigin(const GURL& origin_url) = 0;
30 38
31 // Get the file name of the local storage file for the given origin. 39 // Get the file name of the local storage file for the given origin.
32 virtual base::FilePath GetFilePathForTesting( 40 virtual base::FilePath GetFilePathForTesting(
33 const std::string& origin_id) const = 0; 41 const std::string& origin_id) const = 0;
42 // Set the task runner for tests if browser main loop is not initialized.
43 virtual void SetTaskRunnerForTesting(
44 base::SequencedTaskRunner* task_runner) = 0;
34 45
35 protected: 46 protected:
36 friend class base::RefCountedThreadSafe<IndexedDBContext>; 47 friend class base::RefCountedThreadSafe<IndexedDBContext>;
37 virtual ~IndexedDBContext() {} 48 virtual ~IndexedDBContext() {}
38 }; 49 };
39 50
40 } // namespace content 51 } // namespace content
41 52
42 #endif // CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_ 53 #endif // CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698