| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/url_request/url_request_job_manager.h" | 5 #include "net/url_request/url_request_job_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) { | 115 for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) { |
| 116 if (scheme == kBuiltinFactories[i].scheme) { | 116 if (scheme == kBuiltinFactories[i].scheme) { |
| 117 URLRequestJob* job = (kBuiltinFactories[i].factory)(request, scheme); | 117 URLRequestJob* job = (kBuiltinFactories[i].factory)(request, scheme); |
| 118 DCHECK(job); // The built-in factories are not expected to fail! | 118 DCHECK(job); // The built-in factories are not expected to fail! |
| 119 return job; | 119 return job; |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 // If we reached here, then it means that a registered protocol factory | 123 // If we reached here, then it means that a registered protocol factory |
| 124 // wasn't interested in handling the URL. That is fairly unexpected, and we | 124 // wasn't interested in handling the URL. That is fairly unexpected, and we |
| 125 // don't know have a specific error to report here :-( | 125 // don't have a specific error to report here :-( |
| 126 LOG(WARNING) << "Failed to map: " << request->url().spec(); | 126 LOG(WARNING) << "Failed to map: " << request->url().spec(); |
| 127 return new URLRequestErrorJob(request, ERR_FAILED); | 127 return new URLRequestErrorJob(request, ERR_FAILED); |
| 128 } | 128 } |
| 129 | 129 |
| 130 URLRequestJob* URLRequestJobManager::MaybeInterceptRedirect( | 130 URLRequestJob* URLRequestJobManager::MaybeInterceptRedirect( |
| 131 URLRequest* request, | 131 URLRequest* request, |
| 132 const GURL& location) const { | 132 const GURL& location) const { |
| 133 DCHECK(IsAllowedThread()); | 133 DCHECK(IsAllowedThread()); |
| 134 if (!request->url().is_valid() || | 134 if (!request->url().is_valid() || |
| 135 request->load_flags() & LOAD_DISABLE_INTERCEPT || | 135 request->load_flags() & LOAD_DISABLE_INTERCEPT || |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 base::AutoLock locked(lock_); | 257 base::AutoLock locked(lock_); |
| 258 | 258 |
| 259 InterceptorList::iterator i = | 259 InterceptorList::iterator i = |
| 260 std::find(interceptors_.begin(), interceptors_.end(), interceptor); | 260 std::find(interceptors_.begin(), interceptors_.end(), interceptor); |
| 261 DCHECK(i != interceptors_.end()); | 261 DCHECK(i != interceptors_.end()); |
| 262 interceptors_.erase(i); | 262 interceptors_.erase(i); |
| 263 } | 263 } |
| 264 | 264 |
| 265 URLRequestJobManager::URLRequestJobManager() | 265 URLRequestJobManager::URLRequestJobManager() |
| 266 : allowed_thread_(0), | 266 : allowed_thread_(0), |
| 267 allowed_thread_initialized_(false), | 267 allowed_thread_initialized_(false) { |
| 268 enable_file_access_(false) { | |
| 269 } | 268 } |
| 270 | 269 |
| 271 URLRequestJobManager::~URLRequestJobManager() {} | 270 URLRequestJobManager::~URLRequestJobManager() {} |
| 272 | 271 |
| 273 } // namespace net | 272 } // namespace net |
| OLD | NEW |