Commit 38087a42 authored by dgozman's avatar dgozman Committed by Commit bot

[DevTools] Move Page and Emulation handlers to RenderFrameHostImpl.

BUG=470453

Review URL: https://codereview.chromium.org/1043173003

Cr-Commit-Position: refs/heads/master@{#324228}
parent 3ab32772
......@@ -33,7 +33,7 @@ ColorPicker::ColorPicker(ColorPickedCallback callback)
ColorPicker::~ColorPicker() {
}
void ColorPicker::SetRenderViewHost(RenderViewHostImpl* host) {
void ColorPicker::SetRenderWidgetHost(RenderWidgetHostImpl* host) {
if (host_ == host)
return;
......
......@@ -15,7 +15,7 @@ class WebMouseEvent;
namespace content {
class RenderViewHostImpl;
class RenderWidgetHostImpl;
namespace devtools {
namespace page {
......@@ -27,7 +27,7 @@ class ColorPicker {
explicit ColorPicker(ColorPickedCallback callback);
virtual ~ColorPicker();
void SetRenderViewHost(RenderViewHostImpl* host);
void SetRenderWidgetHost(RenderWidgetHostImpl* host);
void SetEnabled(bool enabled);
void OnSwapCompositorFrame();
......@@ -44,7 +44,7 @@ class ColorPicker {
int last_cursor_x_;
int last_cursor_y_;
RenderWidgetHost::MouseEventCallback mouse_event_callback_;
RenderViewHostImpl* host_;
RenderWidgetHostImpl* host_;
base::WeakPtrFactory<ColorPicker> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ColorPicker);
......
......@@ -5,8 +5,9 @@
#include "content/browser/devtools/protocol/emulation_handler.h"
#include "base/strings/string_number_conversions.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/geolocation/geolocation_service_context.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
#include "content/public/common/url_constants.h"
......@@ -52,7 +53,7 @@ void EmulationHandler::ScreencastEnabledChanged() {
UpdateTouchEventEmulationState();
}
void EmulationHandler::SetRenderViewHost(RenderViewHostImpl* host) {
void EmulationHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
if (host_ == host)
return;
......@@ -70,16 +71,11 @@ void EmulationHandler::Detached() {
Response EmulationHandler::SetGeolocationOverride(
double* latitude, double* longitude, double* accuracy) {
if (!host_)
if (!GetWebContents())
return Response::InternalError("Could not connect to view");
WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
WebContents::FromRenderViewHost(host_));
if (!web_contents)
return Response::InternalError("No WebContents to override");
GeolocationServiceContext* geolocation_context =
web_contents->GetGeolocationServiceContext();
GetWebContents()->GetGeolocationServiceContext();
scoped_ptr<Geoposition> geoposition(new Geoposition());
if (latitude && longitude && accuracy) {
geoposition->latitude = *latitude;
......@@ -97,16 +93,11 @@ Response EmulationHandler::SetGeolocationOverride(
}
Response EmulationHandler::ClearGeolocationOverride() {
if (!host_)
if (!GetWebContents())
return Response::InternalError("Could not connect to view");
WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
WebContents::FromRenderViewHost(host_));
if (!web_contents)
return Response::InternalError("No WebContents to override");
GeolocationServiceContext* geolocation_context =
web_contents->GetGeolocationServiceContext();
GetWebContents()->GetGeolocationServiceContext();
geolocation_context->ClearOverride();
return Response::OK();
}
......@@ -124,18 +115,11 @@ Response EmulationHandler::CanEmulate(bool* result) {
#if defined(OS_ANDROID)
*result = false;
#else
if (host_) {
if (WebContents* web_contents = WebContents::FromRenderViewHost(host_)) {
*result = web_contents->GetMainFrame()->GetRenderViewHost() == host_;
*result = true;
#if defined(DEBUG_DEVTOOLS)
*result &= !web_contents->GetVisibleURL().SchemeIs(kChromeDevToolsScheme);
if (WebContentsImpl* web_contents = GetWebContents())
*result &= !web_contents->GetVisibleURL().SchemeIs(kChromeDevToolsScheme);
#endif // defined(DEBUG_DEVTOOLS)
} else {
*result = true;
}
} else {
*result = true;
}
#endif // defined(OS_ANDROID)
return Response::OK();
}
......@@ -194,28 +178,37 @@ Response EmulationHandler::ClearDeviceMetricsOverride() {
return Response::OK();
}
WebContentsImpl* EmulationHandler::GetWebContents() {
return host_ ?
static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) :
nullptr;
}
void EmulationHandler::UpdateTouchEventEmulationState() {
RenderWidgetHostImpl* widget_host =
host_ ? host_->GetRenderWidgetHost() : nullptr;
if (!host_)
return;
bool enabled = touch_emulation_enabled_ ||
page_handler_->screencast_enabled();
ui::GestureProviderConfigType config_type =
TouchEmulationConfigurationToType(touch_emulation_configuration_);
host_->SetTouchEventEmulationEnabled(enabled, config_type);
WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
WebContents::FromRenderViewHost(host_));
if (web_contents)
web_contents->SetForceDisableOverscrollContent(enabled);
widget_host->SetTouchEventEmulationEnabled(enabled, config_type);
if (GetWebContents())
GetWebContents()->SetForceDisableOverscrollContent(enabled);
}
void EmulationHandler::UpdateDeviceEmulationState() {
RenderWidgetHostImpl* widget_host =
host_ ? host_->GetRenderWidgetHost() : nullptr;
if (!host_)
return;
if (device_emulation_enabled_) {
host_->Send(new ViewMsg_EnableDeviceEmulation(
host_->GetRoutingID(), device_emulation_params_));
widget_host->Send(new ViewMsg_EnableDeviceEmulation(
widget_host->GetRoutingID(), device_emulation_params_));
} else {
host_->Send(new ViewMsg_DisableDeviceEmulation(host_->GetRoutingID()));
widget_host->Send(new ViewMsg_DisableDeviceEmulation(
widget_host->GetRoutingID()));
}
}
......
......@@ -11,7 +11,8 @@
namespace content {
class RenderViewHostImpl;
class RenderFrameHostImpl;
class WebContentsImpl;
namespace devtools {
......@@ -29,7 +30,7 @@ class EmulationHandler : public page::PageHandler::ScreencastListener {
// page::PageHandler::ScreencastListener implementation.
void ScreencastEnabledChanged() override;
void SetRenderViewHost(RenderViewHostImpl* host);
void SetRenderFrameHost(RenderFrameHostImpl* host);
void Detached();
Response SetGeolocationOverride(double* latitude,
......@@ -52,6 +53,7 @@ class EmulationHandler : public page::PageHandler::ScreencastListener {
Response ClearDeviceMetricsOverride();
private:
WebContentsImpl* GetWebContents();
void UpdateTouchEventEmulationState();
void UpdateDeviceEmulationState();
......@@ -62,7 +64,7 @@ class EmulationHandler : public page::PageHandler::ScreencastListener {
blink::WebDeviceEmulationParams device_emulation_params_;
page::PageHandler* page_handler_;
RenderViewHostImpl* host_;
RenderFrameHostImpl* host_;
DISALLOW_COPY_AND_ASSIGN(EmulationHandler);
};
......
......@@ -12,7 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/threading/worker_pool.h"
#include "content/browser/devtools/protocol/color_picker.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
......@@ -20,6 +20,8 @@
#include "content/public/browser/javascript_dialog_manager.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/referrer.h"
......@@ -106,12 +108,29 @@ PageHandler::PageHandler()
PageHandler::~PageHandler() {
}
void PageHandler::SetRenderViewHost(RenderViewHostImpl* host) {
void PageHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
if (host_ == host)
return;
color_picker_->SetRenderViewHost(host);
RenderWidgetHostImpl* widget_host =
host_ ? host_->GetRenderWidgetHost() : nullptr;
if (widget_host) {
registrar_.Remove(
this,
content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
content::Source<RenderWidgetHost>(widget_host));
}
host_ = host;
widget_host = host_ ? host_->GetRenderWidgetHost() : nullptr;
color_picker_->SetRenderWidgetHost(widget_host);
if (widget_host) {
registrar_.Add(
this,
content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
content::Source<RenderWidgetHost>(widget_host));
}
}
void PageHandler::SetClient(scoped_ptr<Client> client) {
......@@ -134,9 +153,13 @@ void PageHandler::OnSwapCompositorFrame(
color_picker_->OnSwapCompositorFrame();
}
void PageHandler::OnVisibilityChanged(bool visible) {
void PageHandler::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
if (!screencast_enabled_)
return;
DCHECK(type == content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED);
bool visible = *Details<bool>(details).ptr();
NotifyScreencastVisibility(visible);
}
......@@ -173,12 +196,9 @@ Response PageHandler::Disable() {
Response PageHandler::Reload(const bool* ignoreCache,
const std::string* script_to_evaluate_on_load,
const std::string* script_preprocessor) {
if (!host_)
return Response::InternalError("Could not connect to view");
WebContents* web_contents = WebContents::FromRenderViewHost(host_);
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
return Response::InternalError("No WebContents to reload");
return Response::InternalError("Could not connect to view");
// Handle in browser only if it is crashed.
if (!web_contents->IsCrashed())
......@@ -194,12 +214,9 @@ Response PageHandler::Navigate(const std::string& url,
if (!gurl.is_valid())
return Response::InternalError("Cannot navigate to invalid URL");
if (!host_)
return Response::InternalError("Could not connect to view");
WebContents* web_contents = WebContents::FromRenderViewHost(host_);
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
return Response::InternalError("No WebContents to navigate");
return Response::InternalError("Could not connect to view");
web_contents->GetController()
.LoadURL(gurl, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
......@@ -208,12 +225,9 @@ Response PageHandler::Navigate(const std::string& url,
Response PageHandler::GetNavigationHistory(int* current_index,
NavigationEntries* entries) {
if (!host_)
return Response::InternalError("Could not connect to view");
WebContents* web_contents = WebContents::FromRenderViewHost(host_);
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
return Response::InternalError("No WebContents to navigate");
return Response::InternalError("Could not connect to view");
NavigationController& controller = web_contents->GetController();
*current_index = controller.GetCurrentEntryIndex();
......@@ -228,12 +242,9 @@ Response PageHandler::GetNavigationHistory(int* current_index,
}
Response PageHandler::NavigateToHistoryEntry(int entry_id) {
if (!host_)
return Response::InternalError("Could not connect to view");
WebContents* web_contents = WebContents::FromRenderViewHost(host_);
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
return Response::InternalError("No WebContents to navigate");
return Response::InternalError("Could not connect to view");
NavigationController& controller = web_contents->GetController();
for (int i = 0; i != controller.GetEntryCount(); ++i) {
......@@ -247,10 +258,10 @@ Response PageHandler::NavigateToHistoryEntry(int entry_id) {
}
Response PageHandler::CaptureScreenshot(DevToolsCommandId command_id) {
if (!host_ || !host_->GetView())
if (!host_ || !host_->GetRenderWidgetHost())
return Response::InternalError("Could not connect to view");
host_->GetSnapshotFromBrowser(
host_->GetRenderWidgetHost()->GetSnapshotFromBrowser(
base::Bind(&PageHandler::ScreenshotCaptured,
weak_factory_.GetWeakPtr(), command_id));
return Response::OK();
......@@ -269,7 +280,9 @@ Response PageHandler::StartScreencast(const std::string* format,
const int* quality,
const int* max_width,
const int* max_height) {
if (!host_)
RenderWidgetHostImpl* widget_host =
host_ ? host_->GetRenderWidgetHost() : nullptr;
if (!widget_host)
return Response::InternalError("Could not connect to view");
screencast_enabled_ = true;
......@@ -280,13 +293,15 @@ Response PageHandler::StartScreencast(const std::string* format,
screencast_max_width_ = max_width ? *max_width : -1;
screencast_max_height_ = max_height ? *max_height : -1;
bool visible = !host_->is_hidden();
bool visible = !widget_host->is_hidden();
NotifyScreencastVisibility(visible);
if (visible) {
if (has_compositor_frame_metadata_)
if (has_compositor_frame_metadata_) {
InnerSwapCompositorFrame();
else
host_->Send(new ViewMsg_ForceRedraw(host_->GetRoutingID(), 0));
} else {
widget_host->Send(
new ViewMsg_ForceRedraw(widget_host->GetRoutingID(), 0));
}
}
if (screencast_listener_)
screencast_listener_->ScreencastEnabledChanged();
......@@ -311,12 +326,9 @@ Response PageHandler::HandleJavaScriptDialog(bool accept,
if (prompt_text)
prompt_override = base::UTF8ToUTF16(*prompt_text);
if (!host_)
return Response::InternalError("Could not connect to view");
WebContents* web_contents = WebContents::FromRenderViewHost(host_);
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
return Response::InternalError("No JavaScript dialog to handle");
return Response::InternalError("Could not connect to view");
JavaScriptDialogManager* manager =
web_contents->GetDelegate()->GetJavaScriptDialogManager(web_contents);
......@@ -341,6 +353,12 @@ Response PageHandler::SetColorPickerEnabled(bool enabled) {
return Response::OK();
}
WebContentsImpl* PageHandler::GetWebContents() {
return host_ ?
static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(host_)) :
nullptr;
}
void PageHandler::NotifyScreencastVisibility(bool visible) {
if (visible)
capture_retry_count_ = kCaptureRetryLimit;
......
......@@ -11,20 +11,23 @@
#include "base/time/time.h"
#include "cc/output/compositor_frame_metadata.h"
#include "content/browser/devtools/protocol/devtools_protocol_handler.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/readback_types.h"
class SkBitmap;
namespace content {
class RenderViewHostImpl;
class RenderFrameHostImpl;
class WebContentsImpl;
namespace devtools {
namespace page {
class ColorPicker;
class PageHandler {
class PageHandler : public NotificationObserver {
public:
typedef DevToolsProtocolClient::Response Response;
......@@ -35,13 +38,12 @@ class PageHandler {
};
PageHandler();
virtual ~PageHandler();
~PageHandler() override;
void SetRenderViewHost(RenderViewHostImpl* host);
void SetRenderFrameHost(RenderFrameHostImpl* host);
void SetClient(scoped_ptr<Client> client);
void Detached();
void OnSwapCompositorFrame(const cc::CompositorFrameMetadata& frame_metadata);
void OnVisibilityChanged(bool visible);
void DidAttachInterstitialPage();
void DidDetachInterstitialPage();
void SetScreencastListener(ScreencastListener* listener);
......@@ -80,6 +82,7 @@ class PageHandler {
Response SetColorPickerEnabled(bool enabled);
private:
WebContentsImpl* GetWebContents();
void NotifyScreencastVisibility(bool visible);
void InnerSwapCompositorFrame();
void ScreencastFrameCaptured(const cc::CompositorFrameMetadata& metadata,
......@@ -96,6 +99,11 @@ class PageHandler {
void OnColorPicked(int r, int g, int b, int a);
// NotificationObserver overrides.
void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) override;
bool enabled_;
bool screencast_enabled_;
......@@ -113,9 +121,10 @@ class PageHandler {
scoped_ptr<ColorPicker> color_picker_;
RenderViewHostImpl* host_;
RenderFrameHostImpl* host_;
scoped_ptr<Client> client_;
ScreencastListener* screencast_listener_;
NotificationRegistrar registrar_;
base::WeakPtrFactory<PageHandler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PageHandler);
......
......@@ -28,8 +28,6 @@
#include "content/common/view_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/web_contents_delegate.h"
......@@ -141,26 +139,32 @@ RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost(RenderFrameHost* rfh)
input_handler_(new devtools::input::InputHandler()),
inspector_handler_(new devtools::inspector::InspectorHandler()),
network_handler_(new devtools::network::NetworkHandler()),
page_handler_(new devtools::page::PageHandler()),
page_handler_(nullptr),
power_handler_(new devtools::power::PowerHandler()),
service_worker_handler_(
new devtools::service_worker::ServiceWorkerHandler()),
tracing_handler_(new devtools::tracing::TracingHandler(
devtools::tracing::TracingHandler::Renderer)),
emulation_handler_(new devtools::emulation::EmulationHandler(
page_handler_.get())),
emulation_handler_(nullptr),
frame_trace_recorder_(new DevToolsFrameTraceRecorder()),
reattaching_(false) {
DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher();
dispatcher->SetDOMHandler(dom_handler_.get());
dispatcher->SetEmulationHandler(emulation_handler_.get());
dispatcher->SetInputHandler(input_handler_.get());
dispatcher->SetInspectorHandler(inspector_handler_.get());
dispatcher->SetNetworkHandler(network_handler_.get());
dispatcher->SetPageHandler(page_handler_.get());
dispatcher->SetPowerHandler(power_handler_.get());
dispatcher->SetServiceWorkerHandler(service_worker_handler_.get());
dispatcher->SetTracingHandler(tracing_handler_.get());
if (!rfh->GetParent()) {
page_handler_.reset(new devtools::page::PageHandler());
emulation_handler_.reset(
new devtools::emulation::EmulationHandler(page_handler_.get()));
dispatcher->SetPageHandler(page_handler_.get());
dispatcher->SetEmulationHandler(emulation_handler_.get());
}
SetRenderFrameHost(rfh);
g_instances.Get().push_back(this);
AddRef(); // Balanced in RenderFrameHostDestroyed.
......@@ -217,8 +221,10 @@ void RenderFrameDevToolsAgentHost::OnClientDetached() {
#if defined(OS_ANDROID)
power_save_blocker_.reset();
#endif
emulation_handler_->Detached();
page_handler_->Detached();
if (emulation_handler_)
emulation_handler_->Detached();
if (page_handler_)
page_handler_->Detached();
power_handler_->Detached();
service_worker_handler_->Detached();
tracing_handler_->Detached();
......@@ -365,7 +371,8 @@ bool RenderFrameDevToolsAgentHost::OnMessageReceived(
}
void RenderFrameDevToolsAgentHost::DidAttachInterstitialPage() {
page_handler_->DidAttachInterstitialPage();
if (page_handler_)
page_handler_->DidAttachInterstitialPage();
if (!render_frame_host_)
return;
......@@ -380,7 +387,8 @@ void RenderFrameDevToolsAgentHost::DidAttachInterstitialPage() {
}
void RenderFrameDevToolsAgentHost::DidDetachInterstitialPage() {
page_handler_->DidDetachInterstitialPage();
if (page_handler_)
page_handler_->DidDetachInterstitialPage();
}
void RenderFrameDevToolsAgentHost::TitleWasSet(
......@@ -400,15 +408,6 @@ void RenderFrameDevToolsAgentHost::DidCommitProvisionalLoadForFrame(
service_worker_handler_->UpdateHosts();
}
void RenderFrameDevToolsAgentHost::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
if (type == content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED) {
bool visible = *Details<bool>(details).ptr();
page_handler_->OnVisibilityChanged(visible);
}
}
void RenderFrameDevToolsAgentHost::SetRenderFrameHost(RenderFrameHost* rfh) {
DCHECK(ShouldCreateDevToolsFor(rfh));
DCHECK(!render_frame_host_);
......@@ -418,32 +417,26 @@ void RenderFrameDevToolsAgentHost::SetRenderFrameHost(RenderFrameHost* rfh) {
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
rfh->GetRenderViewHost());
dom_handler_->SetRenderFrameHost(render_frame_host_);
emulation_handler_->SetRenderViewHost(rvh);
input_handler_->SetRenderViewHost(rvh);
network_handler_->SetRenderFrameHost(render_frame_host_);
page_handler_->SetRenderViewHost(rvh);
service_worker_handler_->SetRenderFrameHost(render_frame_host_);
registrar_.Add(
this,
content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
content::Source<RenderWidgetHost>(rvh));
if (emulation_handler_)
emulation_handler_->SetRenderFrameHost(render_frame_host_);
if (page_handler_)
page_handler_->SetRenderFrameHost(render_frame_host_);
}
void RenderFrameDevToolsAgentHost::ClearRenderFrameHost() {
DCHECK(render_frame_host_);
RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
render_frame_host_->GetRenderViewHost());
registrar_.Remove(
this,
content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
content::Source<RenderWidgetHost>(rvh));
render_frame_host_ = nullptr;
dom_handler_->SetRenderFrameHost(nullptr);
emulation_handler_->SetRenderViewHost(nullptr);
if (emulation_handler_)
emulation_handler_->SetRenderFrameHost(nullptr);
input_handler_->SetRenderViewHost(nullptr);
network_handler_->SetRenderFrameHost(nullptr);
page_handler_->SetRenderViewHost(nullptr);
if (page_handler_)
page_handler_->SetRenderFrameHost(nullptr);
service_worker_handler_->SetRenderFrameHost(nullptr);
}
......@@ -512,7 +505,8 @@ void RenderFrameDevToolsAgentHost::OnSwapCompositorFrame(
ViewHostMsg_SwapCompositorFrame::Param param;
if (!ViewHostMsg_SwapCompositorFrame::Read(&message, &param))
return;
page_handler_->OnSwapCompositorFrame(get<1>(param).metadata);
if (page_handler_)
page_handler_->OnSwapCompositorFrame(get<1>(param).metadata);
frame_trace_recorder_->OnSwapCompositorFrame(
render_frame_host_, get<1>(param).metadata);
}
......@@ -521,7 +515,8 @@ void RenderFrameDevToolsAgentHost::SynchronousSwapCompositorFrame(
const cc::CompositorFrameMetadata& frame_metadata) {
if (!render_frame_host_)
return;
page_handler_->OnSwapCompositorFrame(frame_metadata);
if (page_handler_)
page_handler_->OnSwapCompositorFrame(frame_metadata);
frame_trace_recorder_->OnSwapCompositorFrame(
render_frame_host_, frame_metadata);
}
......
......@@ -12,8 +12,6 @@
#include "base/memory/scoped_ptr.h"
#include "content/browser/devtools/ipc_devtools_agent_host.h"
#include "content/common/content_export.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
namespace cc {
......@@ -45,8 +43,7 @@ namespace tracing { class TracingHandler; }
class CONTENT_EXPORT RenderFrameDevToolsAgentHost
: public IPCDevToolsAgentHost,
private WebContentsObserver,
public NotificationObserver {
private WebContentsObserver {
public:
static void AddAllAgentHosts(DevToolsAgentHost::List* result);
......@@ -104,11 +101,6 @@ class CONTENT_EXPORT RenderFrameDevToolsAgentHost
const GURL& url,
ui::PageTransition transition_type) override;
// NotificationObserver overrides:
void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) override;
void DisconnectRenderFrameHost();
void ConnectRenderFrameHost(RenderFrameHost* rvh);
void ReattachToRenderFrameHost(RenderFrameHost* rvh);
......@@ -145,7 +137,6 @@ class CONTENT_EXPORT RenderFrameDevToolsAgentHost
#if defined(OS_ANDROID)
scoped_ptr<PowerSaveBlockerImpl> power_save_blocker_;
#endif
NotificationRegistrar registrar_;
bool reattaching_;
DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost);
......
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