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

Side by Side Diff: content/browser/browser_child_process_host_impl.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 (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/browser_child_process_host_impl.h" 5 #include "content/browser/browser_child_process_host_impl.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); 505 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory());
506 if (!shm->CreateAndMapAnonymous(memory_size)) 506 if (!shm->CreateAndMapAnonymous(memory_size))
507 return; 507 return;
508 metrics_allocator_.reset(new base::SharedPersistentMemoryAllocator( 508 metrics_allocator_.reset(new base::SharedPersistentMemoryAllocator(
509 std::move(shm), static_cast<uint64_t>(data_.id), metrics_name, 509 std::move(shm), static_cast<uint64_t>(data_.id), metrics_name,
510 /*readonly=*/false)); 510 /*readonly=*/false));
511 } 511 }
512 512
513 void BrowserChildProcessHostImpl::ShareMetricsAllocatorToProcess() { 513 void BrowserChildProcessHostImpl::ShareMetricsAllocatorToProcess() {
514 if (metrics_allocator_) { 514 if (metrics_allocator_) {
515 base::SharedMemoryHandle shm_handle; 515 base::SharedMemoryHandle shm_handle =
516 metrics_allocator_->shared_memory()->ShareToProcess(data_.handle, 516 metrics_allocator_->shared_memory()->handle().Duplicate();
517 &shm_handle);
518 Send(new ChildProcessMsg_SetHistogramMemory( 517 Send(new ChildProcessMsg_SetHistogramMemory(
519 shm_handle, metrics_allocator_->shared_memory()->mapped_size())); 518 shm_handle, metrics_allocator_->shared_memory()->mapped_size()));
520 } 519 }
521 } 520 }
522 521
523 void BrowserChildProcessHostImpl::OnProcessLaunchFailed(int error_code) { 522 void BrowserChildProcessHostImpl::OnProcessLaunchFailed(int error_code) {
524 delegate_->OnProcessLaunchFailed(error_code); 523 delegate_->OnProcessLaunchFailed(error_code);
525 notify_child_disconnected_ = false; 524 notify_child_disconnected_ = false;
526 delete delegate_; // Will delete us 525 delete delegate_; // Will delete us
527 } 526 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 591
593 #if defined(OS_WIN) 592 #if defined(OS_WIN)
594 593
595 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { 594 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) {
596 OnChildDisconnected(); 595 OnChildDisconnected();
597 } 596 }
598 597
599 #endif 598 #endif
600 599
601 } // namespace content 600 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698