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 } | |
| 154 | |
| 155 void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( | 150 void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath( |
| 156 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, | 151 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, |
| 157 const WebKit::WebString& keyPath, | 152 const WebKit::WebString& keyPath, |
| 158 WebKit::WebVector<WebKit::WebIDBKey>& keys) { | 153 WebKit::WebVector<WebKit::WebIDBKey>& keys) { |
| 159 if (!indexed_db_key_utility_client_.get()) { | 154 if (!indexed_db_key_utility_client_.get()) |
|
bulach
2011/01/14 17:55:08
I think it no longer needs to be a member, right?
| |
| 160 indexed_db_key_utility_client_ = new IndexedDBKeyUtilityClient(); | 155 indexed_db_key_utility_client_ = IndexedDBKeyUtilityClient::Get(); |
| 161 indexed_db_key_utility_client_->StartUtilityProcess(); | |
| 162 } | |
| 163 | 156 |
| 164 std::vector<SerializedScriptValue> std_values; | 157 std::vector<SerializedScriptValue> std_values; |
| 165 size_t size = values.size(); | 158 size_t size = values.size(); |
| 166 std_values.reserve(size); | 159 std_values.reserve(size); |
| 167 for (size_t i = 0; i < size; ++i) | 160 for (size_t i = 0; i < size; ++i) |
| 168 std_values.push_back(SerializedScriptValue(values[i])); | 161 std_values.push_back(SerializedScriptValue(values[i])); |
| 169 | 162 |
| 170 std::vector<IndexedDBKey> std_keys; | 163 std::vector<IndexedDBKey> std_keys; |
| 171 indexed_db_key_utility_client_->CreateIDBKeysFromSerializedValuesAndKeyPath( | 164 indexed_db_key_utility_client_->CreateIDBKeysFromSerializedValuesAndKeyPath( |
| 172 std_values, keyPath, &std_keys); | 165 std_values, keyPath, &std_keys); |
| 173 | 166 |
| 174 keys = std_keys; | 167 keys = std_keys; |
| 175 } | 168 } |
| OLD | NEW |