Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/task_manager/task_manager_resource_providers.h" | 5 #include "chrome/browser/task_manager/task_manager_resource_providers.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1681 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1681 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1682 bool using_v8 = !command_line->HasSwitch(switches::kWinHttpProxyResolver); | 1682 bool using_v8 = !command_line->HasSwitch(switches::kWinHttpProxyResolver); |
| 1683 if (using_v8 && command_line->HasSwitch(switches::kSingleProcess)) { | 1683 if (using_v8 && command_line->HasSwitch(switches::kSingleProcess)) { |
| 1684 using_v8 = false; | 1684 using_v8 = false; |
| 1685 } | 1685 } |
| 1686 return using_v8; | 1686 return using_v8; |
| 1687 } | 1687 } |
| 1688 | 1688 |
| 1689 size_t TaskManagerBrowserProcessResource::GetV8MemoryAllocated() const { | 1689 size_t TaskManagerBrowserProcessResource::GetV8MemoryAllocated() const { |
| 1690 v8::HeapStatistics stats; | 1690 v8::HeapStatistics stats; |
| 1691 v8::V8::GetHeapStatistics(&stats); | 1691 v8::Isolate::GetCurrent()->GetHeapStatistics(&stats); |
|
jochen (gone - plz use gerrit)
2013/03/04 13:51:25
in the browser process, the only v8 embedder is th
Sven Panne
2013/03/04 15:01:46
I'll add a static method to retrieve heap statisti
| |
| 1692 return stats.total_heap_size(); | 1692 return stats.total_heap_size(); |
| 1693 } | 1693 } |
| 1694 | 1694 |
| 1695 size_t TaskManagerBrowserProcessResource::GetV8MemoryUsed() const { | 1695 size_t TaskManagerBrowserProcessResource::GetV8MemoryUsed() const { |
| 1696 v8::HeapStatistics stats; | 1696 v8::HeapStatistics stats; |
| 1697 v8::V8::GetHeapStatistics(&stats); | 1697 v8::Isolate::GetCurrent()->GetHeapStatistics(&stats); |
| 1698 return stats.used_heap_size(); | 1698 return stats.used_heap_size(); |
| 1699 } | 1699 } |
| 1700 | 1700 |
| 1701 //////////////////////////////////////////////////////////////////////////////// | 1701 //////////////////////////////////////////////////////////////////////////////// |
| 1702 // TaskManagerBrowserProcessResourceProvider class | 1702 // TaskManagerBrowserProcessResourceProvider class |
| 1703 //////////////////////////////////////////////////////////////////////////////// | 1703 //////////////////////////////////////////////////////////////////////////////// |
| 1704 | 1704 |
| 1705 TaskManagerBrowserProcessResourceProvider:: | 1705 TaskManagerBrowserProcessResourceProvider:: |
| 1706 TaskManagerBrowserProcessResourceProvider(TaskManager* task_manager) | 1706 TaskManagerBrowserProcessResourceProvider(TaskManager* task_manager) |
| 1707 : updating_(false), | 1707 : updating_(false), |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1898 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: | 1898 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: |
| 1899 Add(web_contents->GetRenderViewHost()); | 1899 Add(web_contents->GetRenderViewHost()); |
| 1900 break; | 1900 break; |
| 1901 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: | 1901 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: |
| 1902 Remove(web_contents->GetRenderViewHost()); | 1902 Remove(web_contents->GetRenderViewHost()); |
| 1903 break; | 1903 break; |
| 1904 default: | 1904 default: |
| 1905 NOTREACHED() << "Unexpected notification."; | 1905 NOTREACHED() << "Unexpected notification."; |
| 1906 } | 1906 } |
| 1907 } | 1907 } |
| OLD | NEW |