summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 21:56:46 +0000
committerjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 21:56:46 +0000
commit7c07c577eaee972b732e835b67e840c486aa20ca (patch)
tree38c7046aec1995de87caa7dcc6e331400e5e9595 /remoting
parentcf8c9218a8dffb970f7dbf837aec85d85a32dffd (diff)
downloadchromium_src-7c07c577eaee972b732e835b67e840c486aa20ca.zip
chromium_src-7c07c577eaee972b732e835b67e840c486aa20ca.tar.gz
chromium_src-7c07c577eaee972b732e835b67e840c486aa20ca.tar.bz2
Fix crash initialising ChromotingHostContext in plugin.
BUG=123940 TEST=Manual Review URL: https://chromiumcodereview.appspot.com/10116039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132877 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/chromoting_host_context.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/remoting/host/chromoting_host_context.cc b/remoting/host/chromoting_host_context.cc
index d693b55..57571a9 100644
--- a/remoting/host/chromoting_host_context.cc
+++ b/remoting/host/chromoting_host_context.cc
@@ -37,8 +37,13 @@ bool ChromotingHostContext::Start() {
if (!started)
return false;
- url_request_context_getter_ = new URLRequestContextGetter(
- io_thread_.message_loop(), file_thread_.message_loop());
+ // net::ProxyService::CreateSystemProxyConfigService requires a UI thread.
+ // TODO(jamiewalch): Clean up this dependency.
+ MessageLoop* loop = MessageLoop::current();
+ if (loop && loop->type() == MessageLoop::TYPE_UI) {
+ url_request_context_getter_ = new URLRequestContextGetter(
+ io_thread_.message_loop(), file_thread_.message_loop());
+ }
return true;
}
@@ -76,6 +81,7 @@ base::MessageLoopProxy* ChromotingHostContext::file_message_loop() {
const scoped_refptr<URLRequestContextGetter>&
ChromotingHostContext::url_request_context_getter() {
+ DCHECK(url_request_context_getter_.get());
return url_request_context_getter_;
}