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

Unified Diff: chrome/browser/utility_process_host.cc

Issue 3043037: Adds IDBKeyPath parser / extractor, and provides a mechanism to call it sandboxed. (Closed)
Patch Set: Makes MSVC happy. Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/utility_process_host.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/utility_process_host.cc
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc
index e49df713122e5ce88de67b251888e470a0d6d799..6014f22e305c109fc32d85a522c9b4bf47102b69 100644
--- a/chrome/browser/utility_process_host.cc
+++ b/chrome/browser/utility_process_host.cc
@@ -18,10 +18,12 @@ UtilityProcessHost::UtilityProcessHost(ResourceDispatcherHost* rdh,
ChromeThread::ID client_thread_id)
: BrowserChildProcessHost(UTILITY_PROCESS, rdh),
client_(client),
- client_thread_id_(client_thread_id) {
+ client_thread_id_(client_thread_id),
+ is_batch_mode_(false) {
}
UtilityProcessHost::~UtilityProcessHost() {
+ DCHECK(!is_batch_mode_);
}
bool UtilityProcessHost::StartExtensionUnpacker(const FilePath& extension) {
@@ -59,11 +61,37 @@ bool UtilityProcessHost::StartImageDecoding(
return true;
}
+bool UtilityProcessHost::StartIDBKeysFromValuesAndKeyPath(
+ int id, const std::vector<SerializedScriptValue>& serialized_values,
+ const string16& key_path) {
+ if (!StartProcess(FilePath()))
+ return false;
+
+ Send(new UtilityMsg_IDBKeysFromValuesAndKeyPath(
+ id, serialized_values, key_path));
+ return true;
+}
+
+bool UtilityProcessHost::StartBatchMode() {
+ CHECK(!is_batch_mode_);
+ is_batch_mode_ = StartProcess(FilePath());
+ Send(new UtilityMsg_BatchMode_Started());
+ return is_batch_mode_;
+}
+
+void UtilityProcessHost::EndBatchMode() {
+ CHECK(is_batch_mode_);
+ is_batch_mode_ = false;
+ Send(new UtilityMsg_BatchMode_Finished());
+}
+
FilePath UtilityProcessHost::GetUtilityProcessCmd() {
return GetChildPath(true);
}
bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) {
+ if (is_batch_mode_)
+ return true;
// Name must be set or metrics_service will crash in any test which
// launches a UtilityProcessHost.
set_name(L"utility process");
@@ -159,5 +187,9 @@ void UtilityProcessHost::Client::OnMessageReceived(
Client::OnDecodeImageSucceeded)
IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Failed,
Client::OnDecodeImageFailed)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded,
+ Client::OnIDBKeysFromValuesAndKeyPathSucceeded)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed,
+ Client::OnIDBKeysFromValuesAndKeyPathFailed)
IPC_END_MESSAGE_MAP_EX()
}
« no previous file with comments | « chrome/browser/utility_process_host.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698