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

Side by Side Diff: content/browser/profiler_controller.cc

Issue 8588023: Collect profiler stats from browser child processes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
Property Changes:
Added: svn:executable
+ *
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/profiler_controller.h"
6
7 #include "base/bind.h"
8 #include "content/browser/browser_message_filter.h"
9 #include "content/browser/profiler_message_filter.h"
10
11 using content::BrowserThread;
12
13 ProfilerSubscriber::~ProfilerSubscriber() {
14 }
15
16 ProfilerController::ProfilerController() : subscriber_(NULL) {
17 }
18
19 ProfilerController::~ProfilerController() {
20 }
21
22 ProfilerController* ProfilerController::GetInstance() {
23 return Singleton<ProfilerController>::get();
24 }
25
26 void ProfilerController::RegisterSubscriber(ProfilerSubscriber* subscriber) {
27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
28 DCHECK(!subscriber_);
29 subscriber_ = subscriber;
30 }
31
32 void ProfilerController::CancelSubscriber(ProfilerSubscriber* subscriber) {
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
34
35 if (subscriber == subscriber_) {
36 subscriber_ = NULL;
37 }
38 }
39
40 void ProfilerController::OnProfilerDataCollected(
41 int sequence_number,
42 const std::string& profiler_data) {
43 if (subscriber_) {
44 subscriber_->OnBrowserChildProfilerDataCollected(
45 sequence_number, profiler_data);
46 }
47 }
48
49 void ProfilerController::OnIsProfilerEnabled(base::ProcessId child_process_id) {
50 if (subscriber_) {
51 subscriber_->OnIsProfilerEnabledForChildProcess(child_process_id);
52 }
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698