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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 2656433005: Use explicit WebString conversions in extensions/ (Closed)
Patch Set: Created 3 years, 11 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 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/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 WakeEventPage::Get()->Init(RenderThread::Get()); 260 WakeEventPage::Get()->Init(RenderThread::Get());
261 // Ideally this should be done after checking 261 // Ideally this should be done after checking
262 // ExtensionAPIEnabledInExtensionServiceWorkers(), but the Dispatcher is 262 // ExtensionAPIEnabledInExtensionServiceWorkers(), but the Dispatcher is
263 // created so early that sending an IPC from browser/ process to synchronize 263 // created so early that sending an IPC from browser/ process to synchronize
264 // this enabled-ness is too late. 264 // this enabled-ness is too late.
265 WorkerThreadDispatcher::Get()->Init(RenderThread::Get()); 265 WorkerThreadDispatcher::Get()->Init(RenderThread::Get());
266 266
267 RenderThread::Get()->RegisterExtension(SafeBuiltins::CreateV8Extension()); 267 RenderThread::Get()->RegisterExtension(SafeBuiltins::CreateV8Extension());
268 268
269 // Register WebSecurityPolicy whitelists for the chrome-extension:// scheme. 269 // Register WebSecurityPolicy whitelists for the chrome-extension:// scheme.
270 WebString extension_scheme(base::ASCIIToUTF16(kExtensionScheme)); 270 WebString extension_scheme(WebString::fromASCII(kExtensionScheme));
271 271
272 // Resources should bypass Content Security Policy checks when included in 272 // Resources should bypass Content Security Policy checks when included in
273 // protected resources. TODO(kalman): What are "protected resources"? 273 // protected resources. TODO(kalman): What are "protected resources"?
274 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( 274 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
275 extension_scheme); 275 extension_scheme);
276 276
277 // Extension resources are HTTP-like and safe to expose to the fetch API. The 277 // Extension resources are HTTP-like and safe to expose to the fetch API. The
278 // rules for the fetch API are consistent with XHR. 278 // rules for the fetch API are consistent with XHR.
279 WebSecurityPolicy::registerURLSchemeAsSupportingFetchAPI(extension_scheme); 279 WebSecurityPolicy::registerURLSchemeAsSupportingFetchAPI(extension_scheme);
280 280
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 // The "guestViewDeny" module must always be loaded last. It registers 1463 // The "guestViewDeny" module must always be loaded last. It registers
1464 // error-providing custom elements for the GuestView types that are not 1464 // error-providing custom elements for the GuestView types that are not
1465 // available, and thus all of those types must have been checked and loaded 1465 // available, and thus all of those types must have been checked and loaded
1466 // (or not loaded) beforehand. 1466 // (or not loaded) beforehand.
1467 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1467 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1468 module_system->Require("guestViewDeny"); 1468 module_system->Require("guestViewDeny");
1469 } 1469 }
1470 } 1470 }
1471 1471
1472 } // namespace extensions 1472 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api/automation/automation_api_helper.cc ('k') | extensions/renderer/dom_activity_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698