diff options
author | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-09 19:17:41 +0000 |
---|---|---|
committer | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-09 19:17:41 +0000 |
commit | d7ada223627316a694baf30b8576cf9f9c602e06 (patch) | |
tree | 7a8e463f290fb657cec081bde60770d54dc1bde3 | |
parent | 40a98e47ed7e4636c0c611a2857c428446e0dff2 (diff) | |
download | chromium_src-d7ada223627316a694baf30b8576cf9f9c602e06.zip chromium_src-d7ada223627316a694baf30b8576cf9f9c602e06.tar.gz chromium_src-d7ada223627316a694baf30b8576cf9f9c602e06.tar.bz2 |
Merge 113708 - Use correct callback type for deleteDatabase result
BUG=106883
TEST=
Review URL: http://codereview.chromium.org/8879034
TBR=jsbell@chromium.org
Review URL: http://codereview.chromium.org/8897007
git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@113832 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 30 insertions, 5 deletions
diff --git a/chrome/test/data/indexeddb/bug_106883.html b/chrome/test/data/indexeddb/bug_106883.html new file mode 100644 index 0000000..65c5d59 --- /dev/null +++ b/chrome/test/data/indexeddb/bug_106883.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <head> + <title>IndexedDB regression test for bug 106883</title> + <script type="text/javascript" src="common.js"></script> + <script type="text/javascript" src="bug_106883.js"></script> + </head> + <body onLoad="test()"> + <div id="status">Starting...</div> + </body> +</html> diff --git a/chrome/test/data/indexeddb/bug_106883.js b/chrome/test/data/indexeddb/bug_106883.js new file mode 100644 index 0000000..ca4cbc1 --- /dev/null +++ b/chrome/test/data/indexeddb/bug_106883.js @@ -0,0 +1,10 @@ +// Copyright (c) 2011 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. + +function test() +{ + webkitIndexedDB.deleteDatabase('no-such-database').onsuccess = function() { + window.close(); + }; +} diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc index 759efda..e30d9c3 100644 --- a/content/browser/in_process_webkit/indexed_db_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc @@ -124,6 +124,13 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, Bug84933Test) { ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 1); } +IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, Bug106883Test) { + const GURL url = testUrl(FilePath(FILE_PATH_LITERAL("bug_106883.html"))); + + // Just navigate to the URL. Test will crash if it fails. + ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 1); +} + // In proc browser test is needed here because ClearLocalState indirectly calls // WebKit's isMainThread through WebSecurityOrigin->SecurityOrigin. IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ClearLocalState) { diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc index e55e122..1fbfbed 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -259,14 +259,11 @@ void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( IndexedDBContext::kIndexedDBDirectory); } - WebSecurityOrigin origin( - WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); - GURL url(origin.toString()); - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); Context()->GetIDBFactory()->deleteDatabase( params.name, - new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id, url), + new IndexedDBCallbacks<WebSerializedScriptValue>(this, + params.response_id), WebSecurityOrigin::createFromDatabaseIdentifier(params.origin), NULL, webkit_glue::FilePathToWebString(indexed_db_path)); } |