| 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/memory_details.h" | 5 #include "chrome/browser/memory_details.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 DCHECK(render_process_host); | 233 DCHECK(render_process_host); |
| 234 // Ignore processes that don't have a connection, such as crashed tabs. | 234 // Ignore processes that don't have a connection, such as crashed tabs. |
| 235 if (!render_process_host->HasConnection() || | 235 if (!render_process_host->HasConnection() || |
| 236 process.pid != base::GetProcId(render_process_host->GetHandle())) { | 236 process.pid != base::GetProcId(render_process_host->GetHandle())) { |
| 237 continue; | 237 continue; |
| 238 } | 238 } |
| 239 | 239 |
| 240 // The RenderProcessHost may host multiple WebContentses. Any | 240 // The RenderProcessHost may host multiple WebContentses. Any |
| 241 // of them which contain diagnostics information make the whole | 241 // of them which contain diagnostics information make the whole |
| 242 // process be considered a diagnostics process. | 242 // process be considered a diagnostics process. |
| 243 if (!widget->IsRenderView()) | 243 RenderViewHost* host = RenderViewHost::From(widget); |
| 244 if (!host) |
| 244 continue; | 245 continue; |
| 245 | 246 |
| 246 process.process_type = content::PROCESS_TYPE_RENDERER; | 247 process.process_type = content::PROCESS_TYPE_RENDERER; |
| 247 bool is_extension = false; | 248 bool is_extension = false; |
| 248 RenderViewHost* host = RenderViewHost::From(widget); | |
| 249 #if defined(ENABLE_EXTENSIONS) | 249 #if defined(ENABLE_EXTENSIONS) |
| 250 content::BrowserContext* context = | 250 content::BrowserContext* context = |
| 251 render_process_host->GetBrowserContext(); | 251 render_process_host->GetBrowserContext(); |
| 252 extensions::ExtensionRegistry* extension_registry = | 252 extensions::ExtensionRegistry* extension_registry = |
| 253 extensions::ExtensionRegistry::Get(context); | 253 extensions::ExtensionRegistry::Get(context); |
| 254 extensions::ProcessMap* extension_process_map = | 254 extensions::ProcessMap* extension_process_map = |
| 255 extensions::ProcessMap::Get(context); | 255 extensions::ProcessMap::Get(context); |
| 256 is_extension = extension_process_map->Contains( | 256 is_extension = extension_process_map->Contains( |
| 257 host->GetProcess()->GetID()); | 257 host->GetProcess()->GetID()); |
| 258 #endif | 258 #endif |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 if (chrome_browser->processes[index].process_type == | 368 if (chrome_browser->processes[index].process_type == |
| 369 content::PROCESS_TYPE_UNKNOWN) { | 369 content::PROCESS_TYPE_UNKNOWN) { |
| 370 chrome_browser->processes.erase( | 370 chrome_browser->processes.erase( |
| 371 chrome_browser->processes.begin() + index); | 371 chrome_browser->processes.begin() + index); |
| 372 index--; | 372 index--; |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 | 375 |
| 376 OnDetailsAvailable(); | 376 OnDetailsAvailable(); |
| 377 } | 377 } |
| OLD | NEW |