Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PRIVATE_TASKS_PROVIDERS_TASK_PROVIDER_H_ | |
| 6 #define CHROME_BROWSER_TASK_MANAGEMENT_PRIVATE_TASKS_PROVIDERS_TASK_PROVIDER_H_ | |
| 7 | |
| 8 #include "chrome/browser/task_management/private/tasks_providers/task_provider_o bserver.h" | |
| 9 | |
| 10 namespace task_management { | |
| 11 | |
|
ncarter (slow)
2015/03/27 18:16:22
Merits a class comment. The comment before the old
afakhry
2015/03/31 00:19:20
Done.
| |
| 12 class TaskProvider { | |
| 13 public: | |
| 14 TaskProvider(); | |
| 15 virtual ~TaskProvider(); | |
| 16 | |
| 17 // Should return the task associated to the specified ids of a URLRequest, | |
| 18 // or nullptr if the desired task does not belong to this provider. | |
| 19 virtual scoped_refptr<Task> GetTaskOfUrlRequest(int origin_pid, | |
| 20 int child_id, | |
| 21 int route_id) = 0; | |
| 22 | |
| 23 void SetObserver(TaskProviderObserver* observer); | |
| 24 void ClearObserver(); | |
| 25 | |
| 26 protected: | |
| 27 // we keep updating as long as the |observer_| is set for this provider. | |
| 28 // StopUpdating() will be called after the |observer_| is cleared. | |
| 29 virtual void StartUpdating() = 0; | |
| 30 virtual void StopUpdating() = 0; | |
| 31 | |
| 32 // ---------------------------------------------------------------------- | |
| 33 // Fields: | |
| 34 // ---------------------------------------------------------------------- | |
|
ncarter (slow)
2015/03/27 18:16:22
Not needed.
afakhry
2015/03/31 00:19:20
Done.
| |
| 35 // We support only one single obsever which will be the sampler in this case. | |
| 36 TaskProviderObserver* observer_; | |
|
ncarter (slow)
2015/03/27 18:16:22
This should be private. The methods of the base cl
afakhry
2015/03/31 00:19:20
Done.
| |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(TaskProvider); | |
| 39 }; | |
| 40 | |
| 41 } // namespace task_management | |
| 42 | |
| 43 #endif // CHROME_BROWSER_TASK_MANAGEMENT_PRIVATE_TASKS_PROVIDERS_TASK_PROVIDER_ H_ | |
| OLD | NEW |