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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_
10 #include "base/basictypes.h"
11 #include "base/files/file_path.h"
12 #include "base/memory/ref_counted.h"
13 #include "content/common/content_export.h"
14 #include "content/public/browser/indexed_db_info.h"
18 // Represents the per-BrowserContext IndexedDB data.
19 // Call these methods only on the WebKit thread.
20 class IndexedDBContext
: public base::RefCountedThreadSafe
<IndexedDBContext
> {
22 // Methods used in response to QuotaManager requests.
23 virtual std::vector
<GURL
> GetAllOrigins() = 0;
24 virtual std::vector
<IndexedDBInfo
> GetAllOriginsInfo() = 0;
25 virtual int64
GetOriginDiskUsage(const GURL
& origin_url
) = 0;
26 virtual base::Time
GetOriginLastModified(const GURL
& origin_url
) = 0;
28 // Deletes all indexed db files for the given origin.
29 virtual void DeleteForOrigin(const GURL
& origin_url
) = 0;
31 // Get the file name of the local storage file for the given origin.
32 virtual base::FilePath
GetFilePathForTesting(
33 const string16
& origin_id
) const = 0;
36 friend class base::RefCountedThreadSafe
<IndexedDBContext
>;
37 virtual ~IndexedDBContext() {}
40 } // namespace content
42 #endif // CONTENT_PUBLIC_BROWSER_INDEXED_DB_CONTEXT_H_