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

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

Issue 647853002: Create a proprietary scheme for loading web-accessible resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update include guards too Created 6 years, 1 month 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
« no previous file with comments | « content/browser/resource_protocol_handler_unittest.cc ('k') | content/common/url_schemes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
16 #include "base/threading/sequenced_worker_pool.h" 16 #include "base/threading/sequenced_worker_pool.h"
17 #include "content/browser/appcache/appcache_interceptor.h" 17 #include "content/browser/appcache/appcache_interceptor.h"
18 #include "content/browser/appcache/chrome_appcache_service.h" 18 #include "content/browser/appcache/chrome_appcache_service.h"
19 #include "content/browser/fileapi/browser_file_system_helper.h" 19 #include "content/browser/fileapi/browser_file_system_helper.h"
20 #include "content/browser/fileapi/chrome_blob_storage_context.h" 20 #include "content/browser/fileapi/chrome_blob_storage_context.h"
21 #include "content/browser/loader/resource_request_info_impl.h" 21 #include "content/browser/loader/resource_request_info_impl.h"
22 #include "content/browser/resource_context_impl.h" 22 #include "content/browser/resource_context_impl.h"
23 #include "content/browser/resource_protocol_handler.h"
23 #include "content/browser/service_worker/service_worker_request_handler.h" 24 #include "content/browser/service_worker/service_worker_request_handler.h"
24 #include "content/browser/storage_partition_impl.h" 25 #include "content/browser/storage_partition_impl.h"
25 #include "content/browser/streams/stream.h" 26 #include "content/browser/streams/stream.h"
26 #include "content/browser/streams/stream_context.h" 27 #include "content/browser/streams/stream_context.h"
27 #include "content/browser/streams/stream_registry.h" 28 #include "content/browser/streams/stream_registry.h"
28 #include "content/browser/streams/stream_url_request_job.h" 29 #include "content/browser/streams/stream_url_request_job.h"
29 #include "content/browser/webui/url_data_manager_backend.h" 30 #include "content/browser/webui/url_data_manager_backend.h"
30 #include "content/public/browser/browser_context.h" 31 #include "content/public/browser/browser_context.h"
31 #include "content/public/browser/browser_thread.h" 32 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/content_browser_client.h" 33 #include "content/public/browser/content_browser_client.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 browser_context_->GetResourceContext(), 427 browser_context_->GetResourceContext(),
427 browser_context_->IsOffTheRecord(), 428 browser_context_->IsOffTheRecord(),
428 partition->GetAppCacheService(), 429 partition->GetAppCacheService(),
429 blob_storage_context)); 430 blob_storage_context));
430 } 431 }
431 protocol_handlers[kChromeDevToolsScheme] = 432 protocol_handlers[kChromeDevToolsScheme] =
432 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 433 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
433 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(), 434 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(),
434 browser_context_->IsOffTheRecord())); 435 browser_context_->IsOffTheRecord()));
435 436
437 scoped_ptr<ResourceProtocolHandler> resource_protocol(
438 new ResourceProtocolHandler);
439 RegisterDefaultWebAccessibleResources(resource_protocol.get());
440 protocol_handlers[kResourceScheme] =
441 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
442 resource_protocol.release());
443
436 URLRequestInterceptorScopedVector request_interceptors; 444 URLRequestInterceptorScopedVector request_interceptors;
437 request_interceptors.push_back( 445 request_interceptors.push_back(
438 ServiceWorkerRequestHandler::CreateInterceptor( 446 ServiceWorkerRequestHandler::CreateInterceptor(
439 browser_context_->GetResourceContext()).release()); 447 browser_context_->GetResourceContext()).release());
440 request_interceptors.push_back( 448 request_interceptors.push_back(
441 AppCacheInterceptor::CreateStartInterceptor().release()); 449 AppCacheInterceptor::CreateStartInterceptor().release());
442 450
443 // These calls must happen after StoragePartitionImpl::Create(). 451 // These calls must happen after StoragePartitionImpl::Create().
444 if (partition_domain.empty()) { 452 if (partition_domain.empty()) {
445 partition->SetURLRequestContext( 453 partition->SetURLRequestContext(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 600
593 // We do not call InitializeURLRequestContext() for media contexts because, 601 // We do not call InitializeURLRequestContext() for media contexts because,
594 // other than the HTTP cache, the media contexts share the same backing 602 // other than the HTTP cache, the media contexts share the same backing
595 // objects as their associated "normal" request context. Thus, the previous 603 // objects as their associated "normal" request context. Thus, the previous
596 // call serves to initialize the media request context for this storage 604 // call serves to initialize the media request context for this storage
597 // partition as well. 605 // partition as well.
598 } 606 }
599 } 607 }
600 608
601 } // namespace content 609 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/resource_protocol_handler_unittest.cc ('k') | content/common/url_schemes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698