Remove redundant WebLocalFrame* parameter from DidCreateScriptContext
Remove redundant WebLocalFrame* parameter from DidCreateScriptContext
in WebFrameClient.
BUG=361765
Review-Url: https://codereview.chromium.org/2854793002
Cr-Commit-Position: refs/heads/master@{#468810}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 59ec8019..c233bc8 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4605,11 +4605,8 @@
observer.DidObserveLoadingBehavior(behavior);
}
-void RenderFrameImpl::DidCreateScriptContext(blink::WebLocalFrame* frame,
- v8::Local<v8::Context> context,
+void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) {
- DCHECK_EQ(frame_, frame);
-
for (auto& observer : observers_)
observer.DidCreateScriptContext(context, world_id);
}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index ba280b28..1b7ec74a 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -634,8 +634,7 @@
void DidChangePerformanceTiming() override;
void DidObserveLoadingBehavior(
blink::WebLoadingBehaviorFlag behavior) override;
- void DidCreateScriptContext(blink::WebLocalFrame* frame,
- v8::Local<v8::Context> context,
+ void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
void WillReleaseScriptContext(v8::Local<v8::Context> context,
int world_id) override;
diff --git a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
index 07cb125..cb67d020 100644
--- a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
+++ b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
@@ -202,7 +202,7 @@
v8::Local<v8::Context> context,
int world_id) {
if (web_frame_->Client())
- web_frame_->Client()->DidCreateScriptContext(web_frame_, context, world_id);
+ web_frame_->Client()->DidCreateScriptContext(context, world_id);
}
void LocalFrameClientImpl::WillReleaseScriptContext(
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 15c9bfd..0a68f37 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -4466,12 +4466,10 @@
Vector<std::unique_ptr<Notification>>& create_notifications_;
Vector<std::unique_ptr<Notification>>& release_notifications_;
- void DidCreateScriptContext(WebLocalFrame* frame,
- v8::Local<v8::Context> context,
+ void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override {
- ASSERT_EQ(Frame(), frame);
create_notifications_.push_back(
- WTF::MakeUnique<Notification>(frame, context, world_id));
+ WTF::MakeUnique<Notification>(Frame(), context, world_id));
}
void WillReleaseScriptContext(v8::Local<v8::Context> context,
@@ -4813,10 +4811,9 @@
class TestExecuteScriptDuringDidCreateScriptContext
: public FrameTestHelpers::TestWebFrameClient {
public:
- void DidCreateScriptContext(WebLocalFrame* frame,
- v8::Local<v8::Context> context,
+ void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override {
- frame->ExecuteScript(WebScriptSource("window.history = 'replaced';"));
+ Frame()->ExecuteScript(WebScriptSource("window.history = 'replaced';"));
}
};
diff --git a/third_party/WebKit/public/web/WebFrameClient.h b/third_party/WebKit/public/web/WebFrameClient.h
index cd405beb..37cae5e 100644
--- a/third_party/WebKit/public/web/WebFrameClient.h
+++ b/third_party/WebKit/public/web/WebFrameClient.h
@@ -609,9 +609,7 @@
// Notifies that a new script context has been created for this frame.
// This is similar to didClearWindowObject but only called once per
// frame context.
- virtual void DidCreateScriptContext(WebLocalFrame*,
- v8::Local<v8::Context>,
- int world_id) {}
+ virtual void DidCreateScriptContext(v8::Local<v8::Context>, int world_id) {}
// WebKit is about to release its reference to a v8 context for a frame.
virtual void WillReleaseScriptContext(v8::Local<v8::Context>, int world_id) {}