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

Unified Diff: chrome/browser/chromeos/login/image_decoder.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/chromeos/login/image_decoder.cc
===================================================================
--- chrome/browser/chromeos/login/image_decoder.cc (revision 88480)
+++ chrome/browser/chromeos/login/image_decoder.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/login/image_decoder.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/common/chrome_utility_messages.h"
#include "content/browser/browser_thread.h"
namespace chromeos {
@@ -30,6 +31,17 @@
image_data_));
}
+bool ImageDecoder::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(ImageDecoder, message)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Succeeded,
+ OnDecodeImageSucceeded)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Failed, OnDecodeImageFailed)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP_EX()
+ return handled;
+}
+
void ImageDecoder::OnDecodeImageSucceeded(const SkBitmap& decoded_image) {
DCHECK(BrowserThread::CurrentlyOn(target_thread_id_));
if (delegate_)
@@ -48,7 +60,7 @@
UtilityProcessHost* utility_process_host =
new UtilityProcessHost(this,
target_thread_id_);
- utility_process_host->StartImageDecoding(image_data);
+ utility_process_host->Send(new UtilityMsg_DecodeImage(image_data));
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698