| Index: content/browser/devtools/protocol/emulation_handler.h
|
| diff --git a/content/browser/devtools/protocol/emulation_handler.h b/content/browser/devtools/protocol/emulation_handler.h
|
| index 8a98ce65c80e2be5374eb8cf55b843544b5b884e..5115f86848a4c5e04e677b7632d2f500729418a2 100644
|
| --- a/content/browser/devtools/protocol/emulation_handler.h
|
| +++ b/content/browser/devtools/protocol/emulation_handler.h
|
| @@ -6,6 +6,8 @@
|
| #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
|
|
|
| #include "base/macros.h"
|
| +#include "cc/scheduler/begin_frame_source.h"
|
| +#include "cc/surfaces/frame_sink_id.h"
|
| #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
|
| #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
|
|
|
| @@ -20,7 +22,9 @@ namespace page { class PageHandler; }
|
|
|
| namespace emulation {
|
|
|
| -class EmulationHandler {
|
| +class EmulatedBeginFrameSource;
|
| +
|
| +class EmulationHandler : public cc::ExternalBeginFrameSourceClient {
|
| public:
|
| using Response = DevToolsProtocolClient::Response;
|
|
|
| @@ -28,7 +32,7 @@ class EmulationHandler {
|
| ~EmulationHandler();
|
|
|
| void SetRenderFrameHost(RenderFrameHostImpl* host);
|
| - void SetClient(std::unique_ptr<Client> client) { }
|
| + void SetClient(std::unique_ptr<Client> client);
|
| void Detached();
|
|
|
| Response SetGeolocationOverride(double* latitude,
|
| @@ -67,7 +71,22 @@ class EmulationHandler {
|
| Response SetCPUThrottlingRate(double rate);
|
| Response SetVirtualTimePolicy(const std::string& policy, const int* budget);
|
|
|
| + Response EnableBeginFrameControl();
|
| + Response DisableBeginFrameControl();
|
| + Response SendBeginFrame(double interval,
|
| + const double* frame_time,
|
| + const double* deadline,
|
| + std::string* out_frame_id);
|
| +
|
| + void IssueBeginFrameOnSource(const cc::BeginFrameArgs& args);
|
| +
|
| + // cc::ExternalBeginFrameSourceClient implementation:
|
| + void OnNeedsBeginFrames(bool needs_begin_frames) override;
|
| +
|
| private:
|
| + void ClientSetNeedsBeginFrame(bool needs_begin_frame);
|
| + void ClientFrameCommitted(const std::string& frame_id);
|
| +
|
| WebContentsImpl* GetWebContents();
|
| void UpdateTouchEventEmulationState();
|
| void UpdateDeviceEmulationState();
|
| @@ -78,7 +97,13 @@ class EmulationHandler {
|
| bool device_emulation_enabled_;
|
| blink::WebDeviceEmulationParams device_emulation_params_;
|
|
|
| + EmulatedBeginFrameSource* begin_frame_source_; // Not owned.
|
| + std::unique_ptr<cc::BeginFrameSource> original_begin_frame_source_;
|
| + bool needs_begin_frame_;
|
| +
|
| RenderFrameHostImpl* host_;
|
| + std::unique_ptr<Client> client_;
|
| + base::WeakPtrFactory<EmulationHandler> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(EmulationHandler);
|
| };
|
|
|