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

Unified Diff: chrome/browser/in_process_webkit/browser_webkitclient_impl.cc

Issue 4678002: IndexedDB: Keep the utility process open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
diff --git a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
index 365c91c2ff83d9cabe35f97452bb4a9da015281a..df541e8289e73b1164b9919ed423906f112c06ae 100644
--- a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
+++ b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
@@ -20,6 +20,9 @@ BrowserWebKitClientImpl::BrowserWebKitClientImpl() {
file_utilities_.set_sandbox_enabled(false);
}
+BrowserWebKitClientImpl::~BrowserWebKitClientImpl() {
+}
+
WebKit::WebClipboard* BrowserWebKitClientImpl::clipboard() {
NOTREACHED();
return NULL;
@@ -144,15 +147,19 @@ int BrowserWebKitClientImpl::databaseDeleteFile(
return file_util::Delete(path, false) ? 0 : 1;
}
+void BrowserWebKitClientImpl::idbShutdown() {
+ if (indexed_db_key_utility_client_.get())
+ indexed_db_key_utility_client_->EndUtilityProcess();
+}
+
void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath(
const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values,
const WebKit::WebString& keyPath,
WebKit::WebVector<WebKit::WebIDBKey>& keys) {
- // TODO(bulach): we need to figure out a way to keep the utility process
- // running for longer, and shut it down when no longer used.
- scoped_refptr<IndexedDBKeyUtilityClient> indexed_db_key_utility_client(
- new IndexedDBKeyUtilityClient());
- indexed_db_key_utility_client->StartUtilityProcess();
+ if (!indexed_db_key_utility_client_.get()) {
+ indexed_db_key_utility_client_ = new IndexedDBKeyUtilityClient();
+ indexed_db_key_utility_client_->StartUtilityProcess();
+ }
std::vector<SerializedScriptValue> std_values;
size_t size = values.size();
@@ -161,10 +168,8 @@ void BrowserWebKitClientImpl::createIDBKeysFromSerializedValuesAndKeyPath(
std_values.push_back(SerializedScriptValue(values[i]));
std::vector<IndexedDBKey> std_keys;
- indexed_db_key_utility_client->CreateIDBKeysFromSerializedValuesAndKeyPath(
+ indexed_db_key_utility_client_->CreateIDBKeysFromSerializedValuesAndKeyPath(
std_values, keyPath, &std_keys);
- indexed_db_key_utility_client->EndUtilityProcess();
-
keys = std_keys;
}

Powered by Google App Engine
This is Rietveld 408576698