| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/in_process_webkit/browser_webkitclient_impl.h" | 5 #include "chrome/browser/in_process_webkit/browser_webkitclient_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 "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" | 9 #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" |
| 10 #include "chrome/browser/in_process_webkit/indexed_db_key_utility_client.h" | 10 #include "chrome/browser/in_process_webkit/indexed_db_key_utility_client.h" |
| 11 #include "chrome/common/indexed_db_key.h" | 11 #include "chrome/common/indexed_db_key.h" |
| 12 #include "chrome/common/serialized_script_value.h" | 12 #include "chrome/common/serialized_script_value.h" |
| 13 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); | 143 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); |
| 144 return file_util::Delete(path, false) ? 0 : 1; | 144 return file_util::Delete(path, false) ? 0 : 1; |
| 145 } | 145 } |
| 146 | 146 |
| 147 void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( | 147 void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( |
| 148 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, | 148 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, |
| 149 const WebKit::WebString& keyPath, | 149 const WebKit::WebString& keyPath, |
| 150 WebKit::WebVector<WebKit::WebIDBKey>& keys) { | 150 WebKit::WebVector<WebKit::WebIDBKey>& keys) { |
| 151 // TODO(bulach): we need to figure out a way to keep the utility process | 151 // TODO(bulach): we need to figure out a way to keep the utility process |
| 152 // running for longer, and shut it down when no longer used. | 152 // running for longer, and shut it down when no longer used. |
| 153 scoped_refptr<IndexedDBKeyUtilityClient> indexed_db_key_utility_client = | 153 scoped_refptr<IndexedDBKeyUtilityClient> indexed_db_key_utility_client( |
| 154 new IndexedDBKeyUtilityClient(); | 154 new IndexedDBKeyUtilityClient()); |
| 155 indexed_db_key_utility_client->StartUtilityProcess(); | 155 indexed_db_key_utility_client->StartUtilityProcess(); |
| 156 | 156 |
| 157 std::vector<SerializedScriptValue> std_values; | 157 std::vector<SerializedScriptValue> std_values; |
| 158 size_t size = values.size(); | 158 size_t size = values.size(); |
| 159 std_values.reserve(size); | 159 std_values.reserve(size); |
| 160 for (size_t i = 0; i < size; ++i) | 160 for (size_t i = 0; i < size; ++i) |
| 161 std_values.push_back(SerializedScriptValue(values[i])); | 161 std_values.push_back(SerializedScriptValue(values[i])); |
| 162 | 162 |
| 163 std::vector<IndexedDBKey> std_keys; | 163 std::vector<IndexedDBKey> std_keys; |
| 164 indexed_db_key_utility_client->CreateIDBKeysFromSerializedValuesAndKeyPath( | 164 indexed_db_key_utility_client->CreateIDBKeysFromSerializedValuesAndKeyPath( |
| 165 std_values, keyPath, &std_keys); | 165 std_values, keyPath, &std_keys); |
| 166 | 166 |
| 167 indexed_db_key_utility_client->EndUtilityProcess(); | 167 indexed_db_key_utility_client->EndUtilityProcess(); |
| 168 | 168 |
| 169 keys = std_keys; | 169 keys = std_keys; |
| 170 } | 170 } |
| OLD | NEW |