summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorricow@chromium.org <ricow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 10:47:07 +0000
committerricow@chromium.org <ricow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 10:47:07 +0000
commitf6c57d4e7314812cd196e221462e15f57532f72f (patch)
tree45d015cf7844964169cde0f94da6fab04ed2eb12 /webkit
parentf9f83d3834d8d8e2a5f965469ee7b947a966993b (diff)
downloadchromium_src-f6c57d4e7314812cd196e221462e15f57532f72f.zip
chromium_src-f6c57d4e7314812cd196e221462e15f57532f72f.tar.gz
chromium_src-f6c57d4e7314812cd196e221462e15f57532f72f.tar.bz2
Revert 152873 - Remove all the indexeddb-related utility process code
BUG=129471 Review URL: https://chromiumcodereview.appspot.com/10834350 This seems to be causing test failure on Linux Tests (dbg)(1), first hit here: http://build.chromium.org/p/chromium/builders/Linux%20Tests%20%28dbg%29%281%29/builds/20655/steps/browser_tests/logs/stdio TBR=alecflett@chromium.org Review URL: https://chromiumcodereview.appspot.com/10873028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/idb_bindings.cc42
-rw-r--r--webkit/glue/idb_bindings.h31
-rw-r--r--webkit/glue/webkit_glue.gypi2
-rw-r--r--webkit/support/test_webkit_platform_support.cc24
-rw-r--r--webkit/support/test_webkit_platform_support.h8
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.cc20
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h14
7 files changed, 141 insertions, 0 deletions
diff --git a/webkit/glue/idb_bindings.cc b/webkit/glue/idb_bindings.cc
new file mode 100644
index 0000000..57b8eb4
--- /dev/null
+++ b/webkit/glue/idb_bindings.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 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/glue/idb_bindings.h"
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerializedScriptValue.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
+
+namespace webkit_glue {
+
+using WebKit::WebIDBKey;
+using WebKit::WebIDBKeyPath;
+using WebKit::WebSerializedScriptValue;
+using WebKit::WebString;
+
+void IDBKeysFromValuesAndKeyPath(
+ const std::vector<WebSerializedScriptValue>& serialized_script_values,
+ const WebIDBKeyPath& idb_key_path,
+ std::vector<WebIDBKey>* values) {
+ for (std::vector<WebSerializedScriptValue>::const_iterator i =
+ serialized_script_values.begin();
+ i != serialized_script_values.end(); ++i) {
+ values->push_back(
+ WebIDBKey::createFromValueAndKeyPath(*i, idb_key_path));
+ }
+}
+
+WebSerializedScriptValue InjectIDBKey(
+ const WebIDBKey& key,
+ const WebSerializedScriptValue& value,
+ const WebIDBKeyPath& idb_key_path) {
+ return WebIDBKey::injectIDBKeyIntoSerializedValue(
+ key, value, idb_key_path);
+}
+
+} // namespace webkit_glue
diff --git a/webkit/glue/idb_bindings.h b/webkit/glue/idb_bindings.h
new file mode 100644
index 0000000..5b98757
--- /dev/null
+++ b/webkit/glue/idb_bindings.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 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 <vector>
+
+#include "base/basictypes.h"
+#include "webkit/glue/webkit_glue_export.h"
+
+namespace WebKit {
+class WebIDBKey;
+class WebIDBKeyPath;
+class WebSerializedScriptValue;
+}
+
+namespace webkit_glue {
+
+// Warning: this method holds a V8 lock, it should only be called within a
+// sandbox.
+WEBKIT_GLUE_EXPORT void IDBKeysFromValuesAndKeyPath(
+ const std::vector<WebKit::WebSerializedScriptValue>&
+ serialized_script_values,
+ const WebKit::WebIDBKeyPath& idb_key_path,
+ std::vector<WebKit::WebIDBKey>* values);
+
+WEBKIT_GLUE_EXPORT WebKit::WebSerializedScriptValue InjectIDBKey(
+ const WebKit::WebIDBKey& key,
+ const WebKit::WebSerializedScriptValue& value,
+ const WebKit::WebIDBKeyPath& idb_key_path);
+
+} // namespace webkit_glue
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi
index 94a791a..f7b6bed 100644
--- a/webkit/glue/webkit_glue.gypi
+++ b/webkit/glue/webkit_glue.gypi
@@ -362,6 +362,8 @@
'gl_bindings_skia_cmd_buffer.h',
'glue_serialize.cc',
'glue_serialize.h',
+ 'idb_bindings.cc',
+ 'idb_bindings.h',
'image_decoder.cc',
'image_decoder.h',
'image_resource_fetcher.cc',
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index 1d0ea22..1a98ab2 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -20,10 +20,13 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerializedScriptValue.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispatcher.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h"
@@ -377,6 +380,27 @@ WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() {
return new TestWebIDBFactory();
}
+void TestWebKitPlatformSupport::createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
+ const WebKit::WebIDBKeyPath& keyPath,
+ WebKit::WebVector<WebKit::WebIDBKey>& keys_out) {
+ WebKit::WebVector<WebKit::WebIDBKey> keys(values.size());
+ for (size_t i = 0; i < values.size(); ++i) {
+ keys[i] = WebKit::WebIDBKey::createFromValueAndKeyPath(
+ values[i], keyPath);
+ }
+ keys_out.swap(keys);
+}
+
+WebKit::WebSerializedScriptValue
+TestWebKitPlatformSupport::injectIDBKeyIntoSerializedValue(
+ const WebKit::WebIDBKey& key,
+ const WebKit::WebSerializedScriptValue& value,
+ const WebKit::WebIDBKeyPath& keyPath) {
+ return WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue(
+ key, value, keyPath);
+}
+
#if defined(OS_WIN) || defined(OS_MACOSX)
void TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) {
active_theme_engine_ = engine ?
diff --git a/webkit/support/test_webkit_platform_support.h b/webkit/support/test_webkit_platform_support.h
index 77c1979..e525f12 100644
--- a/webkit/support/test_webkit_platform_support.h
+++ b/webkit/support/test_webkit_platform_support.h
@@ -73,6 +73,14 @@ class TestWebKitPlatformSupport :
const WebKit::WebString& path, unsigned quota) OVERRIDE;
virtual WebKit::WebIDBFactory* idbFactory() OVERRIDE;
+ virtual void createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
+ const WebKit::WebIDBKeyPath& keyPath,
+ WebKit::WebVector<WebKit::WebIDBKey>& keys_out) OVERRIDE;
+ virtual WebKit::WebSerializedScriptValue injectIDBKeyIntoSerializedValue(
+ const WebKit::WebIDBKey& key,
+ const WebKit::WebSerializedScriptValue& value,
+ const WebKit::WebIDBKeyPath& keyPath) OVERRIDE;
#if defined(OS_WIN) || defined(OS_MACOSX)
void SetThemeEngine(WebKit::WebThemeEngine* engine);
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.cc b/webkit/tools/test_shell/test_shell_webkit_init.cc
index 91e1736..0d69802 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.cc
+++ b/webkit/tools/test_shell/test_shell_webkit_init.cc
@@ -264,6 +264,26 @@ WebKit::WebIDBFactory* TestShellWebKitInit::idbFactory() {
return WebKit::WebIDBFactory::create();
}
+void TestShellWebKitInit::createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
+ const WebKit::WebIDBKeyPath& keyPath,
+ WebKit::WebVector<WebKit::WebIDBKey>& keys_out) {
+ WebKit::WebVector<WebKit::WebIDBKey> keys(values.size());
+ for (size_t i = 0; i < values.size(); ++i) {
+ keys[i] = WebKit::WebIDBKey::createFromValueAndKeyPath(
+ values[i], keyPath);
+ }
+ keys_out.swap(keys);
+}
+
+WebKit::WebSerializedScriptValue
+TestShellWebKitInit::injectIDBKeyIntoSerializedValue(
+ const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value,
+ const WebKit::WebIDBKeyPath& keyPath) {
+ return WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue(
+ key, value, keyPath);
+}
+
WebKit::WebSharedWorkerRepository*
TestShellWebKitInit::sharedWorkerRepository() {
return NULL;
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index 951fc74..7f0eb93 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -8,7 +8,10 @@
#include "base/compiler_specific.h"
#include "base/utf_string_conversions.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerializedScriptValue.h"
#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webfileutilities_impl.h"
#include "webkit/glue/webkit_glue.h"
@@ -75,6 +78,17 @@ class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl {
virtual WebKit::WebIDBFactory* idbFactory() OVERRIDE;
+ virtual void createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
+ const WebKit::WebIDBKeyPath& keyPath,
+ WebKit::WebVector<WebKit::WebIDBKey>& keys_out) OVERRIDE;
+
+ virtual WebKit::WebSerializedScriptValue injectIDBKeyIntoSerializedValue(
+ const WebKit::WebIDBKey& key,
+ const WebKit::WebSerializedScriptValue& value,
+ const WebKit::WebIDBKeyPath& keyPath) OVERRIDE;
+
+
#if defined(OS_WIN)
void SetThemeEngine(WebKit::WebThemeEngine* engine) {
active_theme_engine_ = engine ?