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

Unified Diff: chrome/browser/extensions/extension_webstore_private_api.cc

Issue 6995095: Move UtilityProcessHost to content and move the message sending/dispatching to the clients. This... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
Index: chrome/browser/extensions/extension_webstore_private_api.cc
===================================================================
--- chrome/browser/extensions/extension_webstore_private_api.cc (revision 88480)
+++ chrome/browser/extensions/extension_webstore_private_api.cc (working copy)
@@ -20,6 +20,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/chrome_utility_messages.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/extensions/extension_l10n_util.h"
@@ -181,25 +182,42 @@
if (icon_data_.empty())
icon_decode_complete_ = true;
else
- utility_host_->StartImageDecodingBase64(icon_data_);
- utility_host_->StartJSONParsing(manifest_);
+ utility_host_->Send(new UtilityMsg_DecodeImageBase64(icon_data_));
+ utility_host_->Send(new UtilityMsg_ParseJSON(manifest_));
}
// Implementing pieces of the UtilityProcessHost::Client interface.
- virtual void OnDecodeImageSucceeded(const SkBitmap& decoded_image) {
+ virtual bool OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(SafeBeginInstallHelper, message)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Succeeded,
+ OnDecodeImageSucceeded)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Failed,
+ OnDecodeImageFailed)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Succeeded,
+ OnJSONParseSucceeded)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Failed, OnJSONParseFailed)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP_EX()
+ return handled;
+ }
+
+ void OnDecodeImageSucceeded(const SkBitmap& decoded_image) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
icon_ = decoded_image;
icon_decode_complete_ = true;
ReportResultsIfComplete();
}
- virtual void OnDecodeImageFailed() {
+
+ void OnDecodeImageFailed() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
icon_decode_complete_ = true;
error_ = std::string(kImageDecodeError);
parse_error_ = BeginInstallWithManifestFunction::ICON_ERROR;
ReportResultsIfComplete();
}
- virtual void OnJSONParseSucceeded(const ListValue& wrapper) {
+
+ void OnJSONParseSucceeded(const ListValue& wrapper) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
manifest_parse_complete_ = true;
Value* value = NULL;

Powered by Google App Engine
This is Rietveld 408576698