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

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

Issue 8688001: [cros] Make g_browser_process's call on the UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/extension_web_socket_proxy_private_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_web_socket_proxy_private_api.cc
diff --git a/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc b/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc
index b2cb933310eb8958e65432b5548307e193f94e87..ddfe14caba80905d303569edab238801c7713165 100644
--- a/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc
+++ b/chrome/browser/extensions/extension_web_socket_proxy_private_api.cc
@@ -63,28 +63,29 @@ void WebSocketProxyPrivate::Observe(
void WebSocketProxyPrivate::ResolveHost() {
#if defined(OS_CHROMEOS)
- if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::Bind(&WebSocketProxyPrivate::ResolveHost, this));
- return;
- }
+ IOThread* io_thread = g_browser_process->io_thread();
stevenjb 2011/11/28 18:45:39 One reason that g_browser_process->io_thread() is
altimofeev 2011/11/29 12:30:20 Please find my answers inline. On 2011/11/28 18:4
+ content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&WebSocketProxyPrivate::ResolveHostIOPart, this, io_thread));
+#endif
+}
+
+void WebSocketProxyPrivate::ResolveHostIOPart(IOThread* io_thread) {
+#if defined(OS_CHROMEOS)
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
DCHECK(resolver_ == NULL);
- if (g_browser_process) {
- IOThread* io_thread = g_browser_process->io_thread();
- if (io_thread && io_thread->globals()) {
- net::HostResolver* host_resolver =
- io_thread->globals()->host_resolver.get();
- if (host_resolver) {
- resolver_.reset(new net::SingleRequestHostResolver(host_resolver));
- net::HostResolver::RequestInfo info(net::HostPortPair(
- hostname_, port_));
- int result = resolver_->Resolve(info, &addr_,
- base::Bind(&WebSocketProxyPrivate::OnHostResolution, this),
- net::BoundNetLog());
- if (result != net::ERR_IO_PENDING)
- OnHostResolution(result);
- return;
- }
+ if (io_thread && io_thread->globals()) {
+ net::HostResolver* host_resolver =
+ io_thread->globals()->host_resolver.get();
+ if (host_resolver) {
+ resolver_.reset(new net::SingleRequestHostResolver(host_resolver));
+ net::HostResolver::RequestInfo info(net::HostPortPair(
+ hostname_, port_));
+ int result = resolver_->Resolve(info, &addr_,
+ base::Bind(&WebSocketProxyPrivate::OnHostResolution, this),
+ net::BoundNetLog());
+ if (result != net::ERR_IO_PENDING)
+ OnHostResolution(result);
+ return;
}
}
NOTREACHED();
« no previous file with comments | « chrome/browser/extensions/extension_web_socket_proxy_private_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698