| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/lock.h" | 14 #include "base/lock.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
| 17 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
| 18 #include "base/singleton.h" | 18 #include "base/singleton.h" |
| 19 #include "base/timer.h" | 19 #include "base/timer.h" |
| 20 #include "chrome/browser/renderer_host/web_cache_manager.h" | 20 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 21 #include "chrome/browser/tab_contents/tab_contents.h" | 21 #include "chrome/browser/tab_contents/tab_contents.h" |
| 22 #include "net/url_request/url_request_job_tracker.h" | 22 #include "net/url_request/url_request_job_tracker.h" |
| 23 #include "testing/gtest/include/gtest/gtest_prod.h" | 23 #include "testing/gtest/include/gtest/gtest_prod.h" |
| 24 #include "webkit/api/public/WebCache.h" | 24 #include "webkit/api/public/WebCache.h" |
| 25 | 25 |
| 26 class Extension; |
| 26 class MessageLoop; | 27 class MessageLoop; |
| 27 class SkBitmap; | 28 class SkBitmap; |
| 28 class TaskManager; | 29 class TaskManager; |
| 29 class TaskManagerModel; | 30 class TaskManagerModel; |
| 30 | 31 |
| 31 struct BytesReadParam; | 32 struct BytesReadParam; |
| 32 | 33 |
| 33 namespace base { | 34 namespace base { |
| 34 class ProcessMetrics; | 35 class ProcessMetrics; |
| 35 } | 36 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 48 virtual base::ProcessHandle GetProcess() const = 0; | 49 virtual base::ProcessHandle GetProcess() const = 0; |
| 49 | 50 |
| 50 virtual bool ReportsCacheStats() const { return false; } | 51 virtual bool ReportsCacheStats() const { return false; } |
| 51 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const { | 52 virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const { |
| 52 return WebKit::WebCache::ResourceTypeStats(); | 53 return WebKit::WebCache::ResourceTypeStats(); |
| 53 } | 54 } |
| 54 | 55 |
| 55 virtual bool ReportsSqliteMemoryUsed() const { return false; } | 56 virtual bool ReportsSqliteMemoryUsed() const { return false; } |
| 56 virtual size_t SqliteMemoryUsedBytes() const { return 0; } | 57 virtual size_t SqliteMemoryUsedBytes() const { return 0; } |
| 57 | 58 |
| 59 // Return extension associated with the resource, or NULL |
| 60 // if not applicable. |
| 61 virtual const Extension* GetExtension() const { return NULL; } |
| 62 |
| 58 // A helper function for ActivateFocusedTab. Returns NULL by default | 63 // A helper function for ActivateFocusedTab. Returns NULL by default |
| 59 // because not all resources have an assoiciated tab. | 64 // because not all resources have an associated tab. |
| 60 virtual TabContents* GetTabContents() const { return NULL; } | 65 virtual TabContents* GetTabContents() const { return NULL; } |
| 61 | 66 |
| 62 // Whether this resource does report the network usage accurately. | 67 // Whether this resource does report the network usage accurately. |
| 63 // This controls whether 0 or N/A is displayed when no bytes have been | 68 // This controls whether 0 or N/A is displayed when no bytes have been |
| 64 // reported as being read. This is because some plugins do not report the | 69 // reported as being read. This is because some plugins do not report the |
| 65 // bytes read and we don't want to display a misleading 0 value in that | 70 // bytes read and we don't want to display a misleading 0 value in that |
| 66 // case. | 71 // case. |
| 67 virtual bool SupportNetworkUsage() const = 0; | 72 virtual bool SupportNetworkUsage() const = 0; |
| 68 | 73 |
| 69 // Called when some bytes have been read and support_network_usage returns | 74 // Called when some bytes have been read and support_network_usage returns |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // Returns -1 if value in |row1| is less than value in |row2|, | 216 // Returns -1 if value in |row1| is less than value in |row2|, |
| 212 // 0 if they are equal, and 1 otherwise. | 217 // 0 if they are equal, and 1 otherwise. |
| 213 int CompareValues(int row1, int row2, int col_id) const; | 218 int CompareValues(int row1, int row2, int col_id) const; |
| 214 | 219 |
| 215 // Returns process handle for given resource. | 220 // Returns process handle for given resource. |
| 216 base::ProcessHandle GetResourceProcessHandle(int index) const; | 221 base::ProcessHandle GetResourceProcessHandle(int index) const; |
| 217 | 222 |
| 218 // Returns TabContents of given resource or NULL if not applicable. | 223 // Returns TabContents of given resource or NULL if not applicable. |
| 219 TabContents* GetResourceTabContents(int index) const; | 224 TabContents* GetResourceTabContents(int index) const; |
| 220 | 225 |
| 226 // Returns Extension of given resource or NULL if not applicable. |
| 227 const Extension* GetResourceExtension(int index) const; |
| 228 |
| 221 // JobObserver methods: | 229 // JobObserver methods: |
| 222 void OnJobAdded(URLRequestJob* job); | 230 void OnJobAdded(URLRequestJob* job); |
| 223 void OnJobRemoved(URLRequestJob* job); | 231 void OnJobRemoved(URLRequestJob* job); |
| 224 void OnJobDone(URLRequestJob* job, const URLRequestStatus& status); | 232 void OnJobDone(URLRequestJob* job, const URLRequestStatus& status); |
| 225 void OnJobRedirect(URLRequestJob* job, const GURL& location, int status_code); | 233 void OnJobRedirect(URLRequestJob* job, const GURL& location, int status_code); |
| 226 void OnBytesRead(URLRequestJob* job, int byte_count); | 234 void OnBytesRead(URLRequestJob* job, int byte_count); |
| 227 | 235 |
| 228 void AddResourceProvider(TaskManager::ResourceProvider* provider); | 236 void AddResourceProvider(TaskManager::ResourceProvider* provider); |
| 229 void RemoveResourceProvider(TaskManager::ResourceProvider* provider); | 237 void RemoveResourceProvider(TaskManager::ResourceProvider* provider); |
| 230 | 238 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // Whether we are currently in the process of updating. | 375 // Whether we are currently in the process of updating. |
| 368 UpdateState update_state_; | 376 UpdateState update_state_; |
| 369 | 377 |
| 370 // See design doc at http://go/at-teleporter for more information. | 378 // See design doc at http://go/at-teleporter for more information. |
| 371 static int goats_teleported_; | 379 static int goats_teleported_; |
| 372 | 380 |
| 373 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 381 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
| 374 }; | 382 }; |
| 375 | 383 |
| 376 #endif // CHROME_BROWSER_TASK_MANAGER_H_ | 384 #endif // CHROME_BROWSER_TASK_MANAGER_H_ |
| OLD | NEW |