| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 static const SchemeToFactory kBuiltinFactories[] = { | 33 static const SchemeToFactory kBuiltinFactories[] = { |
| 34 { "http", URLRequestHttpJob::Factory }, | 34 { "http", URLRequestHttpJob::Factory }, |
| 35 { "https", URLRequestHttpJob::Factory }, | 35 { "https", URLRequestHttpJob::Factory }, |
| 36 { "file", URLRequestFileJob::Factory }, | 36 { "file", URLRequestFileJob::Factory }, |
| 37 { "ftp", URLRequestFtpJob::Factory }, | 37 { "ftp", URLRequestFtpJob::Factory }, |
| 38 { "about", URLRequestAboutJob::Factory }, | 38 { "about", URLRequestAboutJob::Factory }, |
| 39 { "data", URLRequestDataJob::Factory }, | 39 { "data", URLRequestDataJob::Factory }, |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 URLRequestJobManager::URLRequestJobManager() : enable_file_access_(false) { | |
| 43 #ifndef NDEBUG | |
| 44 allowed_thread_ = 0; | |
| 45 allowed_thread_initialized_ = false; | |
| 46 #endif | |
| 47 } | |
| 48 | |
| 49 URLRequestJobManager::~URLRequestJobManager() {} | |
| 50 | |
| 51 // static | 42 // static |
| 52 URLRequestJobManager* URLRequestJobManager::GetInstance() { | 43 URLRequestJobManager* URLRequestJobManager::GetInstance() { |
| 53 return Singleton<URLRequestJobManager>::get(); | 44 return Singleton<URLRequestJobManager>::get(); |
| 54 } | 45 } |
| 55 | 46 |
| 56 net::URLRequestJob* URLRequestJobManager::CreateJob( | 47 net::URLRequestJob* URLRequestJobManager::CreateJob( |
| 57 net::URLRequest* request) const { | 48 net::URLRequest* request) const { |
| 58 #ifndef NDEBUG | 49 #ifndef NDEBUG |
| 59 DCHECK(IsAllowedThread()); | 50 DCHECK(IsAllowedThread()); |
| 60 #endif | 51 #endif |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 #endif | 199 #endif |
| 209 | 200 |
| 210 base::AutoLock locked(lock_); | 201 base::AutoLock locked(lock_); |
| 211 | 202 |
| 212 InterceptorList::iterator i = | 203 InterceptorList::iterator i = |
| 213 std::find(interceptors_.begin(), interceptors_.end(), interceptor); | 204 std::find(interceptors_.begin(), interceptors_.end(), interceptor); |
| 214 DCHECK(i != interceptors_.end()); | 205 DCHECK(i != interceptors_.end()); |
| 215 interceptors_.erase(i); | 206 interceptors_.erase(i); |
| 216 } | 207 } |
| 217 | 208 |
| 209 URLRequestJobManager::URLRequestJobManager() : enable_file_access_(false) { |
| 210 #ifndef NDEBUG |
| 211 allowed_thread_ = 0; |
| 212 allowed_thread_initialized_ = false; |
| 213 #endif |
| 214 } |
| 215 |
| 216 URLRequestJobManager::~URLRequestJobManager() {} |
| 217 |
| 218 } // namespace net | 218 } // namespace net |
| OLD | NEW |