Commit 5a7b4c86 authored by hans@chromium.org's avatar hans@chromium.org

IndexedDB: Update calls to and implementations of WebIDBFactory.

The BackingStoreType and maximumSize parameters have been removed.

Remove the --indexeddb-use-sqlite command-line flag.

BUG=none
TEST=all current tests pass (layout tests, browser tests, pyautotests)

Review URL: http://codereview.chromium.org/8202003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107547 0039d316-1c4b-4281-b951-d872f2087c98
parent ccaf7094
...@@ -59,21 +59,10 @@ class IndexedDBBrowserTest : public InProcessBrowserTest { ...@@ -59,21 +59,10 @@ class IndexedDBBrowserTest : public InProcessBrowserTest {
} }
}; };
class IndexedDBSQLiteBrowserTest : public IndexedDBBrowserTest {
public:
virtual void SetUpCommandLine(CommandLine* command_line) {
command_line->AppendSwitch(switches::kSQLiteIndexedDatabase);
}
};
IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) {
SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html"))));
} }
IN_PROC_BROWSER_TEST_F(IndexedDBSQLiteBrowserTest, CursorTest) {
SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html"))));
}
IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTestIncognito) { IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTestIncognito) {
SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html"))), SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html"))),
true /* incognito */); true /* incognito */);
......
...@@ -210,21 +210,9 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( ...@@ -210,21 +210,9 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
WebKit::WebIDBFactory::BackingStoreType backingStoreType =
WebKit::WebIDBFactory::LevelDBBackingStore;
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSQLiteIndexedDatabase)) {
backingStoreType = WebKit::WebIDBFactory::SQLiteBackingStore;
}
// TODO(dgrogan): Delete this magic constant once we've removed sqlite.
static const uint64 kIncognitoSqliteBackendQuota = 50 * 1024 * 1024;
Context()->GetIDBFactory()->getDatabaseNames( Context()->GetIDBFactory()->getDatabaseNames(
new IndexedDBCallbacks<WebDOMStringList>(this, params.response_id), new IndexedDBCallbacks<WebDOMStringList>(this, params.response_id),
origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path), origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path));
kIncognitoSqliteBackendQuota, backingStoreType);
} }
void IndexedDBDispatcherHost::OnIDBFactoryOpen( void IndexedDBDispatcherHost::OnIDBFactoryOpen(
...@@ -247,25 +235,13 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen( ...@@ -247,25 +235,13 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
WebKit::WebIDBFactory::BackingStoreType backingStoreType =
WebKit::WebIDBFactory::LevelDBBackingStore;
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSQLiteIndexedDatabase)) {
backingStoreType = WebKit::WebIDBFactory::SQLiteBackingStore;
}
// TODO(dgrogan): Delete this magic constant once we've removed sqlite.
static const uint64 kIncognitoSqliteBackendQuota = 50 * 1024 * 1024;
// TODO(dgrogan): Don't let a non-existing database be opened (and therefore // TODO(dgrogan): Don't let a non-existing database be opened (and therefore
// created) if this origin is already over quota. // created) if this origin is already over quota.
Context()->GetIDBFactory()->open( Context()->GetIDBFactory()->open(
params.name, params.name,
new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id, new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id,
origin_url), origin_url),
origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path), origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path));
kIncognitoSqliteBackendQuota, backingStoreType);
} }
void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase(
......
...@@ -452,10 +452,6 @@ const char kSingleProcess[] = "single-process"; ...@@ -452,10 +452,6 @@ const char kSingleProcess[] = "single-process";
// content. The switch is intended only for tests. // content. The switch is intended only for tests.
const char kSkipGpuDataLoading[] = "skip-gpu-data-loading"; const char kSkipGpuDataLoading[] = "skip-gpu-data-loading";
// Use SQLite as back-end for Indexed Database API.
// Used for debugging differences between the LevelDB and SQLite back-end.
const char kSQLiteIndexedDatabase[] = "indexeddb-use-sqlite";
// Runs the security test for the renderer sandbox. // Runs the security test for the renderer sandbox.
const char kTestSandbox[] = "test-sandbox"; const char kTestSandbox[] = "test-sandbox";
......
...@@ -144,7 +144,6 @@ extern const char kShowPaintRects[]; ...@@ -144,7 +144,6 @@ extern const char kShowPaintRects[];
extern const char kSimpleDataSource[]; extern const char kSimpleDataSource[];
CONTENT_EXPORT extern const char kSingleProcess[]; CONTENT_EXPORT extern const char kSingleProcess[];
CONTENT_EXPORT extern const char kSkipGpuDataLoading[]; CONTENT_EXPORT extern const char kSkipGpuDataLoading[];
CONTENT_EXPORT extern const char kSQLiteIndexedDatabase[];
CONTENT_EXPORT extern const char kTestSandbox[]; CONTENT_EXPORT extern const char kTestSandbox[];
extern const char kUnlimitedQuotaForFiles[]; extern const char kUnlimitedQuotaForFiles[];
CONTENT_EXPORT extern const char kUserAgent[]; CONTENT_EXPORT extern const char kUserAgent[];
......
...@@ -26,9 +26,7 @@ void RendererWebIDBFactoryImpl::getDatabaseNames( ...@@ -26,9 +26,7 @@ void RendererWebIDBFactoryImpl::getDatabaseNames(
WebIDBCallbacks* callbacks, WebIDBCallbacks* callbacks,
const WebSecurityOrigin& origin, const WebSecurityOrigin& origin,
WebFrame* web_frame, WebFrame* web_frame,
const WebString& data_dir_unused, const WebString& data_dir_unused) {
unsigned long long maximum_size_unused,
WebKit::WebIDBFactory::BackingStoreType) {
IndexedDBDispatcher* dispatcher = IndexedDBDispatcher* dispatcher =
RenderThreadImpl::current()->indexed_db_dispatcher(); RenderThreadImpl::current()->indexed_db_dispatcher();
dispatcher->RequestIDBFactoryGetDatabaseNames( dispatcher->RequestIDBFactoryGetDatabaseNames(
...@@ -40,9 +38,7 @@ void RendererWebIDBFactoryImpl::open( ...@@ -40,9 +38,7 @@ void RendererWebIDBFactoryImpl::open(
WebIDBCallbacks* callbacks, WebIDBCallbacks* callbacks,
const WebSecurityOrigin& origin, const WebSecurityOrigin& origin,
WebFrame* web_frame, WebFrame* web_frame,
const WebString& data_dir, const WebString& data_dir) {
unsigned long long maximum_size_unused,
WebKit::WebIDBFactory::BackingStoreType) {
// Don't send the data_dir. We know what we want on the Browser side of // Don't send the data_dir. We know what we want on the Browser side of
// things. // things.
IndexedDBDispatcher* dispatcher = IndexedDBDispatcher* dispatcher =
...@@ -57,17 +53,6 @@ void RendererWebIDBFactoryImpl::deleteDatabase( ...@@ -57,17 +53,6 @@ void RendererWebIDBFactoryImpl::deleteDatabase(
const WebSecurityOrigin& origin, const WebSecurityOrigin& origin,
WebFrame* web_frame, WebFrame* web_frame,
const WebString& data_dir) { const WebString& data_dir) {
deleteDatabase(name, callbacks, origin, web_frame, data_dir,
WebKit::WebIDBFactory::DefaultBackingStore);
}
void RendererWebIDBFactoryImpl::deleteDatabase(
const WebString& name,
WebIDBCallbacks* callbacks,
const WebSecurityOrigin& origin,
WebFrame* web_frame,
const WebString& data_dir,
WebKit::WebIDBFactory::BackingStoreType) {
// Don't send the data_dir. We know what we want on the Browser side of // Don't send the data_dir. We know what we want on the Browser side of
// things. // things.
IndexedDBDispatcher* dispatcher = IndexedDBDispatcher* dispatcher =
......
...@@ -28,22 +28,9 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory { ...@@ -28,22 +28,9 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory {
WebKit::WebIDBCallbacks* callbacks, WebKit::WebIDBCallbacks* callbacks,
const WebKit::WebSecurityOrigin& origin, const WebKit::WebSecurityOrigin& origin,
WebKit::WebFrame* web_frame, WebKit::WebFrame* web_frame,
const WebKit::WebString& data_dir, const WebKit::WebString& data_dir);
// TODO(dgrogan): Remove maximum_size after it's out of the webkit api.
unsigned long long maximum_size,
WebKit::WebIDBFactory::BackingStoreType);
virtual void open( virtual void open(
const WebKit::WebString& name,
WebKit::WebIDBCallbacks* callbacks,
const WebKit::WebSecurityOrigin& origin,
WebKit::WebFrame* web_frame,
const WebKit::WebString& data_dir,
// TODO(dgrogan): Remove maximum_size after it's out of the webkit api.
unsigned long long maximum_size,
WebKit::WebIDBFactory::BackingStoreType);
// FIXME(jochen): remove after webkit roll.
virtual void deleteDatabase(
const WebKit::WebString& name, const WebKit::WebString& name,
WebKit::WebIDBCallbacks* callbacks, WebKit::WebIDBCallbacks* callbacks,
const WebKit::WebSecurityOrigin& origin, const WebKit::WebSecurityOrigin& origin,
...@@ -54,8 +41,7 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory { ...@@ -54,8 +41,7 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory {
WebKit::WebIDBCallbacks* callbacks, WebKit::WebIDBCallbacks* callbacks,
const WebKit::WebSecurityOrigin& origin, const WebKit::WebSecurityOrigin& origin,
WebKit::WebFrame* web_frame, WebKit::WebFrame* web_frame,
const WebKit::WebString& data_dir, const WebKit::WebString& data_dir);
WebKit::WebIDBFactory::BackingStoreType);
}; };
#endif // CONTENT_RENDERER_RENDERER_WEBIDBFACTORY_IMPL_H_ #endif // CONTENT_RENDERER_RENDERER_WEBIDBFACTORY_IMPL_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment