summaryrefslogtreecommitdiffstats
path: root/chrome/utility
diff options
context:
space:
mode:
authorhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-17 12:56:09 +0000
committerhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-17 12:56:09 +0000
commitd20e0b986707dd49ae7a2cad347f4e50140ec86e (patch)
treeb0cef7b8dcf072f4640ec9d24b9e546c501df52a /chrome/utility
parent7e58a5a1b1a11dd3571127dc952e32fc841a50ad (diff)
downloadchromium_src-d20e0b986707dd49ae7a2cad347f4e50140ec86e.zip
chromium_src-d20e0b986707dd49ae7a2cad347f4e50140ec86e.tar.gz
chromium_src-d20e0b986707dd49ae7a2cad347f4e50140ec86e.tar.bz2
IndexedDB: Allow injection of keys into values via key path.
BUG=70118 TEST=browser_tests Review URL: http://codereview.chromium.org/6529021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/utility')
-rw-r--r--chrome/utility/utility_thread.cc12
-rw-r--r--chrome/utility/utility_thread.h6
2 files changed, 17 insertions, 1 deletions
diff --git a/chrome/utility/utility_thread.cc b/chrome/utility/utility_thread.cc
index fb5f0ac..6d078e3 100644
--- a/chrome/utility/utility_thread.cc
+++ b/chrome/utility/utility_thread.cc
@@ -63,6 +63,8 @@ bool UtilityThread::OnControlMessageReceived(const IPC::Message& msg) {
OnRenderPDFPagesToMetafile)
IPC_MESSAGE_HANDLER(UtilityMsg_IDBKeysFromValuesAndKeyPath,
OnIDBKeysFromValuesAndKeyPath)
+ IPC_MESSAGE_HANDLER(UtilityMsg_InjectIDBKey,
+ OnInjectIDBKey)
IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Started, OnBatchModeStarted)
IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Finished, OnBatchModeFinished)
IPC_MESSAGE_HANDLER(UtilityMsg_GetPrinterCapsAndDefaults,
@@ -304,6 +306,15 @@ void UtilityThread::OnIDBKeysFromValuesAndKeyPath(
ReleaseProcessIfNeeded();
}
+void UtilityThread::OnInjectIDBKey(const IndexedDBKey& key,
+ const SerializedScriptValue& value,
+ const string16& key_path) {
+ SerializedScriptValue new_value(webkit_glue::InjectIDBKey(key, value,
+ key_path));
+ Send(new UtilityHostMsg_InjectIDBKey_Finished(new_value));
+ ReleaseProcessIfNeeded();
+}
+
void UtilityThread::OnBatchModeStarted() {
batch_mode_ = true;
}
@@ -330,4 +341,3 @@ void UtilityThread::ReleaseProcessIfNeeded() {
if (!batch_mode_)
ChildProcess::current()->ReleaseProcess();
}
-
diff --git a/chrome/utility/utility_thread.h b/chrome/utility/utility_thread.h
index ce4cc25..348cc90 100644
--- a/chrome/utility/utility_thread.h
+++ b/chrome/utility/utility_thread.h
@@ -14,6 +14,7 @@
#include "printing/native_metafile.h"
class GURL;
+class IndexedDBKey;
class SerializedScriptValue;
class SkBitmap;
@@ -77,6 +78,11 @@ class UtilityThread : public ChildThread {
const std::vector<SerializedScriptValue>& serialized_script_values,
const string16& idb_key_path);
+ // IPC for injecting an IndexedDB key into a SerializedScriptValue.
+ void OnInjectIDBKey(const IndexedDBKey& key,
+ const SerializedScriptValue& value,
+ const string16& key_path);
+
// IPC to notify we'll be running in batch mode instead of quitting after
// any of the IPCs above, we'll only quit during OnBatchModeFinished().
void OnBatchModeStarted();