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 "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1109 last_frame_info_.reset(new LastFrameInfo(output_surface_id, frame.Pass())); | 1109 last_frame_info_.reset(new LastFrameInfo(output_surface_id, frame.Pass())); |
1110 } | 1110 } |
1111 | 1111 |
1112 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( | 1112 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( |
1113 const cc::CompositorFrameMetadata& frame_metadata) { | 1113 const cc::CompositorFrameMetadata& frame_metadata) { |
1114 // This is a subset of OnSwapCompositorFrame() used in the synchronous | 1114 // This is a subset of OnSwapCompositorFrame() used in the synchronous |
1115 // compositor flow. | 1115 // compositor flow. |
1116 OnFrameMetadataUpdated(frame_metadata); | 1116 OnFrameMetadataUpdated(frame_metadata); |
1117 ComputeContentsSize(frame_metadata); | 1117 ComputeContentsSize(frame_metadata); |
1118 | 1118 |
1119 // Content view core may possibly be destructed at this time. | |
boliu
2014/10/27 22:19:05
No need for comment
hush (inactive)
2014/10/27 22:24:03
Done.
| |
1120 if (content_view_core_ == NULL) | |
boliu
2014/10/27 22:19:05
if (!content_view_core_)
And I think you can put
hush (inactive)
2014/10/27 22:24:03
Done.
| |
1121 return; | |
1122 | |
1119 // DevTools ScreenCast support for Android WebView. | 1123 // DevTools ScreenCast support for Android WebView. |
1120 WebContents* web_contents = content_view_core_->GetWebContents(); | 1124 WebContents* web_contents = content_view_core_->GetWebContents(); |
1121 if (DevToolsAgentHost::HasFor(web_contents)) { | 1125 if (DevToolsAgentHost::HasFor(web_contents)) { |
1122 scoped_refptr<DevToolsAgentHost> dtah = | 1126 scoped_refptr<DevToolsAgentHost> dtah = |
1123 DevToolsAgentHost::GetOrCreateFor(web_contents); | 1127 DevToolsAgentHost::GetOrCreateFor(web_contents); |
1124 // Unblock the compositor. | 1128 // Unblock the compositor. |
1125 BrowserThread::PostTask( | 1129 BrowserThread::PostTask( |
1126 BrowserThread::UI, FROM_HERE, | 1130 BrowserThread::UI, FROM_HERE, |
1127 base::Bind(&RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame, | 1131 base::Bind(&RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame, |
1128 static_cast<RenderViewDevToolsAgentHost*>(dtah.get()), | 1132 static_cast<RenderViewDevToolsAgentHost*>(dtah.get()), |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1794 results->orientationAngle = display.RotationAsDegree(); | 1798 results->orientationAngle = display.RotationAsDegree(); |
1795 results->orientationType = | 1799 results->orientationType = |
1796 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1800 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1797 gfx::DeviceDisplayInfo info; | 1801 gfx::DeviceDisplayInfo info; |
1798 results->depth = info.GetBitsPerPixel(); | 1802 results->depth = info.GetBitsPerPixel(); |
1799 results->depthPerComponent = info.GetBitsPerComponent(); | 1803 results->depthPerComponent = info.GetBitsPerComponent(); |
1800 results->isMonochrome = (results->depthPerComponent == 0); | 1804 results->isMonochrome = (results->depthPerComponent == 0); |
1801 } | 1805 } |
1802 | 1806 |
1803 } // namespace content | 1807 } // namespace content |
OLD | NEW |