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

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

Issue 8391039: TaskManager: introduce Resource::(Can)Inspect; support tabs, apps, extensions and notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self-review. Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 virtual bool ReportsCacheStats() const OVERRIDE; 43 virtual bool ReportsCacheStats() const OVERRIDE;
44 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const 44 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const
45 OVERRIDE; 45 OVERRIDE;
46 virtual bool ReportsFPS() const OVERRIDE; 46 virtual bool ReportsFPS() const OVERRIDE;
47 virtual float GetFPS() const OVERRIDE; 47 virtual float GetFPS() const OVERRIDE;
48 virtual bool ReportsV8MemoryStats() const OVERRIDE; 48 virtual bool ReportsV8MemoryStats() const OVERRIDE;
49 virtual size_t GetV8MemoryAllocated() const OVERRIDE; 49 virtual size_t GetV8MemoryAllocated() const OVERRIDE;
50 virtual size_t GetV8MemoryUsed() const OVERRIDE; 50 virtual size_t GetV8MemoryUsed() const OVERRIDE;
51 51
52 // RenderResources are always inspectable.
53 virtual bool CanInspect() const OVERRIDE;
54 virtual void Inspect() const OVERRIDE;
55
52 // RenderResources always provide the network usage. 56 // RenderResources always provide the network usage.
53 virtual bool SupportNetworkUsage() const; 57 virtual bool SupportNetworkUsage() const;
54 virtual void SetSupportNetworkUsage() { } 58 virtual void SetSupportNetworkUsage() { }
55 59
56 virtual void Refresh(); 60 virtual void Refresh();
57 61
58 virtual void NotifyResourceTypeStats( 62 virtual void NotifyResourceTypeStats(
59 const WebKit::WebCache::ResourceTypeStats& stats); 63 const WebKit::WebCache::ResourceTypeStats& stats);
60 64
61 virtual void NotifyFPS(float fps); 65 virtual void NotifyFPS(float fps);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 public: 323 public:
320 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host); 324 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host);
321 virtual ~TaskManagerExtensionProcessResource(); 325 virtual ~TaskManagerExtensionProcessResource();
322 326
323 // TaskManager::Resource methods: 327 // TaskManager::Resource methods:
324 virtual string16 GetTitle() const OVERRIDE; 328 virtual string16 GetTitle() const OVERRIDE;
325 virtual string16 GetProfileName() const OVERRIDE; 329 virtual string16 GetProfileName() const OVERRIDE;
326 virtual SkBitmap GetIcon() const OVERRIDE; 330 virtual SkBitmap GetIcon() const OVERRIDE;
327 virtual base::ProcessHandle GetProcess() const OVERRIDE; 331 virtual base::ProcessHandle GetProcess() const OVERRIDE;
328 virtual Type GetType() const OVERRIDE; 332 virtual Type GetType() const OVERRIDE;
333 virtual bool CanInspect() const OVERRIDE;
334 virtual void Inspect() const OVERRIDE;
329 virtual bool SupportNetworkUsage() const OVERRIDE; 335 virtual bool SupportNetworkUsage() const OVERRIDE;
330 virtual void SetSupportNetworkUsage() OVERRIDE; 336 virtual void SetSupportNetworkUsage() OVERRIDE;
331 virtual const Extension* GetExtension() const OVERRIDE; 337 virtual const Extension* GetExtension() const OVERRIDE;
332 338
333 // Returns the pid of the extension process. 339 // Returns the pid of the extension process.
334 int process_id() const { return pid_; } 340 int process_id() const { return pid_; }
335 341
336 // Returns true if the associated extension has a background page. 342 // Returns true if the associated extension has a background page.
337 virtual bool IsBackground() const; 343 virtual bool IsBackground() const;
338 344
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 public: 401 public:
396 explicit TaskManagerNotificationResource(BalloonHost* balloon_host); 402 explicit TaskManagerNotificationResource(BalloonHost* balloon_host);
397 virtual ~TaskManagerNotificationResource(); 403 virtual ~TaskManagerNotificationResource();
398 404
399 // TaskManager::Resource interface 405 // TaskManager::Resource interface
400 virtual string16 GetTitle() const OVERRIDE; 406 virtual string16 GetTitle() const OVERRIDE;
401 virtual string16 GetProfileName() const OVERRIDE; 407 virtual string16 GetProfileName() const OVERRIDE;
402 virtual SkBitmap GetIcon() const OVERRIDE; 408 virtual SkBitmap GetIcon() const OVERRIDE;
403 virtual base::ProcessHandle GetProcess() const OVERRIDE; 409 virtual base::ProcessHandle GetProcess() const OVERRIDE;
404 virtual Type GetType() const OVERRIDE; 410 virtual Type GetType() const OVERRIDE;
411 virtual bool CanInspect() const OVERRIDE;
412 virtual void Inspect() const OVERRIDE;
405 virtual bool SupportNetworkUsage() const OVERRIDE; 413 virtual bool SupportNetworkUsage() const OVERRIDE;
406 virtual void SetSupportNetworkUsage() OVERRIDE { } 414 virtual void SetSupportNetworkUsage() OVERRIDE { }
407 415
408 private: 416 private:
409 // The icon painted for notifications. . 417 // The icon painted for notifications. .
410 static SkBitmap* default_icon_; 418 static SkBitmap* default_icon_;
411 419
412 // Non-owned pointer to the balloon host. 420 // Non-owned pointer to the balloon host.
413 BalloonHost* balloon_host_; 421 BalloonHost* balloon_host_;
414 422
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 519
512 void AddToTaskManager(ChildProcessInfo child_process_info); 520 void AddToTaskManager(ChildProcessInfo child_process_info);
513 521
514 TaskManager* task_manager_; 522 TaskManager* task_manager_;
515 TaskManagerBrowserProcessResource resource_; 523 TaskManagerBrowserProcessResource resource_;
516 524
517 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); 525 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider);
518 }; 526 };
519 527
520 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ 528 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698