summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_function_registry.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_function_registry.cc')
-rw-r--r--chrome/browser/extensions/extension_function_registry.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_function_registry.cc b/chrome/browser/extensions/extension_function_registry.cc
index dc585dc..a4b26f6 100644
--- a/chrome/browser/extensions/extension_function_registry.cc
+++ b/chrome/browser/extensions/extension_function_registry.cc
@@ -273,7 +273,7 @@ bool ExtensionFunctionRegistry::OverrideFunction(
if (iter == factories_.end()) {
return false;
} else {
- iter->second = factory;
+ iter->second.factory_ = factory;
return true;
}
}
@@ -282,7 +282,18 @@ ExtensionFunction* ExtensionFunctionRegistry::NewFunction(
const std::string& name) {
FactoryMap::iterator iter = factories_.find(name);
DCHECK(iter != factories_.end());
- ExtensionFunction* function = iter->second();
+ ExtensionFunction* function = iter->second.factory_();
function->set_name(name);
+ function->set_histogram_value(iter->second.histogram_value_);
return function;
}
+
+ExtensionFunctionRegistry::FactoryEntry::FactoryEntry()
+ : factory_(0), histogram_value_(extensions::functions::UNKNOWN) {
+}
+
+ExtensionFunctionRegistry::FactoryEntry::FactoryEntry(
+ ExtensionFunctionFactory factory,
+ extensions::functions::HistogramValue histogram_value)
+ : factory_(factory), histogram_value_(histogram_value) {
+}