Index: chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc |
diff --git a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc |
index 846731690321a8045cd29eefb0cf06cc30338e80..314ee64e0b80a1d281a324c0dee0e18abfa92e00 100644 |
--- a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc |
+++ b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc |
@@ -25,6 +25,7 @@ |
#include "chrome/common/chrome_paths.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/url_constants.h" |
+#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/web_ui.h" |
#include "content/public/common/url_constants.h" |
@@ -36,6 +37,8 @@ |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/views/widget/widget.h" |
+using content::BrowserThread; |
+ |
namespace chromeos { |
namespace options { |
@@ -178,6 +181,7 @@ void ChangePictureOptionsHandler::HandleChooseFile(const ListValue* args) { |
void ChangePictureOptionsHandler::HandlePhotoTaken( |
const base::ListValue* args) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
std::string image_url; |
if (!args || args->GetSize() != 1 || !args->GetString(0, &image_url)) |
NOTREACHED(); |
@@ -195,7 +199,9 @@ void ChangePictureOptionsHandler::HandlePhotoTaken( |
image_decoder_->set_delegate(NULL); |
image_decoder_ = new ImageDecoder(this, raw_data, |
ImageDecoder::DEFAULT_CODEC); |
- image_decoder_->Start(); |
+ scoped_refptr<base::MessageLoopProxy> task_runner = |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); |
+ image_decoder_->Start(task_runner); |
} |
void ChangePictureOptionsHandler::HandleCheckCameraPresence( |