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

Side by Side Diff: content/child/child_thread_impl.cc

Issue 2779443002: Fix nullptr deref in ChildThreadImpl (Closed)
Patch Set: . Created 3 years, 9 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/child/child_thread_impl.h" 5 #include "content/child/child_thread_impl.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 channel_->AddFilter(notification_dispatcher_->GetFilter()); 496 channel_->AddFilter(notification_dispatcher_->GetFilter());
497 channel_->AddFilter(service_worker_message_filter_->GetFilter()); 497 channel_->AddFilter(service_worker_message_filter_->GetFilter());
498 498
499 if (!IsInBrowserProcess()) { 499 if (!IsInBrowserProcess()) {
500 // In single process mode, browser-side tracing and memory will cover the 500 // In single process mode, browser-side tracing and memory will cover the
501 // whole process including renderers. 501 // whole process including renderers.
502 channel_->AddFilter(new tracing::ChildTraceMessageFilter( 502 channel_->AddFilter(new tracing::ChildTraceMessageFilter(
503 ChildProcess::current()->io_task_runner())); 503 ChildProcess::current()->io_task_runner()));
504 channel_->AddFilter(new ChildMemoryMessageFilter()); 504 channel_->AddFilter(new ChildMemoryMessageFilter());
505 505
506 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config( 506 if (service_manager_connection_) {
507 GetConnector(), mojom::kBrowserServiceName); 507 memory_instrumentation::MemoryDumpManagerDelegateImpl::Config config(
508 auto delegate = 508 GetConnector(), mojom::kBrowserServiceName);
509 base::MakeUnique<memory_instrumentation::MemoryDumpManagerDelegateImpl>( 509 auto delegate = base::MakeUnique<
510 config); 510 memory_instrumentation::MemoryDumpManagerDelegateImpl>(config);
511 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( 511 base::trace_event::MemoryDumpManager::GetInstance()->Initialize(
512 std::move(delegate)); 512 std::move(delegate));
513 }
513 } 514 }
514 515
515 // In single process mode we may already have a power monitor, 516 // In single process mode we may already have a power monitor,
516 // also for some edge cases where there is no ServiceManagerConnection, we do 517 // also for some edge cases where there is no ServiceManagerConnection, we do
517 // not create the power monitor. 518 // not create the power monitor.
518 if (!base::PowerMonitor::Get() && service_manager_connection_) { 519 if (!base::PowerMonitor::Get() && service_manager_connection_) {
519 std::unique_ptr<service_manager::Connection> device_connection = 520 std::unique_ptr<service_manager::Connection> device_connection =
520 service_manager_connection_->GetConnector()->Connect( 521 service_manager_connection_->GetConnector()->Connect(
521 device::mojom::kServiceName); 522 device::mojom::kServiceName);
522 auto power_monitor_source = 523 auto power_monitor_source =
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 connected_to_browser_ = true; 875 connected_to_browser_ = true;
875 child_info_ = local_info; 876 child_info_ = local_info;
876 browser_info_ = remote_info; 877 browser_info_ = remote_info;
877 } 878 }
878 879
879 bool ChildThreadImpl::IsInBrowserProcess() const { 880 bool ChildThreadImpl::IsInBrowserProcess() const {
880 return static_cast<bool>(browser_process_io_runner_); 881 return static_cast<bool>(browser_process_io_runner_);
881 } 882 }
882 883
883 } // namespace content 884 } // 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