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

Unified Diff: content/shell/renderer/layout_test/layout_test_render_frame_observer.cc

Issue 2594913002: Replace IPC messages in layout_test_render_frame_observer. (Closed)
Patch Set: Removed a redundant line Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/renderer/layout_test/layout_test_render_frame_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/layout_test/layout_test_render_frame_observer.cc
diff --git a/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc b/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc
index 4417b57ffa342cc971e3e0c685c4ecbec85b1c95..0f8aaa0c5ec065f038d9565fd6d3840bcd8dccc1 100644
--- a/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc
+++ b/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc
@@ -8,6 +8,7 @@
#include "components/test_runner/web_test_interfaces.h"
#include "components/test_runner/web_test_runner.h"
+#include "content/public/common/associated_interface_registry.h"
#include "content/public/renderer/render_frame.h"
#include "content/shell/common/shell_messages.h"
#include "content/shell/renderer/layout_test/blink_test_runner.h"
@@ -19,36 +20,28 @@ namespace content {
LayoutTestRenderFrameObserver::LayoutTestRenderFrameObserver(
RenderFrame* render_frame)
- : RenderFrameObserver(render_frame) {
+ : RenderFrameObserver(render_frame), binding_(this) {
render_frame->GetWebFrame()->setContentSettingsClient(
LayoutTestRenderThreadObserver::GetInstance()
->test_interfaces()
->TestRunner()
->GetWebContentSettings());
+ render_frame->GetAssociatedInterfaceRegistry()->AddInterface(base::Bind(
+ &LayoutTestRenderFrameObserver::BindRequest, base::Unretained(this)));
}
-bool LayoutTestRenderFrameObserver::OnMessageReceived(
- const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(LayoutTestRenderFrameObserver, message)
- IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpRequest, OnLayoutDumpRequest)
- IPC_MESSAGE_HANDLER(ShellViewMsg_ReplicateTestConfiguration,
- OnReplicateTestConfiguration)
- IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration,
- OnSetTestConfiguration)
- IPC_MESSAGE_HANDLER(ShellViewMsg_SetupSecondaryRenderer,
- OnSetupSecondaryRenderer)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
+LayoutTestRenderFrameObserver::~LayoutTestRenderFrameObserver() = default;
- return handled;
+void LayoutTestRenderFrameObserver::BindRequest(
+ mojom::LayoutTestControlAssociatedRequest request) {
+ binding_.Bind(std::move(request));
}
void LayoutTestRenderFrameObserver::OnDestruct() {
delete this;
}
-void LayoutTestRenderFrameObserver::OnLayoutDumpRequest() {
+void LayoutTestRenderFrameObserver::LayoutDumpRequest() {
std::string dump =
LayoutTestRenderThreadObserver::GetInstance()
->test_interfaces()
@@ -57,19 +50,19 @@ void LayoutTestRenderFrameObserver::OnLayoutDumpRequest() {
Send(new ShellViewHostMsg_LayoutDumpResponse(routing_id(), dump));
}
-void LayoutTestRenderFrameObserver::OnReplicateTestConfiguration(
- const ShellTestConfiguration& test_config) {
+void LayoutTestRenderFrameObserver::ReplicateTestConfiguration(
+ mojom::ShellTestConfigurationPtr config) {
BlinkTestRunner::Get(render_frame()->GetRenderView())
- ->OnReplicateTestConfiguration(test_config);
+ ->OnReplicateTestConfiguration(std::move(config));
}
-void LayoutTestRenderFrameObserver::OnSetTestConfiguration(
- const ShellTestConfiguration& test_config) {
+void LayoutTestRenderFrameObserver::SetTestConfiguration(
+ mojom::ShellTestConfigurationPtr config) {
BlinkTestRunner::Get(render_frame()->GetRenderView())
- ->OnSetTestConfiguration(test_config);
+ ->OnSetTestConfiguration(std::move(config));
}
-void LayoutTestRenderFrameObserver::OnSetupSecondaryRenderer() {
+void LayoutTestRenderFrameObserver::SetupSecondaryRenderer() {
BlinkTestRunner::Get(render_frame()->GetRenderView())
->OnSetupSecondaryRenderer();
}
« no previous file with comments | « content/shell/renderer/layout_test/layout_test_render_frame_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698