summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 07:47:39 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 07:47:39 +0000
commitc8865964330959b40718c0e6148288da64f14fec (patch)
tree78a39905db0a850690c673a76ef59eadb28f54d6 /chrome/renderer/extensions
parent3ce10b7c419cc4522f885008cbb3c76b02256ba3 (diff)
downloadchromium_src-c8865964330959b40718c0e6148288da64f14fec.zip
chromium_src-c8865964330959b40718c0e6148288da64f14fec.tar.gz
chromium_src-c8865964330959b40718c0e6148288da64f14fec.tar.bz2
Fix regression where we stopped running content scripts in
extension processes. BUG=29621 Review URL: http://codereview.chromium.org/505012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r--chrome/renderer/extensions/extension_process_bindings.cc20
-rw-r--r--chrome/renderer/extensions/extension_process_bindings.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc
index 7af9b5f..e7aef4b 100644
--- a/chrome/renderer/extensions/extension_process_bindings.cc
+++ b/chrome/renderer/extensions/extension_process_bindings.cc
@@ -12,7 +12,6 @@
#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"
@@ -23,6 +22,7 @@
#include "chrome/renderer/extensions/event_bindings.h"
#include "chrome/renderer/extensions/js_only_v8_extensions.h"
#include "chrome/renderer/extensions/renderer_extension_bindings.h"
+#include "chrome/renderer/user_script_slave.h"
#include "chrome/renderer/render_view.h"
#include "grit/common_resources.h"
#include "grit/renderer_resources.h"
@@ -105,17 +105,14 @@ static L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id) {
}
}
-static std::vector<std::string> GetActiveExtensionIDs() {
- std::vector<std::string> extension_ids;
+static void GetActiveExtensionIDs(std::set<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);
+ extension_ids->insert(iter->first);
}
-
- return extension_ids;
}
// A RenderViewVisitor class that iterates through the set of available
@@ -585,6 +582,11 @@ v8::Extension* ExtensionProcessBindings::Get() {
return extension;
}
+void ExtensionProcessBindings::GetActiveExtensions(
+ std::set<std::string>* extension_ids) {
+ GetActiveExtensionIDs(extension_ids);
+}
+
void ExtensionProcessBindings::SetFunctionNames(
const std::vector<std::string>& names) {
ExtensionImpl::SetFunctionNames(names);
@@ -653,12 +655,6 @@ void ExtensionProcessBindings::SetAPIPermissions(
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
diff --git a/chrome/renderer/extensions/extension_process_bindings.h b/chrome/renderer/extensions/extension_process_bindings.h
index 1009932..08f068d2 100644
--- a/chrome/renderer/extensions/extension_process_bindings.h
+++ b/chrome/renderer/extensions/extension_process_bindings.h
@@ -8,6 +8,7 @@
#define CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_
#include <map>
+#include <set>
#include <string>
#include <vector>
@@ -26,6 +27,9 @@ class ExtensionProcessBindings {
static void SetFunctionNames(const std::vector<std::string>& names);
static v8::Extension* Get();
+ // Gets the set of extensions running in this process.
+ static void GetActiveExtensions(std::set<std::string>* extension_ids);
+
// Handles a response to an API request.
static void HandleResponse(int request_id, bool success,
const std::string& response,