Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: webkit/support/test_webkit_platform_support.cc

Issue 12230054: Make TestWebIDBFactory allocate a separate WebIDBFactory per thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/test_webkit_platform_support.cc
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index e9f1961ed98c59416a21d21013cb963ab761113f..a8897a9a34b5c6b14cd5c15729894dfa14dda4f5 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -342,73 +342,6 @@ TestWebKitPlatformSupport::createLocalStorageNamespace(
return dom_storage_system_.CreateLocalStorageNamespace();
}
-// 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() {
- // 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());
- }
- data_dir_ = webkit_support::GetAbsoluteWebStringFromUTF8Path(
- indexed_db_dir_.path().AsUTF8Unsafe());
-
- // Lazily construct factory_ so that it gets allocated on the thread where
- // it will be used. TestWebIDBFactory gets allocated on the main thread.
- }
-
- virtual void getDatabaseNames(WebKit::WebIDBCallbacks* callbacks,
- const WebKit::WebSecurityOrigin& origin,
- WebKit::WebFrame* frame,
- const WebString& dataDir) {
- EnsureFactory();
- factory_->getDatabaseNames(callbacks, origin, frame,
- dataDir.isEmpty() ? data_dir_ : dataDir);
- }
-
- virtual void open(const WebString& name,
- long long version,
- long long transaction_id,
- WebKit::WebIDBCallbacks* callbacks,
- WebKit::WebIDBDatabaseCallbacks* databaseCallbacks,
- const WebKit::WebSecurityOrigin& origin,
- WebKit::WebFrame* frame,
- const WebString& dataDir) {
- EnsureFactory();
- factory_->open(name, version, transaction_id, callbacks,
- databaseCallbacks, origin, frame,
- dataDir.isEmpty() ? data_dir_ : dataDir);
- }
-
- virtual void deleteDatabase(const WebString& name,
- WebKit::WebIDBCallbacks* callbacks,
- const WebKit::WebSecurityOrigin& origin,
- WebKit::WebFrame* frame,
- const WebString& dataDir) {
- EnsureFactory();
- factory_->deleteDatabase(name, callbacks, origin, frame,
- dataDir.isEmpty() ? data_dir_ : dataDir);
- }
- private:
- void EnsureFactory() {
- if (!factory_)
- factory_.reset(WebKit::WebIDBFactory::create());
- }
-
- scoped_ptr<WebIDBFactory> factory_;
- base::ScopedTempDir indexed_db_dir_;
- WebString data_dir_;
-};
-
-WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() {
- return new TestWebIDBFactory();
-}
-
#if defined(OS_WIN) || defined(OS_MACOSX)
void TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) {
active_theme_engine_ = engine ?
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698