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

Side by Side Diff: content/browser/devtools/render_frame_devtools_agent_host.cc

Issue 2484793002: Remove access to WebContents in RWHVA::SynchronousFrameMetadata() (Closed)
Patch Set: comments Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 page_handler_->OnSwapCompositorFrame( 1045 page_handler_->OnSwapCompositorFrame(
1046 std::move(std::get<1>(param).metadata)); 1046 std::move(std::get<1>(param).metadata));
1047 if (input_handler_) 1047 if (input_handler_)
1048 input_handler_->OnSwapCompositorFrame(std::get<1>(param).metadata); 1048 input_handler_->OnSwapCompositorFrame(std::get<1>(param).metadata);
1049 if (frame_trace_recorder_ && tracing_handler_->did_initiate_recording()) { 1049 if (frame_trace_recorder_ && tracing_handler_->did_initiate_recording()) {
1050 frame_trace_recorder_->OnSwapCompositorFrame( 1050 frame_trace_recorder_->OnSwapCompositorFrame(
1051 current_ ? current_->host() : nullptr, std::get<1>(param).metadata); 1051 current_ ? current_->host() : nullptr, std::get<1>(param).metadata);
1052 } 1052 }
1053 } 1053 }
1054 1054
1055 void RenderFrameDevToolsAgentHost::SignalSynchronousSwapCompositorFrame(
1056 RenderFrameHost* frame_host,
1057 cc::CompositorFrameMetadata frame_metadata) {
1058 scoped_refptr<RenderFrameDevToolsAgentHost> dtah(FindAgentHost(frame_host));
1059 if (dtah) {
1060 // Unblock the compositor.
1061 BrowserThread::PostTask(
1062 BrowserThread::UI, FROM_HERE,
1063 base::Bind(
1064 &RenderFrameDevToolsAgentHost::SynchronousSwapCompositorFrame,
1065 dtah.get(),
1066 base::Passed(std::move(frame_metadata))));
1067 }
1068 }
1069
1055 void RenderFrameDevToolsAgentHost::SynchronousSwapCompositorFrame( 1070 void RenderFrameDevToolsAgentHost::SynchronousSwapCompositorFrame(
1056 cc::CompositorFrameMetadata frame_metadata) { 1071 cc::CompositorFrameMetadata frame_metadata) {
1057 if (page_handler_) 1072 if (page_handler_)
1058 page_handler_->OnSynchronousSwapCompositorFrame(std::move(frame_metadata)); 1073 page_handler_->OnSynchronousSwapCompositorFrame(std::move(frame_metadata));
1059 if (input_handler_) 1074 if (input_handler_)
1060 input_handler_->OnSwapCompositorFrame(frame_metadata); 1075 input_handler_->OnSwapCompositorFrame(frame_metadata);
1061 if (frame_trace_recorder_ && tracing_handler_->did_initiate_recording()) { 1076 if (frame_trace_recorder_ && tracing_handler_->did_initiate_recording()) {
1062 frame_trace_recorder_->OnSynchronousSwapCompositorFrame( 1077 frame_trace_recorder_->OnSynchronousSwapCompositorFrame(
1063 current_ ? current_->host() : nullptr, 1078 current_ ? current_->host() : nullptr,
1064 frame_metadata); 1079 frame_metadata);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 RenderFrameHost* host) { 1116 RenderFrameHost* host) {
1102 return (current_ && current_->host() == host) || 1117 return (current_ && current_->host() == host) ||
1103 (pending_ && pending_->host() == host); 1118 (pending_ && pending_->host() == host);
1104 } 1119 }
1105 1120
1106 bool RenderFrameDevToolsAgentHost::IsChildFrame() { 1121 bool RenderFrameDevToolsAgentHost::IsChildFrame() {
1107 return current_ && current_->host()->GetParent(); 1122 return current_ && current_->host()->GetParent();
1108 } 1123 }
1109 1124
1110 } // namespace content 1125 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698