[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 6 | |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 7 | #include "base/process_util.h" |
| 8 | #include "base/singleton.h" |
| 9 | #include "base/values.h" |
[email protected] | 912256b3 | 2009-09-18 09:47:35 | [diff] [blame] | 10 | #include "chrome/browser/extensions/execute_code_in_tab_function.h" |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 11 | #include "chrome/browser/extensions/extension_bookmarks_module.h" |
[email protected] | f9391485 | 2009-05-26 06:05:40 | [diff] [blame] | 12 | #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" |
[email protected] | ec9ac0df | 2009-10-01 18:06:47 | [diff] [blame] | 13 | #include "chrome/browser/extensions/extension_browser_actions_api.h" |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 14 | #include "chrome/browser/extensions/extension_function.h" |
[email protected] | de768a83 | 2009-10-30 05:25:01 | [diff] [blame^] | 15 | #include "chrome/browser/extensions/extension_history_api.h" |
[email protected] | 198bcfe | 2009-09-09 22:56:28 | [diff] [blame] | 16 | #include "chrome/browser/extensions/extension_i18n_api.h" |
[email protected] | e916901c | 2009-05-07 00:14:31 | [diff] [blame] | 17 | #include "chrome/browser/extensions/extension_message_service.h" |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 18 | #include "chrome/browser/extensions/extension_page_actions_module.h" |
[email protected] | f9391485 | 2009-05-26 06:05:40 | [diff] [blame] | 19 | #include "chrome/browser/extensions/extension_page_actions_module_constants.h" |
[email protected] | 4577622 | 2009-07-15 20:21:58 | [diff] [blame] | 20 | #include "chrome/browser/extensions/extension_process_manager.h" |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 21 | #include "chrome/browser/extensions/extension_tabs_module.h" |
[email protected] | f9391485 | 2009-05-26 06:05:40 | [diff] [blame] | 22 | #include "chrome/browser/extensions/extension_tabs_module_constants.h" |
[email protected] | 25fd1b2e | 2009-08-17 20:57:14 | [diff] [blame] | 23 | #include "chrome/browser/extensions/extension_test_api.h" |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 24 | #include "chrome/browser/extensions/extension_toolstrip_api.h" |
[email protected] | e916901c | 2009-05-07 00:14:31 | [diff] [blame] | 25 | #include "chrome/browser/profile.h" |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 26 | #include "chrome/browser/renderer_host/render_process_host.h" |
| 27 | #include "chrome/browser/renderer_host/render_view_host.h" |
[email protected] | 3550635 | 2009-08-07 18:58:19 | [diff] [blame] | 28 | #include "chrome/common/render_messages.h" |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 29 | #include "chrome/common/result_codes.h" |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 30 | #include "chrome/common/url_constants.h" |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 31 | |
| 32 | // FactoryRegistry ------------------------------------------------------------- |
| 33 | |
| 34 | namespace { |
| 35 | |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 36 | // Template for defining ExtensionFunctionFactory. |
| 37 | template<class T> |
| 38 | ExtensionFunction* NewExtensionFunction() { |
| 39 | return new T(); |
| 40 | } |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 41 | |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 42 | // Contains a list of all known extension functions and allows clients to |
| 43 | // create instances of them. |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 44 | class FactoryRegistry { |
| 45 | public: |
| 46 | static FactoryRegistry* instance(); |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 47 | FactoryRegistry() { ResetFunctions(); } |
| 48 | |
| 49 | // Resets all functions to their default values. |
| 50 | void ResetFunctions(); |
| 51 | |
| 52 | // Adds all function names to 'names'. |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 53 | void GetAllNames(std::vector<std::string>* names); |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 54 | |
| 55 | // Allows overriding of specific functions (e.g. for testing). Functions |
| 56 | // must be previously registered. Returns true if successful. |
| 57 | bool OverrideFunction(const std::string& name, |
| 58 | ExtensionFunctionFactory factory); |
| 59 | |
| 60 | // Factory method for the ExtensionFunction registered as 'name'. |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 61 | ExtensionFunction* NewFunction(const std::string& name); |
| 62 | |
| 63 | private: |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 64 | template<class T> |
| 65 | void RegisterFunction() { |
| 66 | factories_[T::function_name()] = &NewExtensionFunction<T>; |
| 67 | } |
| 68 | |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 69 | typedef std::map<std::string, ExtensionFunctionFactory> FactoryMap; |
| 70 | FactoryMap factories_; |
| 71 | }; |
| 72 | |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 73 | FactoryRegistry* FactoryRegistry::instance() { |
| 74 | return Singleton<FactoryRegistry>::get(); |
| 75 | } |
| 76 | |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 77 | void FactoryRegistry::ResetFunctions() { |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 78 | // Register all functions here. |
| 79 | |
[email protected] | e515f5d | 2009-05-05 03:05:00 | [diff] [blame] | 80 | // Windows |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 81 | RegisterFunction<GetWindowFunction>(); |
| 82 | RegisterFunction<GetCurrentWindowFunction>(); |
| 83 | RegisterFunction<GetLastFocusedWindowFunction>(); |
| 84 | RegisterFunction<GetAllWindowsFunction>(); |
| 85 | RegisterFunction<CreateWindowFunction>(); |
| 86 | RegisterFunction<UpdateWindowFunction>(); |
| 87 | RegisterFunction<RemoveWindowFunction>(); |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 88 | |
[email protected] | e515f5d | 2009-05-05 03:05:00 | [diff] [blame] | 89 | // Tabs |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 90 | RegisterFunction<GetTabFunction>(); |
| 91 | RegisterFunction<GetSelectedTabFunction>(); |
| 92 | RegisterFunction<GetAllTabsInWindowFunction>(); |
| 93 | RegisterFunction<CreateTabFunction>(); |
| 94 | RegisterFunction<UpdateTabFunction>(); |
| 95 | RegisterFunction<MoveTabFunction>(); |
| 96 | RegisterFunction<RemoveTabFunction>(); |
| 97 | RegisterFunction<DetectTabLanguageFunction>(); |
| 98 | RegisterFunction<CaptureVisibleTabFunction>(); |
| 99 | RegisterFunction<TabsExecuteScriptFunction>(); |
| 100 | RegisterFunction<TabsInsertCSSFunction>(); |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 101 | |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 102 | // Page Actions. |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 103 | RegisterFunction<EnablePageActionFunction>(); |
| 104 | RegisterFunction<DisablePageActionFunction>(); |
[email protected] | 744ef17 | 2009-10-16 21:53:46 | [diff] [blame] | 105 | RegisterFunction<PageActionShowFunction>(); |
| 106 | RegisterFunction<PageActionHideFunction>(); |
| 107 | RegisterFunction<PageActionSetIconFunction>(); |
| 108 | RegisterFunction<PageActionSetTitleFunction>(); |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 109 | |
[email protected] | ec9ac0df | 2009-10-01 18:06:47 | [diff] [blame] | 110 | // Browser Actions. |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 111 | RegisterFunction<BrowserActionSetIconFunction>(); |
[email protected] | 1288ba0 | 2009-10-15 00:02:24 | [diff] [blame] | 112 | RegisterFunction<BrowserActionSetTitleFunction>(); |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 113 | RegisterFunction<BrowserActionSetBadgeTextFunction>(); |
| 114 | RegisterFunction<BrowserActionSetBadgeBackgroundColorFunction>(); |
[email protected] | ec9ac0df | 2009-10-01 18:06:47 | [diff] [blame] | 115 | |
[email protected] | f7f3a5f | 2009-05-01 22:02:34 | [diff] [blame] | 116 | // Bookmarks. |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 117 | RegisterFunction<GetBookmarksFunction>(); |
| 118 | RegisterFunction<GetBookmarkChildrenFunction>(); |
| 119 | RegisterFunction<GetBookmarkTreeFunction>(); |
| 120 | RegisterFunction<SearchBookmarksFunction>(); |
| 121 | RegisterFunction<RemoveBookmarkFunction>(); |
| 122 | RegisterFunction<RemoveTreeBookmarkFunction>(); |
| 123 | RegisterFunction<CreateBookmarkFunction>(); |
| 124 | RegisterFunction<MoveBookmarkFunction>(); |
| 125 | RegisterFunction<UpdateBookmarkFunction>(); |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 126 | |
[email protected] | de768a83 | 2009-10-30 05:25:01 | [diff] [blame^] | 127 | // History |
| 128 | RegisterFunction<AddUrlHistoryFunction>(); |
| 129 | RegisterFunction<DeleteAllHistoryFunction>(); |
| 130 | RegisterFunction<DeleteRangeHistoryFunction>(); |
| 131 | RegisterFunction<DeleteUrlHistoryFunction>(); |
| 132 | RegisterFunction<GetVisitsHistoryFunction>(); |
| 133 | RegisterFunction<SearchHistoryFunction>(); |
| 134 | |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 135 | // Toolstrips. |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 136 | RegisterFunction<ToolstripExpandFunction>(); |
| 137 | RegisterFunction<ToolstripCollapseFunction>(); |
[email protected] | 25fd1b2e | 2009-08-17 20:57:14 | [diff] [blame] | 138 | |
[email protected] | 198bcfe | 2009-09-09 22:56:28 | [diff] [blame] | 139 | // I18N. |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 140 | RegisterFunction<GetAcceptLanguagesFunction>(); |
[email protected] | 198bcfe | 2009-09-09 22:56:28 | [diff] [blame] | 141 | |
[email protected] | 25fd1b2e | 2009-08-17 20:57:14 | [diff] [blame] | 142 | // Test. |
[email protected] | 61424c06 | 2009-10-14 23:14:59 | [diff] [blame] | 143 | RegisterFunction<ExtensionTestPassFunction>(); |
| 144 | RegisterFunction<ExtensionTestFailFunction>(); |
| 145 | RegisterFunction<ExtensionTestLogFunction>(); |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 146 | } |
| 147 | |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 148 | void FactoryRegistry::GetAllNames(std::vector<std::string>* names) { |
| 149 | for (FactoryMap::iterator iter = factories_.begin(); |
| 150 | iter != factories_.end(); ++iter) { |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 151 | names->push_back(iter->first); |
| 152 | } |
| 153 | } |
| 154 | |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 155 | bool FactoryRegistry::OverrideFunction(const std::string& name, |
| 156 | ExtensionFunctionFactory factory) { |
| 157 | FactoryMap::iterator iter = factories_.find(name); |
| 158 | if (iter == factories_.end()) { |
| 159 | return false; |
| 160 | } else { |
| 161 | iter->second = factory; |
| 162 | return true; |
| 163 | } |
| 164 | } |
| 165 | |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 166 | ExtensionFunction* FactoryRegistry::NewFunction(const std::string& name) { |
| 167 | FactoryMap::iterator iter = factories_.find(name); |
| 168 | DCHECK(iter != factories_.end()); |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 169 | ExtensionFunction* function = iter->second(); |
[email protected] | 76a3db85 | 2009-07-24 02:14:56 | [diff] [blame] | 170 | function->set_name(name); |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 171 | return function; |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 172 | } |
| 173 | |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 174 | }; // namespace |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 175 | |
| 176 | // ExtensionFunctionDispatcher ------------------------------------------------- |
| 177 | |
| 178 | void ExtensionFunctionDispatcher::GetAllFunctionNames( |
| 179 | std::vector<std::string>* names) { |
| 180 | FactoryRegistry::instance()->GetAllNames(names); |
| 181 | } |
| 182 | |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 183 | bool ExtensionFunctionDispatcher::OverrideFunction( |
| 184 | const std::string& name, ExtensionFunctionFactory factory) { |
| 185 | return FactoryRegistry::instance()->OverrideFunction(name, factory); |
| 186 | } |
| 187 | |
| 188 | void ExtensionFunctionDispatcher::ResetFunctions() { |
| 189 | FactoryRegistry::instance()->ResetFunctions(); |
| 190 | } |
| 191 | |
[email protected] | 811bfe3 | 2009-07-01 08:46:25 | [diff] [blame] | 192 | std::set<ExtensionFunctionDispatcher*>* |
| 193 | ExtensionFunctionDispatcher::all_instances() { |
| 194 | static std::set<ExtensionFunctionDispatcher*> instances; |
| 195 | return &instances; |
| 196 | } |
| 197 | |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 198 | ExtensionFunctionDispatcher::ExtensionFunctionDispatcher( |
| 199 | RenderViewHost* render_view_host, |
[email protected] | 7eecaed5 | 2009-05-07 21:44:12 | [diff] [blame] | 200 | Delegate* delegate, |
[email protected] | 811bfe3 | 2009-07-01 08:46:25 | [diff] [blame] | 201 | const GURL& url) |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 202 | : render_view_host_(render_view_host), |
[email protected] | 7eecaed5 | 2009-05-07 21:44:12 | [diff] [blame] | 203 | delegate_(delegate), |
[email protected] | 811bfe3 | 2009-07-01 08:46:25 | [diff] [blame] | 204 | url_(url), |
[email protected] | 32dda36 | 2009-06-05 19:07:01 | [diff] [blame] | 205 | ALLOW_THIS_IN_INITIALIZER_LIST(peer_(new Peer(this))) { |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 206 | // TODO(erikkay) should we do something for these errors in Release? |
| 207 | DCHECK(url.SchemeIs(chrome::kExtensionScheme)); |
[email protected] | 3550635 | 2009-08-07 18:58:19 | [diff] [blame] | 208 | |
| 209 | Extension* extension = |
| 210 | profile()->GetExtensionsService()->GetExtensionByURL(url); |
| 211 | DCHECK(extension); |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 212 | |
[email protected] | 811bfe3 | 2009-07-01 08:46:25 | [diff] [blame] | 213 | all_instances()->insert(this); |
[email protected] | 0f605396 | 2009-07-09 19:26:35 | [diff] [blame] | 214 | |
[email protected] | 4577622 | 2009-07-15 20:21:58 | [diff] [blame] | 215 | // Notify the ExtensionProcessManager that the view was created. |
| 216 | ExtensionProcessManager* epm = profile()->GetExtensionProcessManager(); |
| 217 | epm->RegisterExtensionProcess(extension_id(), |
[email protected] | 76543b9 | 2009-08-31 17:27:45 | [diff] [blame] | 218 | render_view_host->process()->id()); |
[email protected] | 3550635 | 2009-08-07 18:58:19 | [diff] [blame] | 219 | |
| 220 | // Update the extension permissions. Doing this each time we create an EFD |
| 221 | // ensures that new processes are informed of permissions for newly installed |
| 222 | // extensions. |
[email protected] | cccf9093 | 2009-08-23 17:56:25 | [diff] [blame] | 223 | render_view_host->Send(new ViewMsg_Extension_SetAPIPermissions( |
[email protected] | 3550635 | 2009-08-07 18:58:19 | [diff] [blame] | 224 | extension->id(), extension->api_permissions())); |
[email protected] | cccf9093 | 2009-08-23 17:56:25 | [diff] [blame] | 225 | render_view_host->Send(new ViewMsg_Extension_SetHostPermissions( |
| 226 | extension->url(), extension->host_permissions())); |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 227 | } |
| 228 | |
[email protected] | 32dda36 | 2009-06-05 19:07:01 | [diff] [blame] | 229 | ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() { |
[email protected] | 811bfe3 | 2009-07-01 08:46:25 | [diff] [blame] | 230 | all_instances()->erase(this); |
[email protected] | 32dda36 | 2009-06-05 19:07:01 | [diff] [blame] | 231 | peer_->dispatcher_ = NULL; |
| 232 | } |
| 233 | |
[email protected] | 7eecaed5 | 2009-05-07 21:44:12 | [diff] [blame] | 234 | Browser* ExtensionFunctionDispatcher::GetBrowser() { |
[email protected] | 4ba60e2 | 2009-08-14 21:02:11 | [diff] [blame] | 235 | return delegate_->GetBrowser(); |
[email protected] | 7eecaed5 | 2009-05-07 21:44:12 | [diff] [blame] | 236 | } |
| 237 | |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 238 | ExtensionHost* ExtensionFunctionDispatcher::GetExtensionHost() { |
[email protected] | 9c45b718 | 2009-08-04 16:44:43 | [diff] [blame] | 239 | return delegate_->GetExtensionHost(); |
| 240 | } |
| 241 | |
[email protected] | c7ad50f | 2009-09-11 06:28:15 | [diff] [blame] | 242 | Extension* ExtensionFunctionDispatcher::GetExtension() { |
| 243 | ExtensionsService* service = profile()->GetExtensionsService(); |
| 244 | DCHECK(service); |
| 245 | |
| 246 | Extension* extension = service->GetExtensionById(extension_id()); |
| 247 | DCHECK(extension); |
| 248 | |
| 249 | return extension; |
| 250 | } |
| 251 | |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 252 | void ExtensionFunctionDispatcher::HandleRequest(const std::string& name, |
[email protected] | e4dad9fb | 2009-10-06 18:15:58 | [diff] [blame] | 253 | const Value* args, |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 254 | int request_id, |
| 255 | bool has_callback) { |
[email protected] | 32dda36 | 2009-06-05 19:07:01 | [diff] [blame] | 256 | scoped_refptr<ExtensionFunction> function( |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 257 | FactoryRegistry::instance()->NewFunction(name)); |
[email protected] | 32dda36 | 2009-06-05 19:07:01 | [diff] [blame] | 258 | function->set_dispatcher_peer(peer_); |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 259 | function->SetArgs(args); |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 260 | function->set_request_id(request_id); |
| 261 | function->set_has_callback(has_callback); |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 262 | function->Run(); |
| 263 | } |
| 264 | |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 265 | void ExtensionFunctionDispatcher::SendResponse(ExtensionFunction* function, |
| 266 | bool success) { |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 267 | render_view_host_->SendExtensionResponse(function->request_id(), success, |
[email protected] | b83e460 | 2009-05-15 22:58:33 | [diff] [blame] | 268 | function->GetResult(), function->GetError()); |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | void ExtensionFunctionDispatcher::HandleBadMessage(ExtensionFunction* api) { |
[email protected] | 25fd1b2e | 2009-08-17 20:57:14 | [diff] [blame] | 272 | LOG(ERROR) << "bad extension message " << |
[email protected] | 76543b9 | 2009-08-31 17:27:45 | [diff] [blame] | 273 | api->name() << |
[email protected] | bfdffe2b | 2009-04-24 22:05:35 | [diff] [blame] | 274 | " : terminating renderer."; |
| 275 | if (RenderProcessHost::run_renderer_in_process()) { |
| 276 | // In single process mode it is better if we don't suicide but just crash. |
| 277 | CHECK(false); |
| 278 | } else { |
| 279 | NOTREACHED(); |
| 280 | base::KillProcess(render_view_host_->process()->process().handle(), |
| 281 | ResultCodes::KILLED_BAD_MESSAGE, false); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | Profile* ExtensionFunctionDispatcher::profile() { |
| 286 | return render_view_host_->process()->profile(); |
| 287 | } |