| OLD | NEW |
| 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 #include "chrome/browser/extensions/api/processes/processes_api.h" | 5 #include "chrome/browser/extensions/api/processes/processes_api.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 task_manager::REFRESH_TYPE_NETWORK_USAGE | | 53 task_manager::REFRESH_TYPE_NETWORK_USAGE | |
| 54 task_manager::REFRESH_TYPE_SQLITE_MEMORY | | 54 task_manager::REFRESH_TYPE_SQLITE_MEMORY | |
| 55 task_manager::REFRESH_TYPE_V8_MEMORY | | 55 task_manager::REFRESH_TYPE_V8_MEMORY | |
| 56 task_manager::REFRESH_TYPE_WEBCACHE_STATS; | 56 task_manager::REFRESH_TYPE_WEBCACHE_STATS; |
| 57 } | 57 } |
| 58 | 58 |
| 59 std::unique_ptr<api::processes::Cache> CreateCacheData( | 59 std::unique_ptr<api::processes::Cache> CreateCacheData( |
| 60 const blink::WebCache::ResourceTypeStat& stat) { | 60 const blink::WebCache::ResourceTypeStat& stat) { |
| 61 std::unique_ptr<api::processes::Cache> cache(new api::processes::Cache()); | 61 std::unique_ptr<api::processes::Cache> cache(new api::processes::Cache()); |
| 62 cache->size = static_cast<double>(stat.size); | 62 cache->size = static_cast<double>(stat.size); |
| 63 cache->live_size = static_cast<double>(stat.liveSize); | 63 cache->live_size = static_cast<double>(stat.size); |
| 64 return cache; | 64 return cache; |
| 65 } | 65 } |
| 66 | 66 |
| 67 api::processes::ProcessType GetProcessType( | 67 api::processes::ProcessType GetProcessType( |
| 68 task_manager::Task::Type task_type) { | 68 task_manager::Task::Type task_type) { |
| 69 switch (task_type) { | 69 switch (task_type) { |
| 70 case task_manager::Task::BROWSER: | 70 case task_manager::Task::BROWSER: |
| 71 return api::processes::PROCESS_TYPE_BROWSER; | 71 return api::processes::PROCESS_TYPE_BROWSER; |
| 72 | 72 |
| 73 case task_manager::Task::RENDERER: | 73 case task_manager::Task::RENDERER: |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 // Send the response. | 680 // Send the response. |
| 681 Respond(ArgumentList( | 681 Respond(ArgumentList( |
| 682 api::processes::GetProcessInfo::Results::Create(processes))); | 682 api::processes::GetProcessInfo::Results::Create(processes))); |
| 683 | 683 |
| 684 // Stop observing the task manager, and balance the AddRef() in Run(). | 684 // Stop observing the task manager, and balance the AddRef() in Run(). |
| 685 task_manager::TaskManagerInterface::GetTaskManager()->RemoveObserver(this); | 685 task_manager::TaskManagerInterface::GetTaskManager()->RemoveObserver(this); |
| 686 Release(); | 686 Release(); |
| 687 } | 687 } |
| 688 | 688 |
| 689 } // namespace extensions | 689 } // namespace extensions |
| OLD | NEW |