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

Unified Diff: content/browser/loader/resource_hints_impl.cc

Issue 2785523002: Reduce/remove usage of BrowserThread in content/browser/loader. (Closed)
Patch Set: Remove DCHECK Created 3 years, 9 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: content/browser/loader/resource_hints_impl.cc
diff --git a/content/browser/loader/resource_hints_impl.cc b/content/browser/loader/resource_hints_impl.cc
index 3bc81c7c7eefd707ae931009ee098797e9e526a6..5d091710177fedcd4dd484f24531df2433e36026 100644
--- a/content/browser/loader/resource_hints_impl.cc
+++ b/content/browser/loader/resource_hints_impl.cc
@@ -6,7 +6,7 @@
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
-#include "content/public/browser/browser_thread.h"
+#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/resource_hints.h"
#include "net/base/address_list.h"
@@ -51,7 +51,9 @@ void PreconnectUrl(content::ResourceContext* resource_context,
int count,
bool allow_credentials,
net::HttpRequestInfo::RequestMotivation motivation) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ DCHECK(ResourceDispatcherHostImpl::Get()
+ ->io_thread_task_runner()
+ ->BelongsToCurrentThread());
DCHECK(resource_context);
net::URLRequestContext* context = resource_context->GetRequestContext();
@@ -89,7 +91,9 @@ void PreconnectUrl(content::ResourceContext* resource_context,
int PreresolveUrl(content::ResourceContext* resource_context,
const GURL& url,
const net::CompletionCallback& callback) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ DCHECK(ResourceDispatcherHostImpl::Get()
+ ->io_thread_task_runner()
+ ->BelongsToCurrentThread());
DCHECK(resource_context);
auto request_holder = base::MakeUnique<RequestHolder>();
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_unittest.cc ('k') | content/browser/loader/resource_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698