Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Unified Diff: chrome/browser/memory_details.cc

Issue 27238: Clean up some style and organization in the browser about handler. No code... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_url_handler.cc ('k') | chrome/browser/tab_contents/navigation_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory_details.cc
===================================================================
--- chrome/browser/memory_details.cc (revision 10892)
+++ chrome/browser/memory_details.cc (working copy)
@@ -10,8 +10,10 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/renderer_host/render_process_host.h"
+#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/common/child_process_host.h"
+#include "chrome/common/url_constants.h"
class RenderViewHostDelegate;
@@ -180,8 +182,7 @@
// Check if it's a renderer, if so get the list of page titles in it and
// check if it's a diagnostics-related process. We skip all diagnostics
// pages (e.g. "about:xxx" URLs). Iterate the RenderProcessHosts to find
- // the tab contents. If it is of type TAB_CONTENTS_ABOUT_UI, mark the
- // process as diagnostics related.
+ // the tab contents.
RenderProcessHost::iterator renderer_iter;
for (renderer_iter = RenderProcessHost::begin(); renderer_iter !=
RenderProcessHost::end(); ++renderer_iter) {
@@ -217,7 +218,28 @@
if (!title.length())
title = L"Untitled";
process.titles.push_back(title);
- if (contents->type() == TAB_CONTENTS_ABOUT_UI)
+
+ // We need to check the pending entry as well as the pending entry to
+ // see if it's an about:memory URL (we don't want to count these in the
+ // total memory usage of the browser).
+ //
+ // When we reach here, about:memory will be the pending entry since we
+ // haven't responded with any data such that it would be committed. If
+ // you have another about:memory tab open (which would be committed),
+ // we don't want to count it either, so we also check the last committed
+ // entry.
+ //
+ // Either the pending or last committed entries can be NULL.
+ const NavigationEntry* pending_entry = NULL;
+ //contents->controller()->GetPendingEntry();
+ const NavigationEntry* last_committed_entry =
+ contents->controller()->GetLastCommittedEntry();
+ if ((last_committed_entry &&
+ LowerCaseEqualsASCII(last_committed_entry->display_url().spec(),
+ chrome::kAboutMemoryURL)) ||
+ (pending_entry &&
+ LowerCaseEqualsASCII(pending_entry->display_url().spec(),
+ chrome::kAboutMemoryURL)))
process.is_diagnostics = true;
}
}
« no previous file with comments | « chrome/browser/browser_url_handler.cc ('k') | chrome/browser/tab_contents/navigation_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698