| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RESOURCE_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 virtual string16 GetTitle() const = 0; | 59 virtual string16 GetTitle() const = 0; |
| 60 virtual string16 GetProfileName() const = 0; | 60 virtual string16 GetProfileName() const = 0; |
| 61 virtual gfx::ImageSkia GetIcon() const = 0; | 61 virtual gfx::ImageSkia GetIcon() const = 0; |
| 62 virtual base::ProcessHandle GetProcess() const = 0; | 62 virtual base::ProcessHandle GetProcess() const = 0; |
| 63 virtual int GetUniqueChildProcessId() const = 0; | 63 virtual int GetUniqueChildProcessId() const = 0; |
| 64 virtual Type GetType() const = 0; | 64 virtual Type GetType() const = 0; |
| 65 virtual int GetRoutingID() const; | 65 virtual int GetRoutingID() const; |
| 66 | 66 |
| 67 virtual bool ReportsCacheStats() const; | 67 virtual bool ReportsCacheStats() const; |
| 68 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; | 68 virtual blink::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; |
| 69 | 69 |
| 70 virtual bool ReportsFPS() const; | 70 virtual bool ReportsFPS() const; |
| 71 virtual float GetFPS() const; | 71 virtual float GetFPS() const; |
| 72 | 72 |
| 73 virtual bool ReportsSqliteMemoryUsed() const; | 73 virtual bool ReportsSqliteMemoryUsed() const; |
| 74 virtual size_t SqliteMemoryUsedBytes() const; | 74 virtual size_t SqliteMemoryUsedBytes() const; |
| 75 | 75 |
| 76 // Return extension associated with the resource, or NULL if not applicable. | 76 // Return extension associated with the resource, or NULL if not applicable. |
| 77 virtual const extensions::Extension* GetExtension() const; | 77 virtual const extensions::Extension* GetExtension() const; |
| 78 | 78 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 100 | 100 |
| 101 // Called when some bytes have been read and support_network_usage returns | 101 // Called when some bytes have been read and support_network_usage returns |
| 102 // false (meaning we do have network usage support). | 102 // false (meaning we do have network usage support). |
| 103 virtual void SetSupportNetworkUsage() = 0; | 103 virtual void SetSupportNetworkUsage() = 0; |
| 104 | 104 |
| 105 // The TaskManagerModel periodically refreshes its data and call this | 105 // The TaskManagerModel periodically refreshes its data and call this |
| 106 // on all live resources. | 106 // on all live resources. |
| 107 virtual void Refresh() {} | 107 virtual void Refresh() {} |
| 108 | 108 |
| 109 virtual void NotifyResourceTypeStats( | 109 virtual void NotifyResourceTypeStats( |
| 110 const WebKit::WebCache::ResourceTypeStats& stats) {} | 110 const blink::WebCache::ResourceTypeStats& stats) {} |
| 111 virtual void NotifyFPS(float fps) {} | 111 virtual void NotifyFPS(float fps) {} |
| 112 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, | 112 virtual void NotifyV8HeapStats(size_t v8_memory_allocated, |
| 113 size_t v8_memory_used) {} | 113 size_t v8_memory_used) {} |
| 114 | 114 |
| 115 // Returns true if this resource is not visible to the user because it lives | 115 // Returns true if this resource is not visible to the user because it lives |
| 116 // in the background (e.g. extension background page, background contents). | 116 // in the background (e.g. extension background page, background contents). |
| 117 virtual bool IsBackground() const; | 117 virtual bool IsBackground() const; |
| 118 | 118 |
| 119 static const char* GetResourceTypeAsString(const Type type) { | 119 static const char* GetResourceTypeAsString(const Type type) { |
| 120 switch (type) { | 120 switch (type) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 protected: | 166 protected: |
| 167 friend class base::RefCountedThreadSafe<ResourceProvider>; | 167 friend class base::RefCountedThreadSafe<ResourceProvider>; |
| 168 | 168 |
| 169 virtual ~ResourceProvider() {} | 169 virtual ~ResourceProvider() {} |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 } // namespace task_manager | 172 } // namespace task_manager |
| 173 | 173 |
| 174 #endif // CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ | 174 #endif // CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ |
| OLD | NEW |