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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 2723973002: Make V8Binding helpers return LocalFrame/LocalDOMWindow as appropriate (Closed)
Patch Set: . Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 return v8::MaybeLocal<v8::Value>( 637 return v8::MaybeLocal<v8::Value>(
638 throwStackOverflowExceptionIfNeeded(isolate)); 638 throwStackOverflowExceptionIfNeeded(isolate));
639 639
640 RELEASE_ASSERT(!context->isIteratingOverObservers()); 640 RELEASE_ASSERT(!context->isIteratingOverObservers());
641 641
642 if (ScriptForbiddenScope::isScriptForbidden()) { 642 if (ScriptForbiddenScope::isScriptForbidden()) {
643 throwScriptForbiddenException(isolate); 643 throwScriptForbiddenException(isolate);
644 return v8::MaybeLocal<v8::Value>(); 644 return v8::MaybeLocal<v8::Value>();
645 } 645 }
646 646
647 DCHECK(!frame || 647 DCHECK(!frame || BindingSecurity::shouldAllowAccessToFrame(
648 BindingSecurity::shouldAllowAccessToFrame( 648 toLocalDOMWindow(function->CreationContext()), frame,
649 toDOMWindow(function->CreationContext())->toLocalDOMWindow(), 649 BindingSecurity::ErrorReportOption::DoNotReport));
650 frame, BindingSecurity::ErrorReportOption::DoNotReport));
651 CHECK(!ThreadState::current()->isWrapperTracingForbidden()); 650 CHECK(!ThreadState::current()->isWrapperTracingForbidden());
652 v8::MicrotasksScope microtasksScope(isolate, 651 v8::MicrotasksScope microtasksScope(isolate,
653 v8::MicrotasksScope::kRunMicrotasks); 652 v8::MicrotasksScope::kRunMicrotasks);
654 probe::CallFunction probe(context, function, depth); 653 probe::CallFunction probe(context, function, depth);
655 ThreadDebugger::willExecuteScript(isolate, function->ScriptId()); 654 ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
656 v8::MaybeLocal<v8::Value> result = 655 v8::MaybeLocal<v8::Value> result =
657 function->Call(isolate->GetCurrentContext(), receiver, argc, args); 656 function->Call(isolate->GetCurrentContext(), receiver, argc, args);
658 CHECK(!isolate->IsDead()); 657 CHECK(!isolate->IsDead());
659 ThreadDebugger::didExecuteScript(isolate); 658 ThreadDebugger::didExecuteScript(isolate);
660 659
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 v8AtomicString(isolate, "((e) => { throw e; })"), origin) 724 v8AtomicString(isolate, "((e) => { throw e; })"), origin)
726 .ToLocalChecked(); 725 .ToLocalChecked();
727 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script) 726 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script)
728 .ToLocalChecked() 727 .ToLocalChecked()
729 .As<v8::Function>(); 728 .As<v8::Function>();
730 v8::Local<v8::Value> args[] = {exception}; 729 v8::Local<v8::Value> args[] = {exception};
731 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); 730 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate);
732 } 731 }
733 732
734 } // namespace blink 733 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698