| Index: content/browser/profiler_controller_impl.cc
|
| diff --git a/content/browser/profiler_controller_impl.cc b/content/browser/profiler_controller_impl.cc
|
| index b3e40e8a64195a5f5bfa39f51f0f6ee279c5f3ba..1bedde2caba5478c8198fcb266d5d0ec470c08cd 100644
|
| --- a/content/browser/profiler_controller_impl.cc
|
| +++ b/content/browser/profiler_controller_impl.cc
|
| @@ -5,14 +5,14 @@
|
| #include "content/browser/profiler_controller_impl.h"
|
|
|
| #include "base/bind.h"
|
| -#include "base/values.h"
|
| +#include "base/tracked_objects.h"
|
| #include "content/common/child_process_messages.h"
|
| #include "content/public/browser/browser_child_process_host_iterator.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/child_process_data.h"
|
| #include "content/public/browser/profiler_subscriber.h"
|
| #include "content/public/browser/render_process_host.h"
|
| -#include "content/public/common/process_type.h"
|
| +#include "content/public/common/serialized_profiler_data.h"
|
|
|
| using content::BrowserChildProcessHostIterator;
|
| using content::BrowserThread;
|
| @@ -43,7 +43,7 @@ void ProfilerControllerImpl::OnPendingProcesses(int sequence_number,
|
|
|
| void ProfilerControllerImpl::OnProfilerDataCollected(
|
| int sequence_number,
|
| - base::DictionaryValue* profiler_data) {
|
| + const SerializedProfilerData& profiler_data) {
|
| if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
| BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE,
|
| @@ -65,9 +65,9 @@ void ProfilerControllerImpl::Register(ProfilerSubscriber* subscriber) {
|
| subscriber_ = subscriber;
|
| }
|
|
|
| -void ProfilerControllerImpl::Unregister(ProfilerSubscriber* subscriber) {
|
| - if (subscriber == subscriber_)
|
| - subscriber_ = NULL;
|
| +void ProfilerControllerImpl::Unregister(const ProfilerSubscriber* subscriber) {
|
| + DCHECK_EQ(subscriber_, subscriber);
|
| + subscriber_ = NULL;
|
| }
|
|
|
| void ProfilerControllerImpl::GetProfilerDataFromChildProcesses(
|
| @@ -76,11 +76,9 @@ void ProfilerControllerImpl::GetProfilerDataFromChildProcesses(
|
|
|
| int pending_processes = 0;
|
| for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) {
|
| - const std::string process_type =
|
| - content::GetProcessTypeNameInEnglish(iter.GetData().type);
|
| ++pending_processes;
|
| if (!iter.Send(new ChildProcessMsg_GetChildProfilerData(
|
| - sequence_number, process_type))) {
|
| + sequence_number, iter.GetData().type))) {
|
| --pending_processes;
|
| }
|
| }
|
| @@ -100,14 +98,11 @@ void ProfilerControllerImpl::GetProfilerData(int sequence_number) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| int pending_processes = 0;
|
| - const std::string render_process_type =
|
| - content::GetProcessTypeNameInEnglish(content::PROCESS_TYPE_RENDERER);
|
| -
|
| for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
|
| !it.IsAtEnd(); it.Advance()) {
|
| ++pending_processes;
|
| if (!it.GetCurrentValue()->Send(new ChildProcessMsg_GetChildProfilerData(
|
| - sequence_number, render_process_type))) {
|
| + sequence_number, content::PROCESS_TYPE_RENDERER))) {
|
| --pending_processes;
|
| }
|
| }
|
| @@ -121,29 +116,4 @@ void ProfilerControllerImpl::GetProfilerData(int sequence_number) {
|
| sequence_number));
|
| }
|
|
|
| -void ProfilerControllerImpl::SetProfilerStatusInChildProcesses(
|
| - tracked_objects::ThreadData::Status status) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| -
|
| - for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter)
|
| - iter.Send(new ChildProcessMsg_SetProfilerStatus(status));
|
| -}
|
| -
|
| -void ProfilerControllerImpl::SetProfilerStatus(
|
| - tracked_objects::ThreadData::Status status) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| -
|
| - BrowserThread::PostTask(
|
| - BrowserThread::IO,
|
| - FROM_HERE,
|
| - base::Bind(&ProfilerControllerImpl::SetProfilerStatusInChildProcesses,
|
| - base::Unretained(this),
|
| - status));
|
| -
|
| - for (content::RenderProcessHost::iterator it(
|
| - content::RenderProcessHost::AllHostsIterator());
|
| - !it.IsAtEnd(); it.Advance()) {
|
| - it.GetCurrentValue()->Send(new ChildProcessMsg_SetProfilerStatus(status));
|
| - }
|
| -}
|
| } // namespace content
|
|
|