OLD | NEW |
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/profiler_controller_impl.h" | 5 #include "content/browser/profiler_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
9 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
10 #include "content/common/child_process_messages.h" | 10 #include "content/common/child_process_messages.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 int pending_processes, | 34 int pending_processes, |
35 bool end) { | 35 bool end) { |
36 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 36 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
37 if (subscriber_) | 37 if (subscriber_) |
38 subscriber_->OnPendingProcesses(sequence_number, pending_processes, end); | 38 subscriber_->OnPendingProcesses(sequence_number, pending_processes, end); |
39 } | 39 } |
40 | 40 |
41 void ProfilerControllerImpl::OnProfilerDataCollected( | 41 void ProfilerControllerImpl::OnProfilerDataCollected( |
42 int sequence_number, | 42 int sequence_number, |
43 const tracked_objects::ProcessDataSnapshot& profiler_data, | 43 const tracked_objects::ProcessDataSnapshot& profiler_data, |
44 int process_type) { | 44 content::ProcessType process_type) { |
45 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 45 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
46 BrowserThread::PostTask( | 46 BrowserThread::PostTask( |
47 BrowserThread::UI, FROM_HERE, | 47 BrowserThread::UI, FROM_HERE, |
48 base::Bind(&ProfilerControllerImpl::OnProfilerDataCollected, | 48 base::Bind(&ProfilerControllerImpl::OnProfilerDataCollected, |
49 base::Unretained(this), | 49 base::Unretained(this), |
50 sequence_number, | 50 sequence_number, |
51 profiler_data, | 51 profiler_data, |
52 process_type)); | 52 process_type)); |
53 return; | 53 return; |
54 } | 54 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 BrowserThread::PostTask( | 117 BrowserThread::PostTask( |
118 BrowserThread::IO, | 118 BrowserThread::IO, |
119 FROM_HERE, | 119 FROM_HERE, |
120 base::Bind(&ProfilerControllerImpl::GetProfilerDataFromChildProcesses, | 120 base::Bind(&ProfilerControllerImpl::GetProfilerDataFromChildProcesses, |
121 base::Unretained(this), | 121 base::Unretained(this), |
122 sequence_number)); | 122 sequence_number)); |
123 } | 123 } |
124 | 124 |
125 } // namespace content | 125 } // namespace content |
OLD | NEW |