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

Unified Diff: chrome/renderer/extensions/extension_process_bindings.cc

Issue 445005: Merge 33255 - Report active extensions in crash reports. This only implements... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: 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/common/child_process_logging_win.cc ('k') | chrome/renderer/user_script_slave.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/extension_process_bindings.cc
===================================================================
--- chrome/renderer/extensions/extension_process_bindings.cc (revision 33256)
+++ chrome/renderer/extensions/extension_process_bindings.cc (working copy)
@@ -9,8 +9,11 @@
#include <string>
#include <vector>
+#include "base/command_line.h"
#include "base/json/json_reader.h"
#include "base/singleton.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_message_bundle.h"
#include "chrome/common/extensions/url_pattern.h"
@@ -102,6 +105,19 @@
}
}
+static std::vector<std::string> GetActiveExtensionIDs() {
+ std::vector<std::string> extension_ids;
+ ExtensionPermissionsMap& permissions =
+ Singleton<SingletonData>()->permissions_;
+
+ for (ExtensionPermissionsMap::iterator iter = permissions.begin();
+ iter != permissions.end(); ++iter) {
+ extension_ids.push_back(iter->first);
+ }
+
+ return extension_ids;
+}
+
// A RenderViewVisitor class that iterates through the set of available
// views, looking for a view of the given type, in the given browser window
// and within the given extension.
@@ -626,6 +642,12 @@
permissions_map[Extension::kPermissionNames[i]] = false;
for (size_t i = 0; i < permissions.size(); ++i)
permissions_map[permissions[i]] = true;
+
+ // Ugly hack. We also update our list of active extensions here. This always
+ // gets called, even if the extension has no api permissions. In single
+ // process, this has already been done in the browser code.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess))
+ child_process_logging::SetActiveExtensions(GetActiveExtensionIDs());
}
// static
« no previous file with comments | « chrome/common/child_process_logging_win.cc ('k') | chrome/renderer/user_script_slave.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698