| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PROVIDERS_TASK_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_TASK_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_TASK_PROVIDER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_TASK_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/task_manager/providers/task_provider_observer.h" | 9 #include "chrome/browser/task_manager/providers/task_provider_observer.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // the observer if there's no one set. | 43 // the observer if there's no one set. |
| 44 void ClearObserver(); | 44 void ClearObserver(); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 // Used by concrete task providers to notify the observer of tasks addition/ | 47 // Used by concrete task providers to notify the observer of tasks addition/ |
| 48 // removal/renderer unresponsive. These methods should only be called after | 48 // removal/renderer unresponsive. These methods should only be called after |
| 49 // StartUpdating() has been called and before StopUpdating() is called. | 49 // StartUpdating() has been called and before StopUpdating() is called. |
| 50 void NotifyObserverTaskAdded(Task* task) const; | 50 void NotifyObserverTaskAdded(Task* task) const; |
| 51 void NotifyObserverTaskRemoved(Task* task) const; | 51 void NotifyObserverTaskRemoved(Task* task) const; |
| 52 void NotifyObserverTaskUnresponsive(Task* task) const; | 52 void NotifyObserverTaskUnresponsive(Task* task) const; |
| 53 void UpdateTaskProcessInfoAndNotifyObserver( |
| 54 Task* existing_task, |
| 55 base::ProcessHandle new_process_handle, |
| 56 base::ProcessId new_process_id) const; |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 // This will be called once an observer is set for this provider. When it is | 59 // This will be called once an observer is set for this provider. When it is |
| 56 // called, the concrete provider must notify the observer of all pre-existing | 60 // called, the concrete provider must notify the observer of all pre-existing |
| 57 // tasks as well as track new addition and terminations and notify the | 61 // tasks as well as track new addition and terminations and notify the |
| 58 // observer of these changes. | 62 // observer of these changes. |
| 59 virtual void StartUpdating() = 0; | 63 virtual void StartUpdating() = 0; |
| 60 | 64 |
| 61 // This will be called once the observer is cleared, at which point the | 65 // This will be called once the observer is cleared, at which point the |
| 62 // provider can stop tracking tasks addition / removal and can clear its own | 66 // provider can stop tracking tasks addition / removal and can clear its own |
| 63 // resources. | 67 // resources. |
| 64 virtual void StopUpdating() = 0; | 68 virtual void StopUpdating() = 0; |
| 65 | 69 |
| 66 // We support only one single obsever which will be the sampler in this case. | 70 // We support only one single obsever which will be the sampler in this case. |
| 67 TaskProviderObserver* observer_; | 71 TaskProviderObserver* observer_; |
| 68 | 72 |
| 69 DISALLOW_COPY_AND_ASSIGN(TaskProvider); | 73 DISALLOW_COPY_AND_ASSIGN(TaskProvider); |
| 70 }; | 74 }; |
| 71 | 75 |
| 72 } // namespace task_manager | 76 } // namespace task_manager |
| 73 | 77 |
| 74 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_TASK_PROVIDER_H_ | 78 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_TASK_PROVIDER_H_ |
| OLD | NEW |