OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
6 | 6 |
7 #include <tuple> | 7 #include <tuple> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 void RenderFrameDevToolsAgentHost::OnSwapCompositorFrame( | 1088 void RenderFrameDevToolsAgentHost::OnSwapCompositorFrame( |
1089 const IPC::Message& message) { | 1089 const IPC::Message& message) { |
1090 ViewHostMsg_SwapCompositorFrame::Param param; | 1090 ViewHostMsg_SwapCompositorFrame::Param param; |
1091 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) | 1091 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) |
1092 return; | 1092 return; |
1093 if (!session()) | 1093 if (!session()) |
1094 return; | 1094 return; |
1095 protocol::PageHandler* page_handler = | 1095 protocol::PageHandler* page_handler = |
1096 protocol::PageHandler::FromSession(session()); | 1096 protocol::PageHandler::FromSession(session()); |
1097 if (page_handler) { | 1097 if (page_handler) { |
1098 page_handler->OnSwapCompositorFrame( | 1098 page_handler->OnSwapCompositorFrame(std::move(std::get<2>(param).metadata)); |
1099 std::move(std::get<1>(param).metadata)); | |
1100 } | 1099 } |
1101 protocol::InputHandler::FromSession(session()) | 1100 protocol::InputHandler::FromSession(session())->OnSwapCompositorFrame( |
1102 ->OnSwapCompositorFrame(std::get<1>(param).metadata); | 1101 std::get<2>(param).metadata); |
1103 protocol::TracingHandler* tracing_handler = | 1102 protocol::TracingHandler* tracing_handler = |
1104 protocol::TracingHandler::FromSession(session()); | 1103 protocol::TracingHandler::FromSession(session()); |
1105 if (frame_trace_recorder_ && tracing_handler->did_initiate_recording()) { | 1104 if (frame_trace_recorder_ && tracing_handler->did_initiate_recording()) { |
1106 frame_trace_recorder_->OnSwapCompositorFrame( | 1105 frame_trace_recorder_->OnSwapCompositorFrame( |
1107 current_ ? current_->host() : nullptr, std::get<1>(param).metadata); | 1106 current_ ? current_->host() : nullptr, std::get<2>(param).metadata); |
1108 } | 1107 } |
1109 } | 1108 } |
1110 | 1109 |
1111 void RenderFrameDevToolsAgentHost::SignalSynchronousSwapCompositorFrame( | 1110 void RenderFrameDevToolsAgentHost::SignalSynchronousSwapCompositorFrame( |
1112 RenderFrameHost* frame_host, | 1111 RenderFrameHost* frame_host, |
1113 cc::CompositorFrameMetadata frame_metadata) { | 1112 cc::CompositorFrameMetadata frame_metadata) { |
1114 scoped_refptr<RenderFrameDevToolsAgentHost> dtah(FindAgentHost(frame_host)); | 1113 scoped_refptr<RenderFrameDevToolsAgentHost> dtah(FindAgentHost(frame_host)); |
1115 if (dtah) { | 1114 if (dtah) { |
1116 // Unblock the compositor. | 1115 // Unblock the compositor. |
1117 BrowserThread::PostTask( | 1116 BrowserThread::PostTask( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 RenderFrameHost* host) { | 1177 RenderFrameHost* host) { |
1179 return (current_ && current_->host() == host) || | 1178 return (current_ && current_->host() == host) || |
1180 (pending_ && pending_->host() == host); | 1179 (pending_ && pending_->host() == host); |
1181 } | 1180 } |
1182 | 1181 |
1183 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1182 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
1184 return current_ && current_->host()->GetParent(); | 1183 return current_ && current_->host()->GetParent(); |
1185 } | 1184 } |
1186 | 1185 |
1187 } // namespace content | 1186 } // namespace content |
OLD | NEW |