diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 17:40:50 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-24 17:40:50 +0000 |
commit | 567812dd45d36e093554664bdbd4284a9670a8b3 (patch) | |
tree | 803b8da070eabfd2efa6a50b53f331c4255bbbc6 /content/browser/in_process_webkit/indexed_db_context.h | |
parent | abe19c107967234fce377db157b8b963f83ec529 (diff) | |
download | chromium_src-567812dd45d36e093554664bdbd4284a9670a8b3.zip chromium_src-567812dd45d36e093554664bdbd4284a9670a8b3.tar.gz chromium_src-567812dd45d36e093554664bdbd4284a9670a8b3.tar.bz2 |
Move in_process_webkit dir from chrome\browser to content\browser.
Review URL: http://codereview.chromium.org/6580019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/in_process_webkit/indexed_db_context.h')
-rw-r--r-- | content/browser/in_process_webkit/indexed_db_context.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/content/browser/in_process_webkit/indexed_db_context.h b/content/browser/in_process_webkit/indexed_db_context.h new file mode 100644 index 0000000..d7f8403 --- /dev/null +++ b/content/browser/in_process_webkit/indexed_db_context.h @@ -0,0 +1,63 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ +#define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ +#pragma once + +#include "base/basictypes.h" +#include "base/file_path.h" +#include "base/scoped_ptr.h" + +class FilePath; +class WebKitContext; + +namespace WebKit { +class WebIDBFactory; +} + +class IndexedDBContext { + public: + explicit IndexedDBContext(WebKitContext* webkit_context); + ~IndexedDBContext(); + + WebKit::WebIDBFactory* GetIDBFactory(); + + // The indexed db directory. + static const FilePath::CharType kIndexedDBDirectory[]; + + // The indexed db file extension. + static const FilePath::CharType kIndexedDBExtension[]; + + // Get the file name of the indexed db file for the given origin. + FilePath GetIndexedDBFilePath(const string16& origin_id) const; + + void set_clear_local_state_on_exit(bool clear_local_state) { + clear_local_state_on_exit_ = clear_local_state; + } + + // Deletes a single indexed db file. + void DeleteIndexedDBFile(const FilePath& file_path); + + // Deletes all indexed db files for the given origin. + void DeleteIndexedDBForOrigin(const string16& origin_id); + +#ifdef UNIT_TEST + // For unit tests allow to override the |data_path_|. + void set_data_path(const FilePath& data_path) { data_path_ = data_path; } +#endif + + private: + scoped_ptr<WebKit::WebIDBFactory> idb_factory_; + + // Path where the indexed db data is stored + FilePath data_path_; + + // True if the destructor should delete its files. + bool clear_local_state_on_exit_; + + DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); +}; + +#endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |