| 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" |
| 11 #include "net/base/load_flags.h" | 11 #include "net/base/load_flags.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "net/url_request/url_request_about_job.h" | 13 #include "net/url_request/url_request_about_job.h" |
| 14 #include "net/url_request/url_request_error_job.h" | 14 #include "net/url_request/url_request_error_job.h" |
| 15 #include "net/url_request/url_request_file_job.h" | 15 #include "net/url_request/url_request_file_job.h" |
| 16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
| 17 #include "net/url_request/url_request_ftp_job.h" | 17 #include "net/url_request/url_request_ftp_job.h" |
| 18 #else | 18 #else |
| 19 // TODO(playmobil): Implement on non-windows platforms. | 19 #include "net/url_request/url_request_new_ftp_job.h" |
| 20 #endif | 20 #endif |
| 21 #include "net/url_request/url_request_http_job.h" | 21 #include "net/url_request/url_request_http_job.h" |
| 22 #include "net/url_request/url_request_view_cache_job.h" | 22 #include "net/url_request/url_request_view_cache_job.h" |
| 23 | 23 |
| 24 // The built-in set of protocol factories | 24 // The built-in set of protocol factories |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 struct SchemeToFactory { | 27 struct SchemeToFactory { |
| 28 const char* scheme; | 28 const char* scheme; |
| 29 URLRequest::ProtocolFactory* factory; | 29 URLRequest::ProtocolFactory* factory; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 static const SchemeToFactory kBuiltinFactories[] = { | 34 static const SchemeToFactory kBuiltinFactories[] = { |
| 35 { "http", URLRequestHttpJob::Factory }, | 35 { "http", URLRequestHttpJob::Factory }, |
| 36 { "https", URLRequestHttpJob::Factory }, | 36 { "https", URLRequestHttpJob::Factory }, |
| 37 { "file", URLRequestFileJob::Factory }, | 37 { "file", URLRequestFileJob::Factory }, |
| 38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
| 39 { "ftp", URLRequestFtpJob::Factory }, | 39 { "ftp", URLRequestFtpJob::Factory }, |
| 40 #else | 40 #else |
| 41 // TODO(playmobil): Implement on non-windows platforms. | 41 { "ftp", URLRequestNewFtpJob::Factory }, |
| 42 #endif | 42 #endif |
| 43 { "about", URLRequestAboutJob::Factory }, | 43 { "about", URLRequestAboutJob::Factory }, |
| 44 { "view-cache", URLRequestViewCacheJob::Factory }, | 44 { "view-cache", URLRequestViewCacheJob::Factory }, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 URLRequestJobManager::URLRequestJobManager() { | 47 URLRequestJobManager::URLRequestJobManager() { |
| 48 #ifndef NDEBUG | 48 #ifndef NDEBUG |
| 49 allowed_thread_ = 0; | 49 allowed_thread_ = 0; |
| 50 allowed_thread_initialized_ = false; | 50 allowed_thread_initialized_ = false; |
| 51 #endif | 51 #endif |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 DCHECK(IsAllowedThread()); | 203 DCHECK(IsAllowedThread()); |
| 204 #endif | 204 #endif |
| 205 | 205 |
| 206 AutoLock locked(lock_); | 206 AutoLock locked(lock_); |
| 207 | 207 |
| 208 InterceptorList::iterator i = | 208 InterceptorList::iterator i = |
| 209 std::find(interceptors_.begin(), interceptors_.end(), interceptor); | 209 std::find(interceptors_.begin(), interceptors_.end(), interceptor); |
| 210 DCHECK(i != interceptors_.end()); | 210 DCHECK(i != interceptors_.end()); |
| 211 interceptors_.erase(i); | 211 interceptors_.erase(i); |
| 212 } | 212 } |
| OLD | NEW |