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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 867093004: Android: Fix potential null-ptr deref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 base::Bind(&RenderWidgetHostViewAndroid::OnContextLost)); 151 base::Bind(&RenderWidgetHostViewAndroid::OnContextLost));
152 } 152 }
153 153
154 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 154 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
155 GLHelperHolder::CreateContext3D() { 155 GLHelperHolder::CreateContext3D() {
156 BrowserGpuChannelHostFactory* factory = 156 BrowserGpuChannelHostFactory* factory =
157 BrowserGpuChannelHostFactory::instance(); 157 BrowserGpuChannelHostFactory::instance();
158 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel()); 158 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel());
159 // GLHelper can only be used in asynchronous APIs for postprocessing after 159 // GLHelper can only be used in asynchronous APIs for postprocessing after
160 // Browser Compositor operations (i.e. readback). 160 // Browser Compositor operations (i.e. readback).
161 DCHECK(gpu_channel_host.get()) << "Illegal access to GPU channel at startup"; 161 if (!gpu_channel_host.get()) {
162 if (gpu_channel_host->IsLost()) {
163 // The Browser Compositor is in charge of reestablishing the channel. 162 // The Browser Compositor is in charge of reestablishing the channel.
164 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); 163 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
165 } 164 }
166 165
167 blink::WebGraphicsContext3D::Attributes attrs; 166 blink::WebGraphicsContext3D::Attributes attrs;
168 attrs.shareResources = true; 167 attrs.shareResources = true;
169 GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); 168 GURL url("chrome://gpu/RenderWidgetHostViewAndroid");
170 static const size_t kBytesPerPixel = 4; 169 static const size_t kBytesPerPixel = 4;
171 gfx::DeviceDisplayInfo display_info; 170 gfx::DeviceDisplayInfo display_info;
172 size_t full_screen_texture_size_in_bytes = display_info.GetDisplayHeight() * 171 size_t full_screen_texture_size_in_bytes = display_info.GetDisplayHeight() *
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 results->orientationAngle = display.RotationAsDegree(); 1911 results->orientationAngle = display.RotationAsDegree();
1913 results->orientationType = 1912 results->orientationType =
1914 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1913 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1915 gfx::DeviceDisplayInfo info; 1914 gfx::DeviceDisplayInfo info;
1916 results->depth = info.GetBitsPerPixel(); 1915 results->depth = info.GetBitsPerPixel();
1917 results->depthPerComponent = info.GetBitsPerComponent(); 1916 results->depthPerComponent = info.GetBitsPerComponent();
1918 results->isMonochrome = (results->depthPerComponent == 0); 1917 results->isMonochrome = (results->depthPerComponent == 0);
1919 } 1918 }
1920 1919
1921 } // namespace content 1920 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698