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/execute_code_in_tab_function.h" | 10 #include "chrome/browser/extensions/execute_code_in_tab_function.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 ExtensionsService* service = profile()->GetExtensionsService(); | 272 ExtensionsService* service = profile()->GetExtensionsService(); |
273 DCHECK(service); | 273 DCHECK(service); |
274 | 274 |
275 Extension* extension = service->GetExtensionById(extension_id()); | 275 Extension* extension = service->GetExtensionById(extension_id()); |
276 DCHECK(extension); | 276 DCHECK(extension); |
277 | 277 |
278 return extension; | 278 return extension; |
279 } | 279 } |
280 | 280 |
281 void ExtensionFunctionDispatcher::HandleRequest(const std::string& name, | 281 void ExtensionFunctionDispatcher::HandleRequest(const std::string& name, |
282 const std::string& args, | 282 const Value* args, |
283 int request_id, | 283 int request_id, |
284 bool has_callback) { | 284 bool has_callback) { |
285 scoped_refptr<ExtensionFunction> function( | 285 scoped_refptr<ExtensionFunction> function( |
286 FactoryRegistry::instance()->NewFunction(name)); | 286 FactoryRegistry::instance()->NewFunction(name)); |
287 function->set_dispatcher_peer(peer_); | 287 function->set_dispatcher_peer(peer_); |
288 function->SetArgs(args); | 288 function->SetArgs(args); |
289 function->set_request_id(request_id); | 289 function->set_request_id(request_id); |
290 function->set_has_callback(has_callback); | 290 function->set_has_callback(has_callback); |
291 function->Run(); | 291 function->Run(); |
292 } | 292 } |
(...skipping 14 matching lines...) Expand all Loading... |
307 } else { | 307 } else { |
308 NOTREACHED(); | 308 NOTREACHED(); |
309 base::KillProcess(render_view_host_->process()->process().handle(), | 309 base::KillProcess(render_view_host_->process()->process().handle(), |
310 ResultCodes::KILLED_BAD_MESSAGE, false); | 310 ResultCodes::KILLED_BAD_MESSAGE, false); |
311 } | 311 } |
312 } | 312 } |
313 | 313 |
314 Profile* ExtensionFunctionDispatcher::profile() { | 314 Profile* ExtensionFunctionDispatcher::profile() { |
315 return render_view_host_->process()->profile(); | 315 return render_view_host_->process()->profile(); |
316 } | 316 } |
OLD | NEW |