OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 5 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 NotifyHeadersComplete(); | 213 NotifyHeadersComplete(); |
214 } else { | 214 } else { |
215 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, | 215 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, |
216 net::ERR_INVALID_URL)); | 216 net::ERR_INVALID_URL)); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 namespace { | 220 namespace { |
221 | 221 |
222 bool IsViewAppCacheInternalsURL(const GURL& url) { | 222 bool IsViewAppCacheInternalsURL(const GURL& url) { |
223 return StartsWithASCII(url.spec(), | 223 return url.SchemeIs(chrome::kChromeUIScheme) && |
224 chrome::kAppCacheViewInternalsURL, | 224 url.host() == chrome::kChromeUIAppCacheInternalsHost; |
225 true /*case_sensitive*/); | |
226 } | 225 } |
227 | 226 |
228 class ChromeProtocolHandler | 227 class ChromeProtocolHandler |
229 : public net::URLRequestJobFactory::ProtocolHandler { | 228 : public net::URLRequestJobFactory::ProtocolHandler { |
230 public: | 229 public: |
231 ChromeProtocolHandler(ChromeURLDataManagerBackend* backend, | 230 ChromeProtocolHandler(ChromeURLDataManagerBackend* backend, |
232 ChromeAppCacheService* appcache_service); | 231 ChromeAppCacheService* appcache_service); |
233 ~ChromeProtocolHandler(); | 232 ~ChromeProtocolHandler(); |
234 | 233 |
235 virtual net::URLRequestJob* MaybeCreateJob( | 234 virtual net::URLRequestJob* MaybeCreateJob( |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 478 |
480 return new URLRequestChromeJob(request, backend_); | 479 return new URLRequestChromeJob(request, backend_); |
481 } | 480 } |
482 | 481 |
483 } // namespace | 482 } // namespace |
484 | 483 |
485 net::URLRequestJobFactory::ProtocolHandler* | 484 net::URLRequestJobFactory::ProtocolHandler* |
486 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { | 485 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { |
487 return new DevToolsJobFactory(backend); | 486 return new DevToolsJobFactory(backend); |
488 } | 487 } |
OLD | NEW |