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

Unified Diff: net/url_request/url_request_job_manager.cc

Issue 7075005: Revert 86802 - Remove ProtocolFactory/Interceptor uses in GViewRequestInterceptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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
« no previous file with comments | « net/url_request/url_request_job_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_job_manager.cc
===================================================================
--- net/url_request/url_request_job_manager.cc (revision 86802)
+++ net/url_request/url_request_job_manager.cc (working copy)
@@ -49,7 +49,9 @@
URLRequestJob* URLRequestJobManager::CreateJob(
URLRequest* request) const {
+#ifndef NDEBUG
DCHECK(IsAllowedThread());
+#endif
// If we are given an invalid URL, then don't even try to inspect the scheme.
if (!request->url().is_valid())
@@ -130,35 +132,18 @@
URLRequestJob* URLRequestJobManager::MaybeInterceptRedirect(
URLRequest* request,
const GURL& location) const {
+#ifndef NDEBUG
DCHECK(IsAllowedThread());
- if (!request->url().is_valid() ||
- request->load_flags() & LOAD_DISABLE_INTERCEPT ||
- request->status().status() == URLRequestStatus::CANCELED) {
+#endif
+ if ((request->load_flags() & LOAD_DISABLE_INTERCEPT) ||
+ (request->status().status() == URLRequestStatus::CANCELED) ||
+ !request->url().is_valid() ||
+ !SupportsScheme(request->url().scheme()))
return NULL;
- }
- const URLRequestJobFactory* job_factory = NULL;
- if (request->context())
- job_factory = request->context()->job_factory();
-
- const std::string& scheme = request->url().scheme(); // already lowercase
- if (job_factory) {
- if (!job_factory->IsHandledProtocol(scheme)) {
- return NULL;
- }
- } else if (!SupportsScheme(scheme)) {
- return NULL;
- }
-
- URLRequestJob* job = NULL;
- if (job_factory)
- job = job_factory->MaybeInterceptRedirect(location, request);
- if (job)
- return job;
-
InterceptorList::const_iterator i;
for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
- job = (*i)->MaybeInterceptRedirect(request, location);
+ URLRequestJob* job = (*i)->MaybeInterceptRedirect(request, location);
if (job)
return job;
}
@@ -167,35 +152,18 @@
URLRequestJob* URLRequestJobManager::MaybeInterceptResponse(
URLRequest* request) const {
+#ifndef NDEBUG
DCHECK(IsAllowedThread());
- if (!request->url().is_valid() ||
- request->load_flags() & LOAD_DISABLE_INTERCEPT ||
- request->status().status() == URLRequestStatus::CANCELED) {
+#endif
+ if ((request->load_flags() & LOAD_DISABLE_INTERCEPT) ||
+ (request->status().status() == URLRequestStatus::CANCELED) ||
+ !request->url().is_valid() ||
+ !SupportsScheme(request->url().scheme()))
return NULL;
- }
- const URLRequestJobFactory* job_factory = NULL;
- if (request->context())
- job_factory = request->context()->job_factory();
-
- const std::string& scheme = request->url().scheme(); // already lowercase
- if (job_factory) {
- if (!job_factory->IsHandledProtocol(scheme)) {
- return NULL;
- }
- } else if (!SupportsScheme(scheme)) {
- return NULL;
- }
-
- URLRequestJob* job = NULL;
- if (job_factory)
- job = job_factory->MaybeInterceptResponse(request);
- if (job)
- return job;
-
InterceptorList::const_iterator i;
for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
- job = (*i)->MaybeInterceptResponse(request);
+ URLRequestJob* job = (*i)->MaybeInterceptResponse(request);
if (job)
return job;
}
« no previous file with comments | « net/url_request/url_request_job_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698