| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 5 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/extension_bookmarks_module.h" | 10 #include "chrome/browser/extensions/extension_bookmarks_module.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } else { | 144 } else { |
| 145 iter->second = factory; | 145 iter->second = factory; |
| 146 return true; | 146 return true; |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 ExtensionFunction* FactoryRegistry::NewFunction(const std::string& name) { | 150 ExtensionFunction* FactoryRegistry::NewFunction(const std::string& name) { |
| 151 FactoryMap::iterator iter = factories_.find(name); | 151 FactoryMap::iterator iter = factories_.find(name); |
| 152 DCHECK(iter != factories_.end()); | 152 DCHECK(iter != factories_.end()); |
| 153 ExtensionFunction* function = iter->second(); | 153 ExtensionFunction* function = iter->second(); |
| 154 function->SetName(name); | 154 function->set_name(name); |
| 155 return function; | 155 return function; |
| 156 } | 156 } |
| 157 | 157 |
| 158 }; // namespace | 158 }; // namespace |
| 159 | 159 |
| 160 // ExtensionFunctionDispatcher ------------------------------------------------- | 160 // ExtensionFunctionDispatcher ------------------------------------------------- |
| 161 | 161 |
| 162 void ExtensionFunctionDispatcher::GetAllFunctionNames( | 162 void ExtensionFunctionDispatcher::GetAllFunctionNames( |
| 163 std::vector<std::string>* names) { | 163 std::vector<std::string>* names) { |
| 164 FactoryRegistry::instance()->GetAllNames(names); | 164 FactoryRegistry::instance()->GetAllNames(names); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } else { | 235 } else { |
| 236 NOTREACHED(); | 236 NOTREACHED(); |
| 237 base::KillProcess(render_view_host_->process()->process().handle(), | 237 base::KillProcess(render_view_host_->process()->process().handle(), |
| 238 ResultCodes::KILLED_BAD_MESSAGE, false); | 238 ResultCodes::KILLED_BAD_MESSAGE, false); |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 Profile* ExtensionFunctionDispatcher::profile() { | 242 Profile* ExtensionFunctionDispatcher::profile() { |
| 243 return render_view_host_->process()->profile(); | 243 return render_view_host_->process()->profile(); |
| 244 } | 244 } |
| OLD | NEW |