 Chromium Code Reviews
 Chromium Code Reviews Issue 2484793002:
  Remove access to WebContents in RWHVA::SynchronousFrameMetadata()  (Closed)
    
  
    Issue 2484793002:
  Remove access to WebContents in RWHVA::SynchronousFrameMetadata()  (Closed) 
  | 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/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 
| 6 | 6 | 
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> | 
| 8 | 8 | 
| 9 #include <utility> | 9 #include <utility> | 
| 10 | 10 | 
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1184 if (host_ && host_->input_router()) { | 1184 if (host_ && host_->input_router()) { | 
| 1185 host_->input_router()->NotifySiteIsMobileOptimized( | 1185 host_->input_router()->NotifySiteIsMobileOptimized( | 
| 1186 is_mobile_optimized); | 1186 is_mobile_optimized); | 
| 1187 } | 1187 } | 
| 1188 | 1188 | 
| 1189 // This is a subset of OnSwapCompositorFrame() used in the synchronous | 1189 // This is a subset of OnSwapCompositorFrame() used in the synchronous | 
| 1190 // compositor flow. | 1190 // compositor flow. | 
| 1191 OnFrameMetadataUpdated(frame_metadata.Clone(), false); | 1191 OnFrameMetadataUpdated(frame_metadata.Clone(), false); | 
| 1192 | 1192 | 
| 1193 // DevTools ScreenCast support for Android WebView. | 1193 // DevTools ScreenCast support for Android WebView. | 
| 1194 WebContents* web_contents = content_view_core_->GetWebContents(); | 1194 RenderFrameHost* frame_host = RenderViewHost::From(host_)->GetMainFrame(); | 
| 
dgozman
2016/11/08 18:41:08
What about making RFDTAH::SynchronousSwapComposito
 
Jinsuk Kim
2016/11/08 22:21:12
If I get it right, I need to pass |content_view_co
 
dgozman
2016/11/08 22:47:29
I suggest to add
RenderFrameDevToolsAgentHost::Syn
 
Jinsuk Kim
2016/11/08 23:27:47
Now I got it. Thanks! Done.
I named the static me
 | |
| 1195 if (DevToolsAgentHost::HasFor(web_contents)) { | 1195 if (frame_host && RenderFrameDevToolsAgentHost::HasFor(frame_host)) { | 
| 1196 scoped_refptr<DevToolsAgentHost> dtah = | 1196 scoped_refptr<DevToolsAgentHost> dtah = | 
| 1197 DevToolsAgentHost::GetOrCreateFor(web_contents); | 1197 DevToolsAgentHost::GetOrCreateFor(frame_host); | 
| 1198 // Unblock the compositor. | 1198 // Unblock the compositor. | 
| 1199 BrowserThread::PostTask( | 1199 BrowserThread::PostTask( | 
| 1200 BrowserThread::UI, FROM_HERE, | 1200 BrowserThread::UI, FROM_HERE, | 
| 1201 base::Bind( | 1201 base::Bind( | 
| 1202 &RenderFrameDevToolsAgentHost::SynchronousSwapCompositorFrame, | 1202 &RenderFrameDevToolsAgentHost::SynchronousSwapCompositorFrame, | 
| 1203 static_cast<RenderFrameDevToolsAgentHost*>(dtah.get()), | 1203 static_cast<RenderFrameDevToolsAgentHost*>(dtah.get()), | 
| 1204 base::Passed(&frame_metadata))); | 1204 base::Passed(&frame_metadata))); | 
| 1205 } | 1205 } | 
| 1206 } | 1206 } | 
| 1207 | 1207 | 
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1966 case ui::MotionEvent::ACTION_UP: | 1966 case ui::MotionEvent::ACTION_UP: | 
| 1967 case ui::MotionEvent::ACTION_POINTER_UP: | 1967 case ui::MotionEvent::ACTION_POINTER_UP: | 
| 1968 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1968 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 
| 1969 delta.InMicroseconds(), 1, 1000000, 50); | 1969 delta.InMicroseconds(), 1, 1000000, 50); | 
| 1970 default: | 1970 default: | 
| 1971 return; | 1971 return; | 
| 1972 } | 1972 } | 
| 1973 } | 1973 } | 
| 1974 | 1974 | 
| 1975 } // namespace content | 1975 } // namespace content | 
| OLD | NEW |