| 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/url_request/url_request_about_job.h" | 12 #include "net/url_request/url_request_about_job.h" |
| 13 #include "net/url_request/url_request_error_job.h" | 13 #include "net/url_request/url_request_error_job.h" |
| 14 #include "net/url_request/url_request_file_job.h" |
| 14 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
| 15 #include "net/url_request/url_request_file_job.h" | |
| 16 #include "net/url_request/url_request_ftp_job.h" | 16 #include "net/url_request/url_request_ftp_job.h" |
| 17 #else | 17 #else |
| 18 // TODO(playmobil): Implement on non-windows platforms. | 18 // TODO(playmobil): Implement on non-windows platforms. |
| 19 #endif | 19 #endif |
| 20 #include "net/url_request/url_request_http_job.h" | 20 #include "net/url_request/url_request_http_job.h" |
| 21 #include "net/url_request/url_request_view_cache_job.h" | 21 #include "net/url_request/url_request_view_cache_job.h" |
| 22 | 22 |
| 23 // The built-in set of protocol factories | 23 // The built-in set of protocol factories |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 struct SchemeToFactory { | 26 struct SchemeToFactory { |
| 27 const char* scheme; | 27 const char* scheme; |
| 28 URLRequest::ProtocolFactory* factory; | 28 URLRequest::ProtocolFactory* factory; |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 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 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 37 { "file", URLRequestFileJob::Factory }, | |
| 38 { "ftp", URLRequestFtpJob::Factory }, | 38 { "ftp", URLRequestFtpJob::Factory }, |
| 39 #else | 39 #else |
| 40 // TODO(playmobil): Implement on non-windows platforms. | 40 // TODO(playmobil): Implement on non-windows platforms. |
| 41 #endif | 41 #endif |
| 42 { "about", URLRequestAboutJob::Factory }, | 42 { "about", URLRequestAboutJob::Factory }, |
| 43 { "view-cache", URLRequestViewCacheJob::Factory }, | 43 { "view-cache", URLRequestViewCacheJob::Factory }, |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 URLRequestJobManager::URLRequestJobManager() { | 46 URLRequestJobManager::URLRequestJobManager() { |
| 47 #ifndef NDEBUG | 47 #ifndef NDEBUG |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 #endif | 163 #endif |
| 164 | 164 |
| 165 AutoLock locked(lock_); | 165 AutoLock locked(lock_); |
| 166 | 166 |
| 167 InterceptorList::iterator i = | 167 InterceptorList::iterator i = |
| 168 std::find(interceptors_.begin(), interceptors_.end(), interceptor); | 168 std::find(interceptors_.begin(), interceptors_.end(), interceptor); |
| 169 DCHECK(i != interceptors_.end()); | 169 DCHECK(i != interceptors_.end()); |
| 170 interceptors_.erase(i); | 170 interceptors_.erase(i); |
| 171 } | 171 } |
| 172 | 172 |
| OLD | NEW |