OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ |
6 #define CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/task_manager/resource_provider.h" | 10 #include "chrome/browser/task_manager/resource_provider.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace extensions { | 24 namespace extensions { |
25 class Extension; | 25 class Extension; |
26 } | 26 } |
27 | 27 |
28 namespace task_manager { | 28 namespace task_manager { |
29 | 29 |
30 class BrowserProcessResource : public Resource { | 30 class BrowserProcessResource : public Resource { |
31 public: | 31 public: |
32 BrowserProcessResource(); | 32 BrowserProcessResource(); |
33 virtual ~BrowserProcessResource(); | 33 ~BrowserProcessResource() override; |
34 | 34 |
35 // Resource methods: | 35 // Resource methods: |
36 virtual base::string16 GetTitle() const override; | 36 base::string16 GetTitle() const override; |
37 virtual base::string16 GetProfileName() const override; | 37 base::string16 GetProfileName() const override; |
38 virtual gfx::ImageSkia GetIcon() const override; | 38 gfx::ImageSkia GetIcon() const override; |
39 virtual base::ProcessHandle GetProcess() const override; | 39 base::ProcessHandle GetProcess() const override; |
40 virtual int GetUniqueChildProcessId() const override; | 40 int GetUniqueChildProcessId() const override; |
41 virtual Type GetType() const override; | 41 Type GetType() const override; |
42 | 42 |
43 virtual bool SupportNetworkUsage() const override; | 43 bool SupportNetworkUsage() const override; |
44 virtual void SetSupportNetworkUsage() override; | 44 void SetSupportNetworkUsage() override; |
45 | 45 |
46 virtual bool ReportsSqliteMemoryUsed() const override; | 46 bool ReportsSqliteMemoryUsed() const override; |
47 virtual size_t SqliteMemoryUsedBytes() const override; | 47 size_t SqliteMemoryUsedBytes() const override; |
48 | 48 |
49 virtual bool ReportsV8MemoryStats() const override; | 49 bool ReportsV8MemoryStats() const override; |
50 virtual size_t GetV8MemoryAllocated() const override; | 50 size_t GetV8MemoryAllocated() const override; |
51 virtual size_t GetV8MemoryUsed() const override; | 51 size_t GetV8MemoryUsed() const override; |
52 | 52 |
53 private: | 53 private: |
54 base::ProcessHandle process_; | 54 base::ProcessHandle process_; |
55 mutable base::string16 title_; | 55 mutable base::string16 title_; |
56 | 56 |
57 static gfx::ImageSkia* default_icon_; | 57 static gfx::ImageSkia* default_icon_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(BrowserProcessResource); | 59 DISALLOW_COPY_AND_ASSIGN(BrowserProcessResource); |
60 }; | 60 }; |
61 | 61 |
62 class BrowserProcessResourceProvider : public ResourceProvider { | 62 class BrowserProcessResourceProvider : public ResourceProvider { |
63 public: | 63 public: |
64 explicit BrowserProcessResourceProvider(TaskManager* task_manager); | 64 explicit BrowserProcessResourceProvider(TaskManager* task_manager); |
65 | 65 |
66 virtual Resource* GetResource(int origin_pid, | 66 Resource* GetResource(int origin_pid, int child_id, int route_id) override; |
67 int child_id, | 67 void StartUpdating() override; |
68 int route_id) override; | 68 void StopUpdating() override; |
69 virtual void StartUpdating() override; | |
70 virtual void StopUpdating() override; | |
71 | 69 |
72 // Whether we are currently reporting to the task manager. Used to ignore | 70 // Whether we are currently reporting to the task manager. Used to ignore |
73 // notifications sent after StopUpdating(). | 71 // notifications sent after StopUpdating(). |
74 bool updating_; | 72 bool updating_; |
75 | 73 |
76 private: | 74 private: |
77 virtual ~BrowserProcessResourceProvider(); | 75 ~BrowserProcessResourceProvider() override; |
78 | 76 |
79 TaskManager* task_manager_; | 77 TaskManager* task_manager_; |
80 BrowserProcessResource resource_; | 78 BrowserProcessResource resource_; |
81 | 79 |
82 DISALLOW_COPY_AND_ASSIGN(BrowserProcessResourceProvider); | 80 DISALLOW_COPY_AND_ASSIGN(BrowserProcessResourceProvider); |
83 }; | 81 }; |
84 | 82 |
85 } // namespace task_manager | 83 } // namespace task_manager |
86 | 84 |
87 #endif // CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ | 85 #endif // CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ |
OLD | NEW |