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

Side by Side Diff: extensions/shell/browser/shell_browser_context.cc

Issue 2574763003: Remove chrome-extension-resource:// scheme (Closed)
Patch Set: Silently strip chrome-extension-resource:// from CSP directives. Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/browser/shell_browser_context.h" 5 #include "extensions/shell/browser/shell_browser_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "components/guest_view/browser/guest_view_manager.h" 10 #include "components/guest_view/browser/guest_view_manager.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 storage::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { 49 storage::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() {
50 return storage_policy_.get(); 50 return storage_policy_.get();
51 } 51 }
52 52
53 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext( 53 net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext(
54 content::ProtocolHandlerMap* protocol_handlers, 54 content::ProtocolHandlerMap* protocol_handlers,
55 content::URLRequestInterceptorScopedVector request_interceptors) { 55 content::URLRequestInterceptorScopedVector request_interceptors) {
56 DCHECK(!url_request_context_getter()); 56 DCHECK(!url_request_context_getter());
57 // Handle only chrome-extension:// requests. app_shell does not support 57 // Handle only chrome-extension:// requests.
58 // chrome-extension-resource:// requests (it does not store shared extension
59 // data in its installation directory).
60 InfoMap* extension_info_map = 58 InfoMap* extension_info_map =
61 browser_main_parts_->extension_system()->info_map(); 59 browser_main_parts_->extension_system()->info_map();
62 (*protocol_handlers)[kExtensionScheme] = 60 (*protocol_handlers)[kExtensionScheme] =
63 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 61 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
64 CreateExtensionProtocolHandler(false /* is_incognito */, 62 CreateExtensionProtocolHandler(false /* is_incognito */,
65 extension_info_map) 63 extension_info_map)
66 .release()); 64 .release());
67 65
68 set_url_request_context_getter(new ShellURLRequestContextGetter( 66 set_url_request_context_getter(new ShellURLRequestContextGetter(
69 this, IgnoreCertificateErrors(), GetPath(), 67 this, IgnoreCertificateErrors(), GetPath(),
(...skipping 16 matching lines...) Expand all
86 84
87 void ShellBrowserContext::InitURLRequestContextOnIOThread() { 85 void ShellBrowserContext::InitURLRequestContextOnIOThread() {
88 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 86 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
89 87
90 // GetURLRequestContext() will create a URLRequestContext if it isn't 88 // GetURLRequestContext() will create a URLRequestContext if it isn't
91 // initialized. 89 // initialized.
92 url_request_context_getter()->GetURLRequestContext(); 90 url_request_context_getter()->GetURLRequestContext();
93 } 91 }
94 92
95 } // namespace extensions 93 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698