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

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

Issue 1340013002: Add thread-local allocation context for tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 years, 3 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/child/child_thread_impl.h" 5 #include "content/child/child_thread_impl.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "base/metrics/field_trial.h" 21 #include "base/metrics/field_trial.h"
22 #include "base/process/process.h" 22 #include "base/process/process.h"
23 #include "base/process/process_handle.h" 23 #include "base/process/process_handle.h"
24 #include "base/single_thread_task_runner.h" 24 #include "base/single_thread_task_runner.h"
25 #include "base/strings/string_number_conversions.h" 25 #include "base/strings/string_number_conversions.h"
26 #include "base/strings/string_util.h" 26 #include "base/strings/string_util.h"
27 #include "base/synchronization/condition_variable.h" 27 #include "base/synchronization/condition_variable.h"
28 #include "base/synchronization/lock.h" 28 #include "base/synchronization/lock.h"
29 #include "base/thread_task_runner_handle.h" 29 #include "base/thread_task_runner_handle.h"
30 #include "base/threading/thread_local.h" 30 #include "base/threading/thread_local.h"
31 #include "base/trace_event/pseudo_stack.h"
31 #include "base/tracked_objects.h" 32 #include "base/tracked_objects.h"
32 #include "components/tracing/child_trace_message_filter.h" 33 #include "components/tracing/child_trace_message_filter.h"
33 #include "content/child/child_discardable_shared_memory_manager.h" 34 #include "content/child/child_discardable_shared_memory_manager.h"
34 #include "content/child/child_gpu_memory_buffer_manager.h" 35 #include "content/child/child_gpu_memory_buffer_manager.h"
35 #include "content/child/child_histogram_message_filter.h" 36 #include "content/child/child_histogram_message_filter.h"
36 #include "content/child/child_process.h" 37 #include "content/child/child_process.h"
37 #include "content/child/child_resource_message_filter.h" 38 #include "content/child/child_resource_message_filter.h"
38 #include "content/child/child_shared_bitmap_manager.h" 39 #include "content/child/child_shared_bitmap_manager.h"
39 #include "content/child/fileapi/file_system_dispatcher.h" 40 #include "content/child/fileapi/file_system_dispatcher.h"
40 #include "content/child/fileapi/webfilesystem_impl.h" 41 #include "content/child/fileapi/webfilesystem_impl.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 482
482 message_loop_->task_runner()->PostDelayedTask( 483 message_loop_->task_runner()->PostDelayedTask(
483 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected, 484 FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected,
484 channel_connected_factory_.GetWeakPtr()), 485 channel_connected_factory_.GetWeakPtr()),
485 base::TimeDelta::FromSeconds(connection_timeout)); 486 base::TimeDelta::FromSeconds(connection_timeout));
486 487
487 #if defined(OS_ANDROID) 488 #if defined(OS_ANDROID)
488 g_quit_closure.Get().BindToMainThread(); 489 g_quit_closure.Get().BindToMainThread();
489 #endif 490 #endif
490 491
492 pseudo_stack_controller_.reset(
493 new base::trace_event::PseudoStackController());
494
491 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 495 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
492 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( 496 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController(
493 message_loop_->task_runner(), ::HeapProfilerWithPseudoStackStart, 497 message_loop_->task_runner(), ::HeapProfilerWithPseudoStackStart,
494 ::HeapProfilerStop, ::GetHeapProfile)); 498 ::HeapProfilerStop, ::GetHeapProfile));
495 #endif 499 #endif
496 500
497 shared_bitmap_manager_.reset( 501 shared_bitmap_manager_.reset(
498 new ChildSharedBitmapManager(thread_safe_sender())); 502 new ChildSharedBitmapManager(thread_safe_sender()));
499 503
500 gpu_memory_buffer_manager_.reset( 504 gpu_memory_buffer_manager_.reset(
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 void ChildThreadImpl::EnsureConnected() { 741 void ChildThreadImpl::EnsureConnected() {
738 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; 742 VLOG(0) << "ChildThreadImpl::EnsureConnected()";
739 base::Process::Current().Terminate(0, false); 743 base::Process::Current().Terminate(0, false);
740 } 744 }
741 745
742 bool ChildThreadImpl::IsInBrowserProcess() const { 746 bool ChildThreadImpl::IsInBrowserProcess() const {
743 return browser_process_io_runner_; 747 return browser_process_io_runner_;
744 } 748 }
745 749
746 } // namespace content 750 } // namespace content
OLDNEW
« base/trace_event/pseudo_stack.cc ('K') | « content/child/child_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698