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 "content/browser/webui/url_data_manager_backend.h" | 5 #include "content/browser/webui/url_data_manager_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 net::NetworkDelegate* network_delegate) const OVERRIDE { | 372 net::NetworkDelegate* network_delegate) const OVERRIDE { |
373 DCHECK(request); | 373 DCHECK(request); |
374 | 374 |
375 // Check for chrome://view-http-cache/*, which uses its own job type. | 375 // Check for chrome://view-http-cache/*, which uses its own job type. |
376 if (ViewHttpCacheJobFactory::IsSupportedURL(request->url())) | 376 if (ViewHttpCacheJobFactory::IsSupportedURL(request->url())) |
377 return ViewHttpCacheJobFactory::CreateJobForRequest(request, | 377 return ViewHttpCacheJobFactory::CreateJobForRequest(request, |
378 network_delegate); | 378 network_delegate); |
379 | 379 |
380 // Next check for chrome://appcache-internals/, which uses its own job type. | 380 // Next check for chrome://appcache-internals/, which uses its own job type. |
381 if (request->url().SchemeIs(chrome::kChromeUIScheme) && | 381 if (request->url().SchemeIs(chrome::kChromeUIScheme) && |
382 request->url().host() == chrome::kChromeUIAppCacheInternalsHost) { | 382 request->url().host() == kChromeUIAppCacheInternalsHost) { |
383 return appcache::ViewAppCacheInternalsJobFactory::CreateJobForRequest( | 383 return appcache::ViewAppCacheInternalsJobFactory::CreateJobForRequest( |
384 request, network_delegate, appcache_service_); | 384 request, network_delegate, appcache_service_); |
385 } | 385 } |
386 | 386 |
387 // Next check for chrome://blob-internals/, which uses its own job type. | 387 // Next check for chrome://blob-internals/, which uses its own job type. |
388 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { | 388 if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) { |
389 return ViewBlobInternalsJobFactory::CreateJobForRequest( | 389 return ViewBlobInternalsJobFactory::CreateJobForRequest( |
390 request, network_delegate, blob_storage_context_->controller()); | 390 request, network_delegate, blob_storage_context_->controller()); |
391 } | 391 } |
392 | 392 |
393 #if defined(USE_TCMALLOC) | 393 #if defined(USE_TCMALLOC) |
394 // Next check for chrome://tcmalloc/, which uses its own job type. | 394 // Next check for chrome://tcmalloc/, which uses its own job type. |
395 if (request->url().SchemeIs(chrome::kChromeUIScheme) && | 395 if (request->url().SchemeIs(chrome::kChromeUIScheme) && |
396 request->url().host() == chrome::kChromeUITcmallocHost) { | 396 request->url().host() == kChromeUITcmallocHost) { |
397 return new TcmallocInternalsRequestJob(request, network_delegate); | 397 return new TcmallocInternalsRequestJob(request, network_delegate); |
398 } | 398 } |
399 #endif | 399 #endif |
400 | 400 |
401 // Next check for chrome://histograms/, which uses its own job type. | 401 // Next check for chrome://histograms/, which uses its own job type. |
402 if (request->url().SchemeIs(chrome::kChromeUIScheme) && | 402 if (request->url().SchemeIs(chrome::kChromeUIScheme) && |
403 request->url().host() == chrome::kChromeUIHistogramHost) { | 403 request->url().host() == kChromeUIHistogramHost) { |
404 return new HistogramInternalsRequestJob(request, network_delegate); | 404 return new HistogramInternalsRequestJob(request, network_delegate); |
405 } | 405 } |
406 | 406 |
407 // Fall back to using a custom handler | 407 // Fall back to using a custom handler |
408 return new URLRequestChromeJob( | 408 return new URLRequestChromeJob( |
409 request, network_delegate, | 409 request, network_delegate, |
410 GetURLDataManagerForResourceContext(resource_context_), is_incognito_); | 410 GetURLDataManagerForResourceContext(resource_context_), is_incognito_); |
411 } | 411 } |
412 | 412 |
413 private: | 413 private: |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 623 |
624 } // namespace | 624 } // namespace |
625 | 625 |
626 net::URLRequestJobFactory::ProtocolHandler* | 626 net::URLRequestJobFactory::ProtocolHandler* |
627 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 627 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
628 bool is_incognito) { | 628 bool is_incognito) { |
629 return new DevToolsJobFactory(resource_context, is_incognito); | 629 return new DevToolsJobFactory(resource_context, is_incognito); |
630 } | 630 } |
631 | 631 |
632 } // namespace content | 632 } // namespace content |
OLD | NEW |