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

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

Issue 15418002: Record Chrome trace events in tcmalloc heap profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move to ChildThread Created 7 years, 5 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 | Annotate | Revision Log
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.h" 5 #include "content/child/child_thread.h"
6 6
7 #include "base/allocator/allocator_extension.h" 7 #include "base/allocator/allocator_extension.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 base::MessageLoop::current()->PostDelayedTask( 153 base::MessageLoop::current()->PostDelayedTask(
154 FROM_HERE, 154 FROM_HERE,
155 base::Bind(&ChildThread::EnsureConnected, 155 base::Bind(&ChildThread::EnsureConnected,
156 channel_connected_factory_.GetWeakPtr()), 156 channel_connected_factory_.GetWeakPtr()),
157 base::TimeDelta::FromSeconds(kConnectionTimeoutS)); 157 base::TimeDelta::FromSeconds(kConnectionTimeoutS));
158 158
159 #if defined(OS_ANDROID) 159 #if defined(OS_ANDROID)
160 g_child_thread = this; 160 g_child_thread = this;
161 #endif 161 #endif
162
163 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID))
164 trace_memory_controller_.reset(new base::debug::TraceMemoryController(
165 message_loop_->message_loop_proxy()));
166 #endif
162 } 167 }
163 168
164 ChildThread::~ChildThread() { 169 ChildThread::~ChildThread() {
165 #ifdef IPC_MESSAGE_LOG_ENABLED 170 #ifdef IPC_MESSAGE_LOG_ENABLED
166 IPC::Logging::GetInstance()->SetIPCSender(NULL); 171 IPC::Logging::GetInstance()->SetIPCSender(NULL);
167 #endif 172 #endif
168 173
169 channel_->RemoveFilter(histogram_message_filter_.get()); 174 channel_->RemoveFilter(histogram_message_filter_.get());
170 channel_->RemoveFilter(sync_message_filter_.get()); 175 channel_->RemoveFilter(sync_message_filter_.get());
171 176
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // inflight that would addref it. 379 // inflight that would addref it.
375 Send(new ChildProcessHostMsg_ShutdownRequest); 380 Send(new ChildProcessHostMsg_ShutdownRequest);
376 } 381 }
377 382
378 void ChildThread::EnsureConnected() { 383 void ChildThread::EnsureConnected() {
379 LOG(INFO) << "ChildThread::EnsureConnected()"; 384 LOG(INFO) << "ChildThread::EnsureConnected()";
380 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 385 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
381 } 386 }
382 387
383 } // namespace content 388 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698