| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_WEB_CONTENTS_RESOURCE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_WEB_CONTENTS_RESOURCE_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_WEB_CONTENTS_RESOURCE_PROVIDER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_WEB_CONTENTS_RESOURCE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // This ResourceProvider is instantiated several times by the task manager, each | 33 // This ResourceProvider is instantiated several times by the task manager, each |
| 34 // with a different implementation of WebContentsInformation. | 34 // with a different implementation of WebContentsInformation. |
| 35 class WebContentsResourceProvider : public ResourceProvider { | 35 class WebContentsResourceProvider : public ResourceProvider { |
| 36 public: | 36 public: |
| 37 WebContentsResourceProvider(TaskManager* task_manager, | 37 WebContentsResourceProvider(TaskManager* task_manager, |
| 38 scoped_ptr<WebContentsInformation> info); | 38 scoped_ptr<WebContentsInformation> info); |
| 39 | 39 |
| 40 // ResourceProvider implementation. | 40 // ResourceProvider implementation. |
| 41 virtual RendererResource* GetResource(int origin_pid, | 41 virtual RendererResource* GetResource(int origin_pid, |
| 42 int child_id, | 42 int child_id, |
| 43 int route_id) OVERRIDE; | 43 int route_id) override; |
| 44 virtual void StartUpdating() OVERRIDE; | 44 virtual void StartUpdating() override; |
| 45 virtual void StopUpdating() OVERRIDE; | 45 virtual void StopUpdating() override; |
| 46 | 46 |
| 47 // Start observing |web_contents| for changes via WebContentsObserver, and | 47 // Start observing |web_contents| for changes via WebContentsObserver, and |
| 48 // add it to the task manager. | 48 // add it to the task manager. |
| 49 void OnWebContentsCreated(content::WebContents* web_contents); | 49 void OnWebContentsCreated(content::WebContents* web_contents); |
| 50 | 50 |
| 51 // Remove a TaskManagerWebContentsEntry from our tracking list, and delete it. | 51 // Remove a TaskManagerWebContentsEntry from our tracking list, and delete it. |
| 52 void DeleteEntry(content::WebContents* web_contents, | 52 void DeleteEntry(content::WebContents* web_contents, |
| 53 TaskManagerWebContentsEntry* entry); | 53 TaskManagerWebContentsEntry* entry); |
| 54 | 54 |
| 55 TaskManager* task_manager() { return task_manager_; } | 55 TaskManager* task_manager() { return task_manager_; } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 72 // The WebContentsInformation that informs us when a new WebContents* is | 72 // The WebContentsInformation that informs us when a new WebContents* is |
| 73 // created, and which serves as a RendererResource factory for our type. | 73 // created, and which serves as a RendererResource factory for our type. |
| 74 scoped_ptr<WebContentsInformation> info_; | 74 scoped_ptr<WebContentsInformation> info_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(WebContentsResourceProvider); | 76 DISALLOW_COPY_AND_ASSIGN(WebContentsResourceProvider); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace task_manager | 79 } // namespace task_manager |
| 80 | 80 |
| 81 #endif // CHROME_BROWSER_TASK_MANAGER_WEB_CONTENTS_RESOURCE_PROVIDER_H_ | 81 #endif // CHROME_BROWSER_TASK_MANAGER_WEB_CONTENTS_RESOURCE_PROVIDER_H_ |
| OLD | NEW |