| 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 url.SchemeIs(chrome::kChromeUIScheme) && | 223 return StartsWithASCII(url.spec(), |
| 224 url.host() == chrome::kChromeUIAppCacheInternalsHost; | 224 chrome::kAppCacheViewInternalsURL, |
| 225 true /*case_sensitive*/); |
| 225 } | 226 } |
| 226 | 227 |
| 227 class ChromeProtocolHandler | 228 class ChromeProtocolHandler |
| 228 : public net::URLRequestJobFactory::ProtocolHandler { | 229 : public net::URLRequestJobFactory::ProtocolHandler { |
| 229 public: | 230 public: |
| 230 ChromeProtocolHandler(ChromeURLDataManagerBackend* backend, | 231 ChromeProtocolHandler(ChromeURLDataManagerBackend* backend, |
| 231 ChromeAppCacheService* appcache_service); | 232 ChromeAppCacheService* appcache_service); |
| 232 ~ChromeProtocolHandler(); | 233 ~ChromeProtocolHandler(); |
| 233 | 234 |
| 234 virtual net::URLRequestJob* MaybeCreateJob( | 235 virtual net::URLRequestJob* MaybeCreateJob( |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 479 |
| 479 return new URLRequestChromeJob(request, backend_); | 480 return new URLRequestChromeJob(request, backend_); |
| 480 } | 481 } |
| 481 | 482 |
| 482 } // namespace | 483 } // namespace |
| 483 | 484 |
| 484 net::URLRequestJobFactory::ProtocolHandler* | 485 net::URLRequestJobFactory::ProtocolHandler* |
| 485 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { | 486 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { |
| 486 return new DevToolsJobFactory(backend); | 487 return new DevToolsJobFactory(backend); |
| 487 } | 488 } |
| OLD | NEW |