summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authoralecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 04:09:16 +0000
committeralecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 04:09:16 +0000
commit4c8c15b4e1a3829d4996be1ebd2f252d8d12fe44 (patch)
treed170d073bb7dca1e4afe3138c2b6fad8d67ba5ff /webkit
parentd439a08dd05a252dd663f612ce7580ba9354d710 (diff)
downloadchromium_src-4c8c15b4e1a3829d4996be1ebd2f252d8d12fe44.zip
chromium_src-4c8c15b4e1a3829d4996be1ebd2f252d8d12fe44.tar.gz
chromium_src-4c8c15b4e1a3829d4996be1ebd2f252d8d12fe44.tar.bz2
Remove old webkit support code for IndexedDB.
IndexedDB code is now part of WebKit's Platform API, so we don't need to manually inject the factory into the PlatformSupport object anymore. BUG=234278 TBR=jamesr@chromium.org Review URL: https://codereview.chromium.org/16335017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204151 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/support/test_webidbfactory.cc65
-rw-r--r--webkit/support/test_webidbfactory.h52
-rw-r--r--webkit/support/test_webkit_platform_support.cc6
-rw-r--r--webkit/support/test_webkit_platform_support.h1
-rw-r--r--webkit/support/webkit_support.cc5
-rw-r--r--webkit/support/webkit_support.gypi2
6 files changed, 7 insertions, 124 deletions
diff --git a/webkit/support/test_webidbfactory.cc b/webkit/support/test_webidbfactory.cc
deleted file mode 100644
index 42dfc21..0000000
--- a/webkit/support/test_webidbfactory.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2013 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.
-
-#include "webkit/support/test_webidbfactory.h"
-
-#include "base/logging.h"
-#include "webkit/base/file_path_string_conversions.h"
-#include "webkit/support/webkit_support.h"
-
-TestWebIDBFactory::TestWebIDBFactory() {
- // Create a new temp directory for Indexed DB storage, specific to this
- // factory. If this fails, WebKit uses in-memory storage.
- if (!indexed_db_dir_.CreateUniqueTempDir()) {
- LOG(WARNING) << "Failed to create a temp dir for Indexed DB, "
- "using in-memory storage.";
- DCHECK(indexed_db_dir_.path().empty());
- }
-}
-
-TestWebIDBFactory::~TestWebIDBFactory() {
-}
-
-void TestWebIDBFactory::getDatabaseNames(
- WebKit::WebIDBCallbacks* callbacks,
- const WebKit::WebString& database_identifier,
- const WebKit::WebString& data_dir) {
- GetFactory()->getDatabaseNames(callbacks, database_identifier,
- data_dir.isEmpty() ? GetDataDir() : data_dir);
-}
-
-void TestWebIDBFactory::open(
- const WebKit::WebString& name,
- long long version,
- long long transaction_id,
- WebKit::WebIDBCallbacks* callbacks,
- WebKit::WebIDBDatabaseCallbacks* database_callbacks,
- const WebKit::WebString& database_identifier,
- const WebKit::WebString& data_dir) {
- GetFactory()->open(name, version, transaction_id, callbacks,
- database_callbacks, database_identifier,
- data_dir.isEmpty() ? GetDataDir() : data_dir);
-}
-
-void TestWebIDBFactory::deleteDatabase(
- const WebKit::WebString& name,
- WebKit::WebIDBCallbacks* callbacks,
- const WebKit::WebString& database_identifier,
- const WebKit::WebString& data_dir) {
- GetFactory()->deleteDatabase(name, callbacks, database_identifier,
- data_dir.isEmpty() ? GetDataDir() : data_dir);
-}
-
-WebKit::WebIDBFactory* TestWebIDBFactory::GetFactory() {
- WebKit::WebIDBFactory* factory = factories_.Get();
- if (!factory) {
- factory = WebKit::WebIDBFactory::create();
- factories_.Set(factory);
- }
- return factory;
-}
-
-WebKit::WebString TestWebIDBFactory::GetDataDir() const {
- return webkit_base::FilePathToWebString(indexed_db_dir_.path());
-}
diff --git a/webkit/support/test_webidbfactory.h b/webkit/support/test_webidbfactory.h
deleted file mode 100644
index fb902ea..0000000
--- a/webkit/support/test_webidbfactory.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2013 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 WEBKIT_SUPPORT_TEST_WEBIDBFACTORY_H_
-#define WEBKIT_SUPPORT_TEST_WEBIDBFACTORY_H_
-
-#include "base/files/scoped_temp_dir.h"
-#include "base/threading/thread_local.h"
-#include "third_party/WebKit/public/platform/WebIDBFactory.h"
-
-// Wrap a WebKit::WebIDBFactory to rewrite the data directory to
-// a scoped temp directory. In multiprocess Chromium this is rewritten
-// to a real profile directory during IPC.
-class TestWebIDBFactory : public WebKit::WebIDBFactory {
- public:
- TestWebIDBFactory();
- virtual ~TestWebIDBFactory();
-
- // WebIDBFactory methods:
- virtual void getDatabaseNames(WebKit::WebIDBCallbacks*,
- const WebKit::WebString& database_identifier,
- const WebKit::WebString& data_dir);
- virtual void open(const WebKit::WebString& name,
- long long version,
- long long transaction_id,
- WebKit::WebIDBCallbacks*,
- WebKit::WebIDBDatabaseCallbacks*,
- const WebKit::WebString& database_identifier,
- const WebKit::WebString& data_dir);
- virtual void deleteDatabase(const WebKit::WebString& name,
- WebKit::WebIDBCallbacks*,
- const WebKit::WebString& database_identifier,
- const WebKit::WebString& data_dir);
-
- private:
- // Returns the WebIDBFactory implementation to use for the current thread.
- WebKit::WebIDBFactory* GetFactory();
-
- // Returns the data directory to use.
- WebKit::WebString GetDataDir() const;
-
- // We allocate a separate WebIDBFactory instance per thread since the
- // implementation is not thread-safe. We also intentionally leak the
- // factory instances to avoid shutdown races. TODO(darin): Can we
- // avoid leaking these?
- base::ThreadLocalPointer<WebKit::WebIDBFactory> factories_;
-
- base::ScopedTempDir indexed_db_dir_;
-};
-
-#endif // WEBKIT_SUPPORT_TEST_WEBIDBFACTORY_H_
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index 6e352e1..806db54 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -199,6 +199,12 @@ WebKit::WebHyphenator* TestWebKitPlatformSupport::hyphenator() {
return &hyphenator_;
}
+WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() {
+ NOTREACHED() <<
+ "IndexedDB cannot be tested with in-process harnesses.";
+ return NULL;
+}
+
bool TestWebKitPlatformSupport::sandboxEnabled() {
return true;
}
diff --git a/webkit/support/test_webkit_platform_support.h b/webkit/support/test_webkit_platform_support.h
index 1a85dfa..5059031 100644
--- a/webkit/support/test_webkit_platform_support.h
+++ b/webkit/support/test_webkit_platform_support.h
@@ -51,6 +51,7 @@ class TestWebKitPlatformSupport :
virtual WebKit::WebBlobRegistry* blobRegistry();
virtual WebKit::WebFileSystem* fileSystem();
virtual WebKit::WebHyphenator* hyphenator();
+ virtual WebKit::WebIDBFactory* idbFactory();
virtual bool sandboxEnabled();
virtual WebKit::Platform::FileHandle databaseOpenFile(
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 0da75ba..03408df 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -76,7 +76,6 @@
#include "webkit/support/simple_dom_storage_system.h"
#include "webkit/support/simple_file_system.h"
#include "webkit/support/simple_resource_loader_bridge.h"
-#include "webkit/support/test_webidbfactory.h"
#include "webkit/support/test_webkit_platform_support.h"
#include "webkit/support/test_webplugin_page_delegate.h"
#include "webkit/support/web_layer_tree_view_impl_for_testing.h"
@@ -172,9 +171,6 @@ class TestEnvironment {
webkit_platform_support_.reset(
new TestWebKitPlatformSupport(unit_test_mode,
shadow_platform_delegate));
-
- idb_factory_.reset(new TestWebIDBFactory());
- WebKit::setIDBFactory(idb_factory_.get());
}
~TestEnvironment() {
@@ -216,7 +212,6 @@ class TestEnvironment {
scoped_ptr<base::AtExitManager> at_exit_manager_;
scoped_ptr<MessageLoopType> main_message_loop_;
scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_;
- scoped_ptr<TestWebIDBFactory> idb_factory_;
#if defined(OS_ANDROID)
base::FilePath mock_current_directory_;
diff --git a/webkit/support/webkit_support.gypi b/webkit/support/webkit_support.gypi
index a949875..0740a24 100644
--- a/webkit/support/webkit_support.gypi
+++ b/webkit/support/webkit_support.gypi
@@ -61,8 +61,6 @@
'test_stream_texture_factory_android.h',
'test_webkit_platform_support.cc',
'test_webkit_platform_support.h',
- 'test_webidbfactory.cc',
- 'test_webidbfactory.h',
'test_webmessageportchannel.cc',
'test_webmessageportchannel.h',
'test_webplugin_page_delegate.cc',