summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/user_script_slave.cc
diff options
context:
space:
mode:
authormal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 07:53:02 +0000
committermal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 07:53:02 +0000
commitd5f4552839b7339d68915698cb15298f7146eeb0 (patch)
treecc9511564e750a7ab99830c7d7146aebb567f59a /chrome/renderer/user_script_slave.cc
parent76e32220fbeb1e76fc14568110a94a970da54158 (diff)
downloadchromium_src-d5f4552839b7339d68915698cb15298f7146eeb0.zip
chromium_src-d5f4552839b7339d68915698cb15298f7146eeb0.tar.gz
chromium_src-d5f4552839b7339d68915698cb15298f7146eeb0.tar.bz2
Merge 33541 - Ok, here is a different approach at this change.
Instead of storing pointers into a vector, store offsets. That way, if the vector resizes, we should still be OK. Also, add a DCHECK that we only enter this method once, which is my current assumption. Review URL: http://codereview.chromium.org/457028 TBR=aa@chromium.org Review URL: http://codereview.chromium.org/462004 git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@33560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/user_script_slave.cc')
-rw-r--r--chrome/renderer/user_script_slave.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index 1133849..4820c83 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;
}