| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 { "data", URLRequestDataJob::Factory }, | 36 { "data", URLRequestDataJob::Factory }, |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 URLRequestJobManager::URLRequestJobManager() { | 39 URLRequestJobManager::URLRequestJobManager() { |
| 40 #ifndef NDEBUG | 40 #ifndef NDEBUG |
| 41 allowed_thread_ = 0; | 41 allowed_thread_ = 0; |
| 42 allowed_thread_initialized_ = false; | 42 allowed_thread_initialized_ = false; |
| 43 #endif | 43 #endif |
| 44 } | 44 } |
| 45 | 45 |
| 46 URLRequestJobManager::~URLRequestJobManager() {} |
| 47 |
| 46 URLRequestJob* URLRequestJobManager::CreateJob(URLRequest* request) const { | 48 URLRequestJob* URLRequestJobManager::CreateJob(URLRequest* request) const { |
| 47 #ifndef NDEBUG | 49 #ifndef NDEBUG |
| 48 DCHECK(IsAllowedThread()); | 50 DCHECK(IsAllowedThread()); |
| 49 #endif | 51 #endif |
| 50 | 52 |
| 51 // If we are given an invalid URL, then don't even try to inspect the scheme. | 53 // If we are given an invalid URL, then don't even try to inspect the scheme. |
| 52 if (!request->url().is_valid()) | 54 if (!request->url().is_valid()) |
| 53 return new URLRequestErrorJob(request, net::ERR_INVALID_URL); | 55 return new URLRequestErrorJob(request, net::ERR_INVALID_URL); |
| 54 | 56 |
| 55 // We do this here to avoid asking interceptors about unsupported schemes. | 57 // We do this here to avoid asking interceptors about unsupported schemes. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 DCHECK(IsAllowedThread()); | 198 DCHECK(IsAllowedThread()); |
| 197 #endif | 199 #endif |
| 198 | 200 |
| 199 AutoLock locked(lock_); | 201 AutoLock locked(lock_); |
| 200 | 202 |
| 201 InterceptorList::iterator i = | 203 InterceptorList::iterator i = |
| 202 std::find(interceptors_.begin(), interceptors_.end(), interceptor); | 204 std::find(interceptors_.begin(), interceptors_.end(), interceptor); |
| 203 DCHECK(i != interceptors_.end()); | 205 DCHECK(i != interceptors_.end()); |
| 204 interceptors_.erase(i); | 206 interceptors_.erase(i); |
| 205 } | 207 } |
| OLD | NEW |