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

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

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_TASK_MANAGER_RESOURCE_PROVIDERS_H_ 5 #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_
6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 bool pending_fps_update_; 98 bool pending_fps_update_;
99 99
100 // We do a similar dance to gather the V8 memory usage in a process. 100 // We do a similar dance to gather the V8 memory usage in a process.
101 size_t v8_memory_allocated_; 101 size_t v8_memory_allocated_;
102 size_t v8_memory_used_; 102 size_t v8_memory_used_;
103 bool pending_v8_memory_allocated_update_; 103 bool pending_v8_memory_allocated_update_;
104 104
105 DISALLOW_COPY_AND_ASSIGN(TaskManagerRendererResource); 105 DISALLOW_COPY_AND_ASSIGN(TaskManagerRendererResource);
106 }; 106 };
107 107
108 // Tracks a single tab contents, prerendered page, instant page, or background 108 // Tracks a single tab contents, prerendered page, Instant page, or background
109 // printing page. 109 // printing page.
110 class TaskManagerTabContentsResource : public TaskManagerRendererResource { 110 class TaskManagerTabContentsResource : public TaskManagerRendererResource {
111 public: 111 public:
112 explicit TaskManagerTabContentsResource(content::WebContents* web_contents); 112 explicit TaskManagerTabContentsResource(content::WebContents* web_contents);
113 virtual ~TaskManagerTabContentsResource(); 113 virtual ~TaskManagerTabContentsResource();
114 114
115 // Called when the underlying web_contents has been committed and is no 115 // Called when the underlying web_contents has been committed and is no
116 // longer an Instant preview. 116 // longer an Instant overlay.
117 void InstantCommitted(); 117 void InstantCommitted();
118 118
119 // TaskManager::Resource methods: 119 // TaskManager::Resource methods:
120 virtual Type GetType() const OVERRIDE; 120 virtual Type GetType() const OVERRIDE;
121 virtual string16 GetTitle() const OVERRIDE; 121 virtual string16 GetTitle() const OVERRIDE;
122 virtual string16 GetProfileName() const OVERRIDE; 122 virtual string16 GetProfileName() const OVERRIDE;
123 virtual gfx::ImageSkia GetIcon() const OVERRIDE; 123 virtual gfx::ImageSkia GetIcon() const OVERRIDE;
124 virtual content::WebContents* GetWebContents() const OVERRIDE; 124 virtual content::WebContents* GetWebContents() const OVERRIDE;
125 virtual const extensions::Extension* GetExtension() const OVERRIDE; 125 virtual const extensions::Extension* GetExtension() const OVERRIDE;
126 126
127 private: 127 private:
128 // Returns true if contains content rendered by an extension. 128 // Returns true if contains content rendered by an extension.
129 bool HostsExtension() const; 129 bool HostsExtension() const;
130 130
131 static gfx::ImageSkia* prerender_icon_; 131 static gfx::ImageSkia* prerender_icon_;
132 content::WebContents* web_contents_; 132 content::WebContents* web_contents_;
133 Profile* profile_; 133 Profile* profile_;
134 bool is_instant_preview_; 134 bool is_instant_overlay_;
135 135
136 DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResource); 136 DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResource);
137 }; 137 };
138 138
139 // Provides resources for tab contents, prerendered pages, instant pages, and 139 // Provides resources for tab contents, prerendered pages, Instant pages, and
140 // background printing pages. 140 // background printing pages.
141 class TaskManagerTabContentsResourceProvider 141 class TaskManagerTabContentsResourceProvider
142 : public TaskManager::ResourceProvider, 142 : public TaskManager::ResourceProvider,
143 public content::NotificationObserver { 143 public content::NotificationObserver {
144 public: 144 public:
145 explicit TaskManagerTabContentsResourceProvider(TaskManager* task_manager); 145 explicit TaskManagerTabContentsResourceProvider(TaskManager* task_manager);
146 146
147 virtual TaskManager::Resource* GetResource(int origin_pid, 147 virtual TaskManager::Resource* GetResource(int origin_pid,
148 int render_process_host_id, 148 int render_process_host_id,
149 int routing_id) OVERRIDE; 149 int routing_id) OVERRIDE;
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 private: 618 private:
619 virtual ~TaskManagerBrowserProcessResourceProvider(); 619 virtual ~TaskManagerBrowserProcessResourceProvider();
620 620
621 TaskManager* task_manager_; 621 TaskManager* task_manager_;
622 TaskManagerBrowserProcessResource resource_; 622 TaskManagerBrowserProcessResource resource_;
623 623
624 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); 624 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider);
625 }; 625 };
626 626
627
628 class TaskManagerGuestResource : public TaskManagerRendererResource { 627 class TaskManagerGuestResource : public TaskManagerRendererResource {
629 public: 628 public:
630 explicit TaskManagerGuestResource(content::RenderViewHost* render_view_host); 629 explicit TaskManagerGuestResource(content::RenderViewHost* render_view_host);
631 virtual ~TaskManagerGuestResource(); 630 virtual ~TaskManagerGuestResource();
632 631
633 // TaskManager::Resource methods: 632 // TaskManager::Resource methods:
634 virtual Type GetType() const OVERRIDE; 633 virtual Type GetType() const OVERRIDE;
635 virtual string16 GetTitle() const OVERRIDE; 634 virtual string16 GetTitle() const OVERRIDE;
636 virtual string16 GetProfileName() const OVERRIDE; 635 virtual string16 GetProfileName() const OVERRIDE;
637 virtual gfx::ImageSkia GetIcon() const OVERRIDE; 636 virtual gfx::ImageSkia GetIcon() const OVERRIDE;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 TaskManagerGuestResource*> GuestResourceMap; 675 TaskManagerGuestResource*> GuestResourceMap;
677 GuestResourceMap resources_; 676 GuestResourceMap resources_;
678 677
679 // A scoped container for notification registries. 678 // A scoped container for notification registries.
680 content::NotificationRegistrar registrar_; 679 content::NotificationRegistrar registrar_;
681 680
682 DISALLOW_COPY_AND_ASSIGN(TaskManagerGuestResourceProvider); 681 DISALLOW_COPY_AND_ASSIGN(TaskManagerGuestResourceProvider);
683 }; 682 };
684 683
685 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ 684 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698