Commit 267b493d authored by avayvod@chromium.org's avatar avayvod@chromium.org

Check for NULL extension_service and extension_process_map for Android platform

BUG=153582
TEST=None


Review URL: https://chromiumcodereview.appspot.com/11013031

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161374 0039d316-1c4b-4281-b951-d872f2087c98
parent 435d1ac5
...@@ -227,8 +227,10 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -227,8 +227,10 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
Profile::FromBrowserContext( Profile::FromBrowserContext(
render_process_host->GetBrowserContext()); render_process_host->GetBrowserContext());
ExtensionService* extension_service = profile->GetExtensionService(); ExtensionService* extension_service = profile->GetExtensionService();
extensions::ProcessMap* extension_process_map = extensions::ProcessMap* extension_process_map = NULL;
extension_service->process_map(); // No extensions on Android. So extension_service can be NULL.
if (extension_service)
extension_process_map = extension_service->process_map();
// The RenderProcessHost may host multiple WebContentses. Any // The RenderProcessHost may host multiple WebContentses. Any
// of them which contain diagnostics information make the whole // of them which contain diagnostics information make the whole
...@@ -250,8 +252,8 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -250,8 +252,8 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
chrome::ViewType type = chrome::GetViewType(contents); chrome::ViewType type = chrome::GetViewType(contents);
if (host->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI) { if (host->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI) {
process.renderer_type = ProcessMemoryInformation::RENDERER_CHROME; process.renderer_type = ProcessMemoryInformation::RENDERER_CHROME;
} else if (extension_process_map->Contains( } else if (extension_process_map &&
host->GetProcess()->GetID())) { extension_process_map->Contains(host->GetProcess()->GetID())) {
// For our purposes, don't count processes containing only hosted apps // For our purposes, don't count processes containing only hosted apps
// as extension processes. See also: crbug.com/102533. // as extension processes. See also: crbug.com/102533.
std::set<std::string> extension_ids = std::set<std::string> extension_ids =
...@@ -268,7 +270,8 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -268,7 +270,8 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
} }
} }
} }
if (extension_process_map->Contains(host->GetProcess()->GetID())) { if (extension_process_map &&
extension_process_map->Contains(host->GetProcess()->GetID())) {
const Extension* extension = const Extension* extension =
extension_service->extensions()->GetByID(url.host()); extension_service->extensions()->GetByID(url.host());
if (extension) { if (extension) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment