summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-05 14:58:18 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-05 14:58:18 +0000
commitf1b873f51bda1b262f00bc0fc98814c28cb2250c (patch)
treec8762defdcf3f4d162274628a10858a5d22caef1
parent2764785da139b0ac8a100da105c281b55489b3ae (diff)
downloadchromium_src-f1b873f51bda1b262f00bc0fc98814c28cb2250c.zip
chromium_src-f1b873f51bda1b262f00bc0fc98814c28cb2250c.tar.gz
chromium_src-f1b873f51bda1b262f00bc0fc98814c28cb2250c.tar.bz2
Land http://codereview.chromium.org/3167045/show
Make Marcus's KeyPath code work with single process mode for IndexedDB. TEST=none BUG=none Review URL: http://codereview.chromium.org/3296008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58607 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/in_process_webkit/browser_webkitclient_impl.cc13
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc19
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.h4
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h15
4 files changed, 44 insertions, 7 deletions
diff --git a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
index 6c190ea..eb696ac4 100644
--- a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
+++ b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
@@ -94,7 +94,8 @@ WebKit::WebURLLoader* BrowserWebKitClientImpl::createURLLoader() {
return NULL;
}
-WebKit::WebSocketStreamHandle* BrowserWebKitClientImpl::createSocketStreamHandle() {
+WebKit::WebSocketStreamHandle*
+ BrowserWebKitClientImpl::createSocketStreamHandle() {
NOTREACHED();
return NULL;
}
@@ -154,12 +155,10 @@ void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath(
indexed_db_key_utility_client->StartUtilityProcess();
std::vector<SerializedScriptValue> std_values;
- size_t size = values.size();
- std_values.reserve(size);
- for (size_t i = 0; i < size; ++i) {
- SerializedScriptValue std_value(values[i]);
- std_values.push_back(std_value);
- }
+ size_t size = values.size();
+ std_values.reserve(size);
+ for (size_t i = 0; i < size; ++i)
+ std_values.push_back(SerializedScriptValue(values[i]));
std::vector<IndexedDBKey> std_keys;
indexed_db_key_utility_client->CreateIDBKeysFromSerializedValuesAndKeyPath(
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index ec5c08c..6830590 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -31,6 +31,9 @@
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/WebKit/chromium/public/WebGraphicsContext3D.h"
#include "third_party/WebKit/WebKit/chromium/public/WebIDBFactory.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebIDBKey.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebIDBKeyPath.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebSerializedScriptValue.h"
#include "third_party/WebKit/WebKit/chromium/public/WebStorageEventDispatcher.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebVector.h"
@@ -66,7 +69,10 @@ using WebKit::WebBlobRegistry;
using WebKit::WebFileSystem;
using WebKit::WebFrame;
using WebKit::WebIDBFactory;
+using WebKit::WebIDBKey;
+using WebKit::WebIDBKeyPath;
using WebKit::WebKitClient;
+using WebKit::WebSerializedScriptValue;
using WebKit::WebStorageArea;
using WebKit::WebStorageEventDispatcher;
using WebKit::WebStorageNamespace;
@@ -285,6 +291,19 @@ WebIDBFactory* RendererWebKitClientImpl::idbFactory() {
return web_idb_factory_.get();
}
+void RendererWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebVector<WebSerializedScriptValue>& values,
+ const WebString& keyPath,
+ WebVector<WebIDBKey>& keys_out) {
+ DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess));
+ WebVector<WebIDBKey> keys(values.size());
+ for (size_t i = 0; i < values.size(); ++i) {
+ keys[i] = WebIDBKey::createFromValueAndKeyPath(
+ values[i], WebIDBKeyPath::create(keyPath));
+ }
+ keys_out.swap(keys);
+}
+
//------------------------------------------------------------------------------
WebFileSystem* RendererWebKitClientImpl::fileSystem() {
diff --git a/chrome/renderer/renderer_webkitclient_impl.h b/chrome/renderer/renderer_webkitclient_impl.h
index d057391..e78ff04 100644
--- a/chrome/renderer/renderer_webkitclient_impl.h
+++ b/chrome/renderer/renderer_webkitclient_impl.h
@@ -62,6 +62,10 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl {
const WebKit::WebString& challenge,
const WebKit::WebURL& url);
virtual WebKit::WebIDBFactory* idbFactory();
+ virtual void createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
+ const WebKit::WebString& keyPath,
+ WebKit::WebVector<WebKit::WebIDBKey>& keys);
virtual WebKit::WebFileSystem* fileSystem();
virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository();
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index f53db8c..459c253 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -8,6 +8,9 @@
#include "base/utf_string_conversions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebGraphicsContext3D.h"
#include "third_party/WebKit/WebKit/chromium/public/WebIDBFactory.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebIDBKey.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebIDBKeyPath.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebSerializedScriptValue.h"
#include "third_party/WebKit/WebKit/chromium/public/WebStorageNamespace.h"
#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webfileutilities_impl.h"
@@ -119,6 +122,18 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
return WebKit::WebIDBFactory::create();
}
+ virtual void createIDBKeysFromSerializedValuesAndKeyPath(
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
+ const WebKit::WebString& 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], WebKit::WebIDBKeyPath::create(keyPath));
+ }
+ keys_out.swap(keys);
+ }
+
#if defined(OS_WIN)
void SetThemeEngine(WebKit::WebThemeEngine* engine) {
active_theme_engine_ = engine ? engine : WebKitClientImpl::themeEngine();