| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // See if the request should be intercepted. | 69 // See if the request should be intercepted. |
| 70 // | 70 // |
| 71 URLRequestJob* job = job_factory->MaybeCreateJobWithProtocolHandler( | 71 URLRequestJob* job = job_factory->MaybeCreateJobWithProtocolHandler( |
| 72 scheme, request, network_delegate); | 72 scheme, request, network_delegate); |
| 73 if (job) | 73 if (job) |
| 74 return job; | 74 return job; |
| 75 | 75 |
| 76 // See if the request should be handled by a built-in protocol factory. | 76 // See if the request should be handled by a built-in protocol factory. |
| 77 for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) { | 77 for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) { |
| 78 if (scheme == kBuiltinFactories[i].scheme) { | 78 if (scheme == kBuiltinFactories[i].scheme) { |
| 79 URLRequestJob* job = (kBuiltinFactories[i].factory)( | 79 URLRequestJob* new_job = |
| 80 request, network_delegate, scheme); | 80 (kBuiltinFactories[i].factory)(request, network_delegate, scheme); |
| 81 DCHECK(job); // The built-in factories are not expected to fail! | 81 DCHECK(new_job); // The built-in factories are not expected to fail! |
| 82 return job; | 82 return new_job; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 // If we reached here, then it means that a registered protocol factory | 86 // If we reached here, then it means that a registered protocol factory |
| 87 // wasn't interested in handling the URL. That is fairly unexpected, and we | 87 // wasn't interested in handling the URL. That is fairly unexpected, and we |
| 88 // don't have a specific error to report here :-( | 88 // don't have a specific error to report here :-( |
| 89 LOG(WARNING) << "Failed to map: " << request->url().spec(); | 89 LOG(WARNING) << "Failed to map: " << request->url().spec(); |
| 90 return new URLRequestErrorJob(request, network_delegate, ERR_FAILED); | 90 return new URLRequestErrorJob(request, network_delegate, ERR_FAILED); |
| 91 } | 91 } |
| 92 | 92 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 return false; | 150 return false; |
| 151 } | 151 } |
| 152 | 152 |
| 153 URLRequestJobManager::URLRequestJobManager() { | 153 URLRequestJobManager::URLRequestJobManager() { |
| 154 } | 154 } |
| 155 | 155 |
| 156 URLRequestJobManager::~URLRequestJobManager() {} | 156 URLRequestJobManager::~URLRequestJobManager() {} |
| 157 | 157 |
| 158 } // namespace net | 158 } // namespace net |
| OLD | NEW |