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_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TASK_
PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TASK_
PROVIDER_H_ |
6 #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TASK_
PROVIDER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TASK_
PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "chrome/browser/task_management/providers/task_provider.h" | 10 #include "chrome/browser/task_management/providers/task_provider.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // Defines a provider to provide the renderer tasks that are associated with | 22 // Defines a provider to provide the renderer tasks that are associated with |
23 // various |WebContents| from various services. | 23 // various |WebContents| from various services. |
24 // There should be no or only one instance of this class at any time. | 24 // There should be no or only one instance of this class at any time. |
25 class WebContentsTaskProvider : public TaskProvider { | 25 class WebContentsTaskProvider : public TaskProvider { |
26 public: | 26 public: |
27 WebContentsTaskProvider(); | 27 WebContentsTaskProvider(); |
28 ~WebContentsTaskProvider() override; | 28 ~WebContentsTaskProvider() override; |
29 | 29 |
30 // This will be called every time we're notified that a new |WebContentsTag| | 30 // This will be called every time we're notified that a new |WebContentsTag| |
31 // has been created. | 31 // has been created. |
32 void OnWebContentsTagCreated(WebContentsTag* tag); | 32 void OnWebContentsTagCreated(const WebContentsTag* tag); |
| 33 |
| 34 // Manually remove |tag|'s corresponding Task. |
| 35 void OnWebContentsTagRemoved(const WebContentsTag* tag); |
33 | 36 |
34 // task_management::TaskProvider: | 37 // task_management::TaskProvider: |
35 Task* GetTaskOfUrlRequest(int origin_pid, | 38 Task* GetTaskOfUrlRequest(int origin_pid, |
36 int child_id, | 39 int child_id, |
37 int route_id) override; | 40 int route_id) override; |
38 | 41 |
39 // Checks if the given |web_contents| is tracked by the provider. | 42 // Checks if the given |web_contents| is tracked by the provider. |
40 bool HasWebContents(content::WebContents* web_contents) const; | 43 bool HasWebContents(content::WebContents* web_contents) const; |
41 | 44 |
42 private: | 45 private: |
(...skipping 11 matching lines...) Expand all Loading... |
54 // create for it to be able to track it. | 57 // create for it to be able to track it. |
55 typedef std::map<content::WebContents*, WebContentsEntry*> EntryMap; | 58 typedef std::map<content::WebContents*, WebContentsEntry*> EntryMap; |
56 EntryMap entries_map_; | 59 EntryMap entries_map_; |
57 | 60 |
58 DISALLOW_COPY_AND_ASSIGN(WebContentsTaskProvider); | 61 DISALLOW_COPY_AND_ASSIGN(WebContentsTaskProvider); |
59 }; | 62 }; |
60 | 63 |
61 } // namespace task_management | 64 } // namespace task_management |
62 | 65 |
63 #endif // CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TA
SK_PROVIDER_H_ | 66 #endif // CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TA
SK_PROVIDER_H_ |
OLD | NEW |