| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/task_management/providers/task.h" | 5 #include "chrome/browser/task_management/providers/task.h" | 
| 6 | 6 | 
| 7 #include "chrome/browser/task_management/task_manager_observer.h" | 7 #include "chrome/browser/task_management/task_manager_observer.h" | 
| 8 | 8 | 
| 9 namespace task_management { | 9 namespace task_management { | 
| 10 | 10 | 
| 11 namespace { | 11 namespace { | 
| 12 | 12 | 
| 13 // The last ID given to the previously created task. | 13 // The last ID given to the previously created task. | 
| 14 int64 g_last_id = 0; | 14 int64 g_last_id = 0; | 
| 15 | 15 | 
| 16 }  // namespace | 16 }  // namespace | 
| 17 | 17 | 
| 18 | 18 | 
| 19 Task::Task(const base::string16& title, | 19 Task::Task(const base::string16& title, | 
|  | 20            const std::string& rappor_sample, | 
| 20            const gfx::ImageSkia* icon, | 21            const gfx::ImageSkia* icon, | 
| 21            base::ProcessHandle handle) | 22            base::ProcessHandle handle) | 
| 22     : task_id_(g_last_id++), | 23     : task_id_(g_last_id++), | 
| 23       network_usage_(-1), | 24       network_usage_(-1), | 
| 24       current_byte_count_(-1), | 25       current_byte_count_(-1), | 
| 25       title_(title), | 26       title_(title), | 
|  | 27       rappor_sample_name_(rappor_sample), | 
| 26       icon_(icon ? *icon : gfx::ImageSkia()), | 28       icon_(icon ? *icon : gfx::ImageSkia()), | 
| 27       process_handle_(handle), | 29       process_handle_(handle), | 
| 28       process_id_(base::GetProcId(handle)) { | 30       process_id_(base::GetProcId(handle)) { | 
| 29 } | 31 } | 
| 30 | 32 | 
| 31 Task::~Task() { | 33 Task::~Task() { | 
| 32 } | 34 } | 
| 33 | 35 | 
| 34 void Task::Activate() { | 36 void Task::Activate() { | 
| 35 } | 37 } | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 86 | 88 | 
| 87 blink::WebCache::ResourceTypeStats Task::GetWebCacheStats() const { | 89 blink::WebCache::ResourceTypeStats Task::GetWebCacheStats() const { | 
| 88   return blink::WebCache::ResourceTypeStats(); | 90   return blink::WebCache::ResourceTypeStats(); | 
| 89 } | 91 } | 
| 90 | 92 | 
| 91 bool Task::ReportsNetworkUsage() const { | 93 bool Task::ReportsNetworkUsage() const { | 
| 92   return network_usage_ != -1; | 94   return network_usage_ != -1; | 
| 93 } | 95 } | 
| 94 | 96 | 
| 95 }  // namespace task_management | 97 }  // namespace task_management | 
| OLD | NEW | 
|---|