Commit 22e26ade authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

Use ClassicScript in WebLocalFrameImpl::ExecuteScript()

This CL doesn't change the behavior.

Bug: 1111134
Change-Id: I35fabb6b626d8763b37ce71e6bd01505cf5b74ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2331417
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarDominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794558}
parent f8a4aa42
......@@ -233,6 +233,7 @@
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/paint/paint_timing.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/core/scroll/scroll_types.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/core/timing/dom_window_performance.h"
......@@ -778,9 +779,7 @@ void WebLocalFrameImpl::SetIsAdSubframe(
void WebLocalFrameImpl::ExecuteScript(const WebScriptSource& source) {
DCHECK(GetFrame());
v8::HandleScope handle_scope(ToIsolate(GetFrame()));
GetFrame()->GetScriptController().ExecuteScriptInMainWorld(
source, KURL(), SanitizeScriptErrors::kSanitize);
ClassicScript::CreateUnspecifiedScript(source)->RunScript(GetFrame());
}
void WebLocalFrameImpl::ExecuteScriptInIsolatedWorld(
......@@ -793,8 +792,9 @@ void WebLocalFrameImpl::ExecuteScriptInIsolatedWorld(
// Note: An error event in an isolated world will never be dispatched to
// a foreign world.
v8::HandleScope handle_scope(ToIsolate(GetFrame()));
GetFrame()->GetScriptController().ExecuteScriptInIsolatedWorld(
world_id, source_in, KURL(), SanitizeScriptErrors::kDoNotSanitize);
ClassicScript::CreateUnspecifiedScript(source_in,
SanitizeScriptErrors::kDoNotSanitize)
->RunScriptInIsolatedWorldAndReturnValue(GetFrame(), world_id);
}
v8::Local<v8::Value>
......@@ -807,8 +807,9 @@ WebLocalFrameImpl::ExecuteScriptInIsolatedWorldAndReturnValue(
// Note: An error event in an isolated world will never be dispatched to
// a foreign world.
return GetFrame()->GetScriptController().ExecuteScriptInIsolatedWorld(
world_id, source_in, KURL(), SanitizeScriptErrors::kDoNotSanitize);
return ClassicScript::CreateUnspecifiedScript(
source_in, SanitizeScriptErrors::kDoNotSanitize)
->RunScriptInIsolatedWorldAndReturnValue(GetFrame(), world_id);
}
void WebLocalFrameImpl::ClearIsolatedWorldCSPForTesting(int32_t world_id) {
......@@ -855,11 +856,8 @@ void WebLocalFrameImpl::CollectGarbageForTesting() {
v8::Local<v8::Value> WebLocalFrameImpl::ExecuteScriptAndReturnValue(
const WebScriptSource& source) {
DCHECK(GetFrame());
return GetFrame()
->GetScriptController()
.ExecuteScriptInMainWorldAndReturnValue(source, KURL(),
SanitizeScriptErrors::kSanitize);
return ClassicScript::CreateUnspecifiedScript(source)
->RunScriptAndReturnValue(GetFrame());
}
void WebLocalFrameImpl::RequestExecuteScriptAndReturnValue(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment