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

Side by Side Diff: content/browser/in_process_webkit/browser_webkitplatformsupport_impl.cc

Issue 10204003: Use WebIDBKeyPath type in WebKit API, implement IndexedDBKeyPath type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move IndexedDBKeyPath to content namespace, formatting nits. Created 8 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h " 5 #include "content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h "
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
10 #include "content/browser/in_process_webkit/indexed_db_key_utility_client.h" 10 #include "content/browser/in_process_webkit/indexed_db_key_utility_client.h"
11 #include "content/common/indexed_db/indexed_db_key.h" 11 #include "content/common/indexed_db/indexed_db_key.h"
12 #include "content/common/indexed_db/indexed_db_key_path.h"
12 #include "content/public/common/serialized_script_value.h" 13 #include "content/public/common/serialized_script_value.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize dScriptValue.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize dScriptValue.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
17 #include "webkit/glue/webkit_glue.h" 18 #include "webkit/glue/webkit_glue.h"
18 19
19 BrowserWebKitPlatformSupportImpl::BrowserWebKitPlatformSupportImpl() { 20 BrowserWebKitPlatformSupportImpl::BrowserWebKitPlatformSupportImpl() {
20 file_utilities_.set_sandbox_enabled(false); 21 file_utilities_.set_sandbox_enabled(false);
21 } 22 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 124
124 int BrowserWebKitPlatformSupportImpl::databaseDeleteFile( 125 int BrowserWebKitPlatformSupportImpl::databaseDeleteFile(
125 const WebKit::WebString& vfs_file_name, bool sync_dir) { 126 const WebKit::WebString& vfs_file_name, bool sync_dir) {
126 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); 127 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name);
127 return file_util::Delete(path, false) ? 0 : 1; 128 return file_util::Delete(path, false) ? 0 : 1;
128 } 129 }
129 130
130 void 131 void
131 BrowserWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath( 132 BrowserWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath(
132 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, 133 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
133 const WebKit::WebString& keyPath, 134 const WebKit::WebIDBKeyPath& keyPath,
134 WebKit::WebVector<WebKit::WebIDBKey>& keys) { 135 WebKit::WebVector<WebKit::WebIDBKey>& keys) {
135 136
136 std::vector<content::SerializedScriptValue> std_values; 137 std::vector<content::SerializedScriptValue> std_values;
137 size_t size = values.size(); 138 size_t size = values.size();
138 std_values.reserve(size); 139 std_values.reserve(size);
139 for (size_t i = 0; i < size; ++i) 140 for (size_t i = 0; i < size; ++i)
140 std_values.push_back(content::SerializedScriptValue(values[i])); 141 std_values.push_back(content::SerializedScriptValue(values[i]));
141 142
142 std::vector<IndexedDBKey> std_keys; 143 std::vector<IndexedDBKey> std_keys;
143 IndexedDBKeyUtilityClient:: 144 IndexedDBKeyUtilityClient::
144 CreateIDBKeysFromSerializedValuesAndKeyPath(std_values, keyPath, 145 CreateIDBKeysFromSerializedValuesAndKeyPath(
145 &std_keys); 146 std_values, content::IndexedDBKeyPath(keyPath), &std_keys);
146 147
147 keys = std_keys; 148 keys = std_keys;
148 } 149 }
149 150
150 WebKit::WebSerializedScriptValue 151 WebKit::WebSerializedScriptValue
151 BrowserWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( 152 BrowserWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue(
152 const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value, 153 const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value,
153 const WebKit::WebString& keyPath) { 154 const WebKit::WebIDBKeyPath& keyPath) {
154 return IndexedDBKeyUtilityClient::InjectIDBKeyIntoSerializedValue( 155 return IndexedDBKeyUtilityClient::InjectIDBKeyIntoSerializedValue(
155 IndexedDBKey(key), content::SerializedScriptValue(value), keyPath); 156 IndexedDBKey(key), content::SerializedScriptValue(value),
157 content::IndexedDBKeyPath(keyPath));
156 } 158 }
157 159
158 GpuChannelHostFactory* 160 GpuChannelHostFactory*
159 BrowserWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { 161 BrowserWebKitPlatformSupportImpl::GetGpuChannelHostFactory() {
160 return content::BrowserGpuChannelHostFactory::instance(); 162 return content::BrowserGpuChannelHostFactory::instance();
161 } 163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698