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

Side by Side Diff: webkit/support/test_webidbfactory.cc

Issue 12181010: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/support/test_webidbfactory.h ('k') | webkit/support/test_webkit_platform_support.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/support/test_webidbfactory.h"
6
7 #include "base/logging.h"
8 #include "webkit/support/webkit_support.h"
9
10 TestWebIDBFactory::TestWebIDBFactory() {
11 // Create a new temp directory for Indexed DB storage, specific to this
12 // factory. If this fails, WebKit uses in-memory storage.
13 if (!indexed_db_dir_.CreateUniqueTempDir()) {
14 LOG(WARNING) << "Failed to create a temp dir for Indexed DB, "
15 "using in-memory storage.";
16 DCHECK(indexed_db_dir_.path().empty());
17 }
18 data_dir_ = webkit_support::GetAbsoluteWebStringFromUTF8Path(
19 indexed_db_dir_.path().AsUTF8Unsafe());
20 }
21
22 TestWebIDBFactory::~TestWebIDBFactory() {
23 }
24
25 void TestWebIDBFactory::getDatabaseNames(
26 WebKit::WebIDBCallbacks* callbacks,
27 const WebKit::WebSecurityOrigin& origin,
28 WebKit::WebFrame* frame,
29 const WebKit::WebString& data_dir) {
30 GetFactory()->getDatabaseNames(callbacks, origin, frame,
31 data_dir.isEmpty() ? data_dir_ : data_dir);
32 }
33
34 void TestWebIDBFactory::open(
35 const WebKit::WebString& name,
36 long long version,
37 long long transaction_id,
38 WebKit::WebIDBCallbacks* callbacks,
39 WebKit::WebIDBDatabaseCallbacks* database_callbacks,
40 const WebKit::WebSecurityOrigin& origin,
41 WebKit::WebFrame* frame,
42 const WebKit::WebString& data_dir) {
43 GetFactory()->open(name, version, transaction_id, callbacks,
44 database_callbacks, origin, frame,
45 data_dir.isEmpty() ? data_dir_ : data_dir);
46 }
47
48 void TestWebIDBFactory::deleteDatabase(const WebKit::WebString& name,
49 WebKit::WebIDBCallbacks* callbacks,
50 const WebKit::WebSecurityOrigin& origin,
51 WebKit::WebFrame* frame,
52 const WebKit::WebString& dataDir) {
53 GetFactory()->deleteDatabase(name, callbacks, origin, frame,
54 dataDir.isEmpty() ? data_dir_ : dataDir);
55 }
56
57 WebKit::WebIDBFactory* TestWebIDBFactory::GetFactory() {
58 WebKit::WebIDBFactory* factory = factories_.Get();
59 if (!factory) {
60 factory = WebKit::WebIDBFactory::create();
61 factories_.Set(factory);
62 }
63 return factory;
64 }
OLDNEW
« no previous file with comments | « webkit/support/test_webidbfactory.h ('k') | webkit/support/test_webkit_platform_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698