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

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 22793018: <webview>: Implement support for package-local chrome-extension:// URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a comment Created 7 years, 2 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
« no previous file with comments | « chrome/browser/guestview/webview/webview_guest.cc ('k') | chrome/chrome_common.gypi » ('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 "chrome/browser/profiles/profile_impl_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
11 #include "base/prefs/pref_member.h" 11 #include "base/prefs/pref_member.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "base/sequenced_task_runner.h" 13 #include "base/sequenced_task_runner.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/threading/sequenced_worker_pool.h" 16 #include "base/threading/sequenced_worker_pool.h"
17 #include "base/threading/worker_pool.h" 17 #include "base/threading/worker_pool.h"
18 #include "chrome/browser/chrome_notification_types.h" 18 #include "chrome/browser/chrome_notification_types.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
21 #include "chrome/browser/extensions/extension_protocols.h"
21 #include "chrome/browser/io_thread.h" 22 #include "chrome/browser/io_thread.h"
22 #include "chrome/browser/net/chrome_net_log.h" 23 #include "chrome/browser/net/chrome_net_log.h"
23 #include "chrome/browser/net/chrome_network_delegate.h" 24 #include "chrome/browser/net/chrome_network_delegate.h"
24 #include "chrome/browser/net/connect_interceptor.h" 25 #include "chrome/browser/net/connect_interceptor.h"
25 #include "chrome/browser/net/http_server_properties_manager.h" 26 #include "chrome/browser/net/http_server_properties_manager.h"
26 #include "chrome/browser/net/predictor.h" 27 #include "chrome/browser/net/predictor.h"
27 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" 28 #include "chrome/browser/net/sqlite_server_bound_cert_store.h"
28 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
29 #include "chrome/common/chrome_constants.h" 30 #include "chrome/common/chrome_constants.h"
30 #include "chrome/common/chrome_switches.h" 31 #include "chrome/common/chrome_switches.h"
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 582
582 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( 583 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
583 new net::URLRequestJobFactoryImpl()); 584 new net::URLRequestJobFactoryImpl());
584 InstallProtocolHandlers(job_factory.get(), protocol_handlers); 585 InstallProtocolHandlers(job_factory.get(), protocol_handlers);
585 scoped_ptr<net::URLRequestJobFactory> top_job_factory; 586 scoped_ptr<net::URLRequestJobFactory> top_job_factory;
586 // Overwrite the job factory that we inherit from the main context so 587 // Overwrite the job factory that we inherit from the main context so
587 // that we can later provide our own handlers for storage related protocols. 588 // that we can later provide our own handlers for storage related protocols.
588 // Install all the usual protocol handlers unless we are in a browser plugin 589 // Install all the usual protocol handlers unless we are in a browser plugin
589 // guest process, in which case only web-safe schemes are allowed. 590 // guest process, in which case only web-safe schemes are allowed.
590 if (!partition_descriptor.in_memory) { 591 if (!partition_descriptor.in_memory) {
591 top_job_factory = SetUpJobFactoryDefaults( 592 top_job_factory = SetUpJobFactoryDefaults(
Matt Perry 2013/09/27 16:41:09 As discussed offline, maybe we should just call th
592 job_factory.Pass(), protocol_handler_interceptor.Pass(), 593 job_factory.Pass(), protocol_handler_interceptor.Pass(),
593 network_delegate(), 594 network_delegate(),
594 ftp_factory_.get()); 595 ftp_factory_.get());
595 } else { 596 } else {
597 // TODO(fsamuel): It's always safe to install an extension protocol handler
598 // here because the decision whether to allow a resource load happens in
599 // ExtensionProtocolHandler::MaybeCreateJob. However, this code needs to be
600 // refactored so that it does not depend on whether or not the partition
601 // is in memory.
602 job_factory->SetProtocolHandler(
603 extensions::kExtensionScheme,
604 CreateExtensionProtocolHandler(is_incognito(),
605 GetExtensionInfoMap()));
596 top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>(); 606 top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>();
597 } 607 }
598 context->SetJobFactory(top_job_factory.Pass()); 608 context->SetJobFactory(top_job_factory.Pass());
599 609
600 return context; 610 return context;
601 } 611 }
602 612
603 ChromeURLRequestContext* 613 ChromeURLRequestContext*
604 ProfileImplIOData::InitializeMediaRequestContext( 614 ProfileImplIOData::InitializeMediaRequestContext(
605 ChromeURLRequestContext* original_context, 615 ChromeURLRequestContext* original_context,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 const base::Closure& completion) { 705 const base::Closure& completion) {
696 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 706 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
697 DCHECK(initialized()); 707 DCHECK(initialized());
698 708
699 DCHECK(transport_security_state()); 709 DCHECK(transport_security_state());
700 // Completes synchronously. 710 // Completes synchronously.
701 transport_security_state()->DeleteAllDynamicDataSince(time); 711 transport_security_state()->DeleteAllDynamicDataSince(time);
702 DCHECK(http_server_properties_manager_); 712 DCHECK(http_server_properties_manager_);
703 http_server_properties_manager_->Clear(completion); 713 http_server_properties_manager_->Clear(completion);
704 } 714 }
OLDNEW
« no previous file with comments | « chrome/browser/guestview/webview/webview_guest.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698