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

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

Issue 2488443002: [Extensions] Convert some callers of ScriptContext::CallFunction (Closed)
Patch Set: Created 4 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 | « no previous file | extensions/renderer/guest_view/guest_view_internal_custom_bindings.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 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 // Execute the main function with its dependencies passed in as arguments. 504 // Execute the main function with its dependencies passed in as arguments.
505 v8::Local<v8::Value> args[] = { 505 v8::Local<v8::Value> args[] = {
506 // The extension's background URL. 506 // The extension's background URL.
507 v8_helpers::ToV8StringUnsafe( 507 v8_helpers::ToV8StringUnsafe(
508 isolate, BackgroundInfo::GetBackgroundURL(extension).spec()), 508 isolate, BackgroundInfo::GetBackgroundURL(extension).spec()),
509 // The wake-event-page native function. 509 // The wake-event-page native function.
510 WakeEventPage::Get()->GetForContext(context), 510 WakeEventPage::Get()->GetForContext(context),
511 // The logging module. 511 // The logging module.
512 logging->NewInstance(), 512 logging->NewInstance(),
513 }; 513 };
514 context->CallFunction(main_function, arraysize(args), args); 514 context->SafeCallFunction(main_function, arraysize(args), args);
515 515
516 const base::TimeDelta elapsed = base::TimeTicks::Now() - start_time; 516 const base::TimeDelta elapsed = base::TimeTicks::Now() - start_time;
517 UMA_HISTOGRAM_TIMES( 517 UMA_HISTOGRAM_TIMES(
518 "Extensions.DidInitializeServiceWorkerContextOnWorkerThread", elapsed); 518 "Extensions.DidInitializeServiceWorkerContextOnWorkerThread", elapsed);
519 } 519 }
520 520
521 void Dispatcher::WillReleaseScriptContext( 521 void Dispatcher::WillReleaseScriptContext(
522 blink::WebLocalFrame* frame, 522 blink::WebLocalFrame* frame,
523 const v8::Local<v8::Context>& v8_context, 523 const v8::Local<v8::Context>& v8_context,
524 int world_id) { 524 int world_id) {
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 // The "guestViewDeny" module must always be loaded last. It registers 1649 // The "guestViewDeny" module must always be loaded last. It registers
1650 // error-providing custom elements for the GuestView types that are not 1650 // error-providing custom elements for the GuestView types that are not
1651 // available, and thus all of those types must have been checked and loaded 1651 // available, and thus all of those types must have been checked and loaded
1652 // (or not loaded) beforehand. 1652 // (or not loaded) beforehand.
1653 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1653 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1654 module_system->Require("guestViewDeny"); 1654 module_system->Require("guestViewDeny");
1655 } 1655 }
1656 } 1656 }
1657 1657
1658 } // namespace extensions 1658 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698