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

Side by Side Diff: content/browser/profiler_controller_impl.h

Issue 9702014: [UMA] Use proper C++ objects to serialize tracked_objects across process boundaries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make sure to initialize all primitive fields Created 8 years, 9 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 #ifndef CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_
6 #define CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_ 6 #define CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_
7 7
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/tracked_objects.h"
10 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
11 #include "content/public/browser/profiler_controller.h" 10 #include "content/public/browser/profiler_controller.h"
11 #include "content/public/common/process_type.h"
12
13 namespace tracked_objects {
14 struct SerializedProcessData;
15 }
12 16
13 namespace content { 17 namespace content {
14 18
15 // ProfilerController's implementation. 19 // ProfilerController's implementation.
16 class CONTENT_EXPORT ProfilerControllerImpl : public ProfilerController { 20 class ProfilerControllerImpl : public ProfilerController {
17 public: 21 public:
18 static ProfilerControllerImpl* GetInstance(); 22 static ProfilerControllerImpl* GetInstance();
19 23
20 // Normally instantiated when the child process is launched. Only one instance 24 // Normally instantiated when the child process is launched. Only one instance
21 // should be created per process. 25 // should be created per process.
22 ProfilerControllerImpl(); 26 ProfilerControllerImpl();
23 virtual ~ProfilerControllerImpl(); 27 virtual ~ProfilerControllerImpl();
24 28
25 // Send number of pending processes to subscriber_. |end| is set to true if it 29 // Send the number of |pending_processes| to |subscriber_|. |end| is set to
jar (doing other things) 2012/04/04 17:55:35 This comment seemed very hard to read and understa
Ilya Sherman 2012/04/05 02:51:04 Done (with some further tweaks to the wording).
26 // is the last time. This is called on UI thread. 30 // true if it is the last time. This is called on the UI thread.
27 void OnPendingProcesses(int sequence_number, int pending_processes, bool end); 31 void OnPendingProcesses(int sequence_number, int pending_processes, bool end);
28 32
29 // Send profiler_data back to subscriber_. subscriber_ assumes the ownership 33 // Send the |profiler_data| back to the |subscriber_|.
30 // of profiler_data. This is called on UI thread. 34 // This is called on the UI thread.
31 void OnProfilerDataCollected(int sequence_number, 35 void OnProfilerDataCollected(
32 base::DictionaryValue* profiler_data); 36 int sequence_number,
37 const tracked_objects::SerializedProcessData& profiler_data,
38 content::ProcessType process_type);
33 39
34 // ProfilerController implementation: 40 // ProfilerController implementation:
35 virtual void Register(ProfilerSubscriber* subscriber) OVERRIDE; 41 virtual void Register(ProfilerSubscriber* subscriber) OVERRIDE;
36 virtual void Unregister(ProfilerSubscriber* subscriber) OVERRIDE; 42 virtual void Unregister(const ProfilerSubscriber* subscriber) OVERRIDE;
37 virtual void GetProfilerData(int sequence_number) OVERRIDE; 43 virtual void GetProfilerData(int sequence_number) OVERRIDE;
38 virtual void SetProfilerStatus(
39 tracked_objects::ThreadData::Status status) OVERRIDE;
40 44
41 private: 45 private:
42 friend struct DefaultSingletonTraits<ProfilerControllerImpl>; 46 friend struct DefaultSingletonTraits<ProfilerControllerImpl>;
43 47
44 // Contact child processes and get their profiler data. 48 // Contact child processes and get their profiler data.
45 void GetProfilerDataFromChildProcesses(int sequence_number); 49 void GetProfilerDataFromChildProcesses(int sequence_number);
46 50
47 // Contact child processes and set profiler status to |enable|.
48 void SetProfilerStatusInChildProcesses(
49 tracked_objects::ThreadData::Status status);
50
51 ProfilerSubscriber* subscriber_; 51 ProfilerSubscriber* subscriber_;
52 52
53 DISALLOW_COPY_AND_ASSIGN(ProfilerControllerImpl); 53 DISALLOW_COPY_AND_ASSIGN(ProfilerControllerImpl);
54 }; 54 };
55 55
56 } // namespace content 56 } // namespace content
57 57
58 #endif // CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_ 58 #endif // CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_
59
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698