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

Unified Diff: chrome/renderer/user_script_slave.cc

Issue 457028: Ok, here is a different approach at this change. (Closed)
Patch Set: Be even more paranoid Created 11 years, 1 month 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/renderer/extensions/extension_process_bindings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/user_script_slave.cc
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index 73f25378b210ac9a080d7701cbaeadfdccd55e85..68dec433471cfaedb7ea8e87babf001dbc009167 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -5,12 +5,15 @@
#include "chrome/renderer/user_script_slave.h"
#include "app/resource_bundle.h"
+#include "base/command_line.h"
#include "base/histogram.h"
#include "base/logging.h"
#include "base/perftimer.h"
#include "base/pickle.h"
#include "base/shared_memory.h"
#include "base/string_util.h"
+#include "chrome/common/child_process_logging.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/renderer/extension_groups.h"
@@ -111,6 +114,24 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory) {
}
}
+ // Update the crash reporter with all loaded extensions. In single process,
+ // this has already been done in the browser code.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) {
+ std::vector<std::string> extension_ids;
+ for (size_t i = 0; i < num_scripts; ++i) {
+ DCHECK(!scripts_[i]->extension_id().empty());
+
+ // We must check this because there can be multiple scripts from a single
+ // extension. n^2, but meh, it's a small list.
+ if (std::find(extension_ids.begin(), extension_ids.end(),
+ scripts_[i]->extension_id()) == extension_ids.end()) {
+ extension_ids.push_back(scripts_[i]->extension_id());
+ }
+ }
+
+ child_process_logging::SetActiveExtensions(extension_ids);
+ }
+
return true;
}
« no previous file with comments | « chrome/renderer/extensions/extension_process_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698