Index: content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc |
=================================================================== |
--- content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc (revision 152976) |
+++ content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc (working copy) |
@@ -7,12 +7,20 @@ |
#include "base/file_util.h" |
#include "base/logging.h" |
#include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
+#include "content/browser/in_process_webkit/indexed_db_key_utility_client.h" |
+#include "content/common/indexed_db/indexed_db_key.h" |
+#include "content/common/indexed_db/indexed_db_key_path.h" |
#include "content/public/common/serialized_script_value.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerializedScriptValue.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
#include "webkit/glue/webkit_glue.h" |
+using content::IndexedDBKey; |
+using content::IndexedDBKeyPath; |
+using content::SerializedScriptValue; |
+ |
BrowserWebKitPlatformSupportImpl::BrowserWebKitPlatformSupportImpl() { |
file_utilities_.set_sandbox_enabled(false); |
} |
@@ -124,6 +132,35 @@ |
return file_util::Delete(path, false) ? 0 : 1; |
} |
+void |
+BrowserWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath( |
+ const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, |
+ const WebKit::WebIDBKeyPath& keyPath, |
+ WebKit::WebVector<WebKit::WebIDBKey>& keys) { |
+ |
+ std::vector<SerializedScriptValue> std_values; |
+ 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; |
+ IndexedDBKeyUtilityClient:: |
+ CreateIDBKeysFromSerializedValuesAndKeyPath( |
+ std_values, IndexedDBKeyPath(keyPath), &std_keys); |
+ |
+ keys = std_keys; |
+} |
+ |
+WebKit::WebSerializedScriptValue |
+BrowserWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( |
+ const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value, |
+ const WebKit::WebIDBKeyPath& keyPath) { |
+ return IndexedDBKeyUtilityClient::InjectIDBKeyIntoSerializedValue( |
+ IndexedDBKey(key), SerializedScriptValue(value), |
+ IndexedDBKeyPath(keyPath)); |
+} |
+ |
GpuChannelHostFactory* |
BrowserWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
return content::BrowserGpuChannelHostFactory::instance(); |