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

Unified Diff: chrome/browser/task_management/private/tasks_providers/task_provider.h

Issue 1038033002: New Task Manager - Phase 1.1: Implement Browser Process Task Providing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/task_management/private/tasks_providers/task_provider.h
diff --git a/chrome/browser/task_management/private/tasks_providers/task_provider.h b/chrome/browser/task_management/private/tasks_providers/task_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..07ab1c439389cd8d4044cc9f948fa086f29f375c
--- /dev/null
+++ b/chrome/browser/task_management/private/tasks_providers/task_provider.h
@@ -0,0 +1,43 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_TASK_MANAGEMENT_PRIVATE_TASKS_PROVIDERS_TASK_PROVIDER_H_
+#define CHROME_BROWSER_TASK_MANAGEMENT_PRIVATE_TASKS_PROVIDERS_TASK_PROVIDER_H_
+
+#include "chrome/browser/task_management/private/tasks_providers/task_provider_observer.h"
+
+namespace task_management {
+
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.
+class TaskProvider {
+ public:
+ TaskProvider();
+ virtual ~TaskProvider();
+
+ // Should return the task associated to the specified ids of a URLRequest,
+ // or nullptr if the desired task does not belong to this provider.
+ virtual scoped_refptr<Task> GetTaskOfUrlRequest(int origin_pid,
+ int child_id,
+ int route_id) = 0;
+
+ void SetObserver(TaskProviderObserver* observer);
+ void ClearObserver();
+
+ protected:
+ // we keep updating as long as the |observer_| is set for this provider.
+ // StopUpdating() will be called after the |observer_| is cleared.
+ virtual void StartUpdating() = 0;
+ virtual void StopUpdating() = 0;
+
+// ----------------------------------------------------------------------
+// Fields:
+// ----------------------------------------------------------------------
ncarter (slow) 2015/03/27 18:16:22 Not needed.
afakhry 2015/03/31 00:19:20 Done.
+ // We support only one single obsever which will be the sampler in this case.
+ 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.
+
+ DISALLOW_COPY_AND_ASSIGN(TaskProvider);
+};
+
+} // namespace task_management
+
+#endif // CHROME_BROWSER_TASK_MANAGEMENT_PRIVATE_TASKS_PROVIDERS_TASK_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698