Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "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_message_filter.h" | 9 #include "chrome/browser/in_process_webkit/dom_storage_message_filter.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" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 NOTREACHED(); | 140 NOTREACHED(); |
| 141 return NULL; | 141 return NULL; |
| 142 } | 142 } |
| 143 | 143 |
| 144 int BrowserWebKitClientImpl::databaseDeleteFile( | 144 int BrowserWebKitClientImpl::databaseDeleteFile( |
| 145 const WebKit::WebString& vfs_file_name, bool sync_dir) { | 145 const WebKit::WebString& vfs_file_name, bool sync_dir) { |
| 146 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); | 146 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); |
| 147 return file_util::Delete(path, false) ? 0 : 1; | 147 return file_util::Delete(path, false) ? 0 : 1; |
| 148 } | 148 } |
| 149 | 149 |
| 150 void BrowserWebKitClientImpl::idbShutdown() { | |
| 151 if (indexed_db_key_utility_client_.get()) { | |
| 152 indexed_db_key_utility_client_->EndUtilityProcess(); | |
| 153 indexed_db_key_utility_client_ = NULL; | |
| 154 } | |
| 155 } | |
| 156 | |
| 157 void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( | 150 void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( |
| 158 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, | 151 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, |
| 159 const WebKit::WebString& keyPath, | 152 const WebKit::WebString& keyPath, |
| 160 WebKit::WebVector<WebKit::WebIDBKey>& keys) { | 153 WebKit::WebVector<WebKit::WebIDBKey>& keys) { |
| 161 if (!indexed_db_key_utility_client_.get()) { | 154 IndexedDBKeyUtilityClient* key_utility_client = |
| 162 indexed_db_key_utility_client_ = new IndexedDBKeyUtilityClient(); | 155 IndexedDBKeyUtilityClient::GetInstance(); |
|
bulach
2011/01/20 16:49:15
no need for this local, just call directly
Indexed
hans
2011/01/20 17:24:59
Done.
| |
| 163 indexed_db_key_utility_client_->StartUtilityProcess(); | |
| 164 } | |
| 165 | 156 |
| 166 std::vector<SerializedScriptValue> std_values; | 157 std::vector<SerializedScriptValue> std_values; |
| 167 size_t size = values.size(); | 158 size_t size = values.size(); |
| 168 std_values.reserve(size); | 159 std_values.reserve(size); |
| 169 for (size_t i = 0; i < size; ++i) | 160 for (size_t i = 0; i < size; ++i) |
| 170 std_values.push_back(SerializedScriptValue(values[i])); | 161 std_values.push_back(SerializedScriptValue(values[i])); |
| 171 | 162 |
| 172 std::vector<IndexedDBKey> std_keys; | 163 std::vector<IndexedDBKey> std_keys; |
| 173 indexed_db_key_utility_client_->CreateIDBKeysFromSerializedValuesAndKeyPath( | 164 key_utility_client->CreateIDBKeysFromSerializedValuesAndKeyPath( |
| 174 std_values, keyPath, &std_keys); | 165 std_values, keyPath, &std_keys); |
| 175 | 166 |
| 176 keys = std_keys; | 167 keys = std_keys; |
| 177 } | 168 } |
| OLD | NEW |