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

Side by Side Diff: chrome/browser/task_manager/web_contents_resource_provider.h

Issue 663023009: Standardize usage of virtual/override/final in chrome/browser/task_manager/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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 20 matching lines...) Expand all
31 // WebContentsInformation, which provides a list of WebContentses to track. 31 // WebContentsInformation, which provides a list of WebContentses to track.
32 // 32 //
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 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 void StartUpdating() override;
45 virtual void StopUpdating() override; 45 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_; }
56 WebContentsInformation* info() { return info_.get(); } 56 WebContentsInformation* info() { return info_.get(); }
57 57
58 protected: 58 protected:
59 virtual ~WebContentsResourceProvider(); 59 ~WebContentsResourceProvider() override;
60 60
61 private: 61 private:
62 typedef std::map<content::WebContents*, TaskManagerWebContentsEntry*> 62 typedef std::map<content::WebContents*, TaskManagerWebContentsEntry*>
63 EntryMap; 63 EntryMap;
64 64
65 TaskManager* task_manager_; 65 TaskManager* task_manager_;
66 66
67 // For every WebContents we maintain an entry, which holds the task manager's 67 // For every WebContents we maintain an entry, which holds the task manager's
68 // RendererResources for that WebContents, and observes the WebContents for 68 // RendererResources for that WebContents, and observes the WebContents for
69 // changes. 69 // changes.
70 EntryMap entries_; 70 EntryMap entries_;
71 71
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_
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/web_contents_information.h ('k') | chrome/browser/task_manager/web_contents_resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698