diff options
author | Kristian Monsen <kristianm@google.com> | 2011-06-28 21:49:31 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-07-08 17:55:00 +0100 |
commit | ddb351dbec246cf1fab5ec20d2d5520909041de1 (patch) | |
tree | 158e3fb57bdcac07c7f1e767fde3c70687c9fbb1 /chrome/browser/utility_process_host.cc | |
parent | 6b92e04f5f151c896e3088e86f70db7081009308 (diff) | |
download | external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.zip external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.gz external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.bz2 |
Merge Chromium at r12.0.742.93: Initial merge by git
Change-Id: Ic5ee2fec31358bbee305f7e915442377bfa6cda6
Diffstat (limited to 'chrome/browser/utility_process_host.cc')
-rw-r--r-- | chrome/browser/utility_process_host.cc | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index c715377..a663462 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -1,27 +1,25 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/utility_process_host.h" -#include "app/app_switches.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/message_loop.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/indexed_db_key.h" -#include "chrome/common/serialized_script_value.h" #include "chrome/common/utility_messages.h" +#include "content/common/indexed_db_key.h" +#include "content/common/serialized_script_value.h" #include "ipc/ipc_switches.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/ui_base_switches.h" -UtilityProcessHost::UtilityProcessHost(ResourceDispatcherHost* rdh, - Client* client, +UtilityProcessHost::UtilityProcessHost(Client* client, BrowserThread::ID client_thread_id) - : BrowserChildProcessHost(UTILITY_PROCESS, rdh), + : BrowserChildProcessHost(UTILITY_PROCESS), client_(client), client_thread_id_(client_thread_id), is_batch_mode_(false) { @@ -66,6 +64,15 @@ bool UtilityProcessHost::StartImageDecoding( return true; } +bool UtilityProcessHost::StartImageDecodingBase64( + const std::string& base64_encoded_data) { + if (!StartProcess(FilePath())) + return false; + + Send(new UtilityMsg_DecodeImageBase64(base64_encoded_data)); + return true; +} + bool UtilityProcessHost::StartIDBKeysFromValuesAndKeyPath( int id, const std::vector<SerializedScriptValue>& serialized_values, const string16& key_path) { @@ -87,6 +94,13 @@ bool UtilityProcessHost::StartInjectIDBKey( return true; } +bool UtilityProcessHost::StartJSONParsing(const std::string& json) { + if (!StartProcess(FilePath())) + return false; + Send(new UtilityMsg_ParseJSON(json)); + return true; +} + bool UtilityProcessHost::StartBatchMode() { CHECK(!is_batch_mode_); is_batch_mode_ = StartProcess(FilePath()); @@ -210,6 +224,10 @@ bool UtilityProcessHost::Client::OnMessageReceived( Client::OnIDBKeysFromValuesAndKeyPathFailed) IPC_MESSAGE_HANDLER(UtilityHostMsg_InjectIDBKey_Finished, Client::OnInjectIDBKeyFinished) + IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Succeeded, + Client::OnJSONParseSucceeded) + IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Failed, + Client::OnJSONParseFailed) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP_EX() return handled; |