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

Side by Side Diff: content/browser/android/synchronous_compositor_host.cc

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. Created 3 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/android/synchronous_compositor_host.h" 5 #include "content/browser/android/synchronous_compositor_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 std::unique_ptr<SharedMemoryWithSize> software_draw_shm( 282 std::unique_ptr<SharedMemoryWithSize> software_draw_shm(
283 new SharedMemoryWithSize(stride, buffer_size)); 283 new SharedMemoryWithSize(stride, buffer_size));
284 { 284 {
285 TRACE_EVENT1("browser", "AllocateSharedMemory", "buffer_size", buffer_size); 285 TRACE_EVENT1("browser", "AllocateSharedMemory", "buffer_size", buffer_size);
286 if (!software_draw_shm->shm.CreateAndMapAnonymous(buffer_size)) 286 if (!software_draw_shm->shm.CreateAndMapAnonymous(buffer_size))
287 return; 287 return;
288 } 288 }
289 289
290 SyncCompositorSetSharedMemoryParams set_shm_params; 290 SyncCompositorSetSharedMemoryParams set_shm_params;
291 set_shm_params.buffer_size = buffer_size; 291 set_shm_params.buffer_size = buffer_size;
292 base::ProcessHandle renderer_process_handle = 292 set_shm_params.shm_handle = software_draw_shm->shm.handle().Duplicate();
293 rwhva_->GetRenderWidgetHost()->GetProcess()->GetHandle(); 293 if (!set_shm_params.shm_handle.IsValid())
294 if (!software_draw_shm->shm.ShareToProcess(renderer_process_handle,
295 &set_shm_params.shm_handle)) {
296 return; 294 return;
297 }
298 295
299 bool success = false; 296 bool success = false;
300 SyncCompositorCommonRendererParams common_renderer_params; 297 SyncCompositorCommonRendererParams common_renderer_params;
301 { 298 {
302 base::ThreadRestrictions::ScopedAllowWait wait; 299 base::ThreadRestrictions::ScopedAllowWait wait;
303 if (!sender_->Send(new SyncCompositorMsg_SetSharedMemory( 300 if (!sender_->Send(new SyncCompositorMsg_SetSharedMemory(
304 routing_id_, set_shm_params, &success, &common_renderer_params)) || 301 routing_id_, set_shm_params, &success, &common_renderer_params)) ||
305 !success) { 302 !success) {
306 return; 303 return;
307 } 304 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 if (params.page_scale_factor) { 413 if (params.page_scale_factor) {
417 client_->UpdateRootLayerState( 414 client_->UpdateRootLayerState(
418 this, gfx::ScrollOffsetToVector2dF(params.total_scroll_offset), 415 this, gfx::ScrollOffsetToVector2dF(params.total_scroll_offset),
419 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset), 416 gfx::ScrollOffsetToVector2dF(params.max_scroll_offset),
420 params.scrollable_size, params.page_scale_factor, 417 params.scrollable_size, params.page_scale_factor,
421 params.min_page_scale_factor, params.max_page_scale_factor); 418 params.min_page_scale_factor, params.max_page_scale_factor);
422 } 419 }
423 } 420 }
424 421
425 } // namespace content 422 } // namespace content
OLDNEW
« no previous file with comments | « components/nacl/browser/nacl_process_host.cc ('k') | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698