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

Side by Side Diff: chrome/browser/in_process_webkit/browser_webkitclient_impl.cc

Issue 6209005: Fix IndexedDB race condition during shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing Jeremy's comments Created 9 years, 11 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) 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
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()) {
162 indexed_db_key_utility_client_ = new IndexedDBKeyUtilityClient();
163 indexed_db_key_utility_client_->StartUtilityProcess();
164 }
165 154
166 std::vector<SerializedScriptValue> std_values; 155 std::vector<SerializedScriptValue> std_values;
167 size_t size = values.size(); 156 size_t size = values.size();
168 std_values.reserve(size); 157 std_values.reserve(size);
169 for (size_t i = 0; i < size; ++i) 158 for (size_t i = 0; i < size; ++i)
170 std_values.push_back(SerializedScriptValue(values[i])); 159 std_values.push_back(SerializedScriptValue(values[i]));
171 160
172 std::vector<IndexedDBKey> std_keys; 161 std::vector<IndexedDBKey> std_keys;
173 indexed_db_key_utility_client_->CreateIDBKeysFromSerializedValuesAndKeyPath( 162 IndexedDBKeyUtilityClient::
174 std_values, keyPath, &std_keys); 163 CreateIDBKeysFromSerializedValuesAndKeyPath(std_values, keyPath,
164 &std_keys);
175 165
176 keys = std_keys; 166 keys = std_keys;
177 } 167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698