Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: content/browser/storage_partition_impl_map.cc

Issue 2867853002: Make the new WebUI's code handle all webui schemes, instead of just chrome://. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/storage_partition_impl_map.h" 5 #include "content/browser/storage_partition_impl_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 ProtocolHandlerMap protocol_handlers; 408 ProtocolHandlerMap protocol_handlers;
409 protocol_handlers[url::kBlobScheme] = 409 protocol_handlers[url::kBlobScheme] =
410 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 410 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
411 new BlobProtocolHandler(blob_storage_context, 411 new BlobProtocolHandler(blob_storage_context,
412 stream_context, 412 stream_context,
413 partition->GetFileSystemContext())); 413 partition->GetFileSystemContext()));
414 protocol_handlers[url::kFileSystemScheme] = 414 protocol_handlers[url::kFileSystemScheme] =
415 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 415 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
416 CreateFileSystemProtocolHandler(partition_domain, 416 CreateFileSystemProtocolHandler(partition_domain,
417 partition->GetFileSystemContext())); 417 partition->GetFileSystemContext()));
418 protocol_handlers[kChromeUIScheme] = 418 for (const auto& scheme : URLDataManagerBackend::GetWebUISchemes()) {
419 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 419 protocol_handlers[scheme] =
420 URLDataManagerBackend::CreateProtocolHandler(
421 browser_context_->GetResourceContext(),
422 blob_storage_context).release());
423 std::vector<std::string> additional_webui_schemes;
424 GetContentClient()->browser()->GetAdditionalWebUISchemes(
425 &additional_webui_schemes);
426 for (std::vector<std::string>::const_iterator it =
427 additional_webui_schemes.begin();
428 it != additional_webui_schemes.end();
429 ++it) {
430 protocol_handlers[*it] =
431 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 420 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
432 URLDataManagerBackend::CreateProtocolHandler( 421 URLDataManagerBackend::CreateProtocolHandler(
433 browser_context_->GetResourceContext(), 422 browser_context_->GetResourceContext(), blob_storage_context)
434 blob_storage_context).release()); 423 .release());
435 } 424 }
436 425
437 protocol_handlers[kChromeDevToolsScheme] = 426 protocol_handlers[kChromeDevToolsScheme] =
438 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 427 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
439 CreateDevToolsProtocolHandler( 428 CreateDevToolsProtocolHandler(
440 browser_context_->GetResourceContext())); 429 browser_context_->GetResourceContext()));
441 430
442 URLRequestInterceptorScopedVector request_interceptors; 431 URLRequestInterceptorScopedVector request_interceptors;
443 request_interceptors.push_back(ServiceWorkerRequestHandler::CreateInterceptor( 432 request_interceptors.push_back(ServiceWorkerRequestHandler::CreateInterceptor(
444 browser_context_->GetResourceContext())); 433 browser_context_->GetResourceContext()));
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 596
608 // We do not call InitializeURLRequestContext() for media contexts because, 597 // We do not call InitializeURLRequestContext() for media contexts because,
609 // other than the HTTP cache, the media contexts share the same backing 598 // other than the HTTP cache, the media contexts share the same backing
610 // objects as their associated "normal" request context. Thus, the previous 599 // objects as their associated "normal" request context. Thus, the previous
611 // call serves to initialize the media request context for this storage 600 // call serves to initialize the media request context for this storage
612 // partition as well. 601 // partition as well.
613 } 602 }
614 } 603 }
615 604
616 } // namespace content 605 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader_network_service.cc ('k') | content/browser/webui/url_data_manager_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698