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

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 10908130: Revert 155122 - Code to collect issue 97285 debugging info for crash reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « no previous file | content/browser/plugin_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main_delegate.cc
===================================================================
--- chrome/app/chrome_main_delegate.cc (revision 155239)
+++ chrome/app/chrome_main_delegate.cc (working copy)
@@ -30,7 +30,6 @@
#include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/utility/chrome_content_utility_client.h"
#include "content/public/common/content_client.h"
-#include "content/public/common/content_debug_logging.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "ui/base/ui_base_switches.h"
@@ -370,46 +369,6 @@
int (*function)(const content::MainFunctionParams&);
};
-// Limit message count and size to prevent rogue processes from
-// bloating memory use.
-const size_t kMaxBugMessages = 20;
-const size_t kMaxMessageSize = 64;
-
-// Locks g_messages.
-static base::LazyInstance<base::Lock>::Leaky
- g_messages_lock = LAZY_INSTANCE_INITIALIZER;
-
-// Map bug ids to messages for that bug.
-// TODO(shess): Would multimap<> maintain the items in order added?
-base::LazyInstance<std::map<int, std::vector<std::string> > >
- g_messages = LAZY_INSTANCE_INITIALIZER;
-
-void RecordMsg(int bug_id, const std::string& msg) {
- // Only record information about specific bugs to prevent rogue
- // processes from bloating memory usage.
- CHECK(bug_id == 97285 || bug_id == 141055);
-
- // Make sure legitimate clients know that things are getting too big
- // to handle.
- DCHECK_LE(msg.size(), kMaxMessageSize);
-
- base::AutoLock pin(g_messages_lock.Get());
- std::vector<std::string>& bug_messages = g_messages.Get()[bug_id];
- bug_messages.push_back(msg.substr(0, kMaxMessageSize));
-
- // Should only remove a single item.
- while (bug_messages.size() > kMaxBugMessages)
- bug_messages.erase(bug_messages.begin());
-}
-
-bool GetMessages(int bug_id, std::vector<std::string>* msgs) {
- CHECK(bug_id == 97285 || bug_id == 141055);
-
- base::AutoLock pin(g_messages_lock.Get());
- *msgs = g_messages.Get()[bug_id];
- return !msgs->empty();
-}
-
} // namespace
ChromeMainDelegate::ChromeMainDelegate() {
@@ -566,10 +525,6 @@
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
- // TODO(shess): Could this be registered earlier?
- if (process_type.empty())
- content::debug::RegisterMessageHandlers(RecordMsg, GetMessages);
-
chrome::RegisterPathProvider();
#if defined(OS_MACOSX)
« no previous file with comments | « no previous file | content/browser/plugin_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698