Chromium Code Reviews| Index: extensions/browser/api/execute_code_function.cc |
| diff --git a/extensions/browser/api/execute_code_function.cc b/extensions/browser/api/execute_code_function.cc |
| index 21845aa47ec48b07e549e7b449c10d0641799358..9d217e9c3b8da357d47260f25f22ff1385c155eb 100644 |
| --- a/extensions/browser/api/execute_code_function.cc |
| +++ b/extensions/browser/api/execute_code_function.cc |
| @@ -35,7 +35,8 @@ namespace extensions { |
| using core_api::extension_types::InjectDetails; |
| -ExecuteCodeFunction::ExecuteCodeFunction() { |
| +ExecuteCodeFunction::ExecuteCodeFunction() |
| + : host_id_(new HostID()) { |
|
Devlin
2015/02/25 17:22:36
Why is this is a scoped ptr if it's never null?
Xi Han
2015/02/26 15:13:45
Because we want to set its value in the init() fun
Devlin
2015/02/26 17:35:24
But we can just do host_id_ = HostId(foo, bar), ri
Xi Han
2015/02/26 19:58:00
You are right:) Sorry I was in the old memory that
|
| } |
| ExecuteCodeFunction::~ExecuteCodeFunction() { |
| @@ -129,7 +130,7 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) { |
| if (!executor) |
| return false; |
| - if (!extension()) |
| + if (!extension() && !IsWebView()) |
| return false; |
| ScriptExecutor::ScriptType script_type = ScriptExecutor::JAVASCRIPT; |
| @@ -162,7 +163,8 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) { |
| CHECK_NE(UserScript::UNDEFINED, run_at); |
| executor->ExecuteScript( |
| - extension()->id(), |
| + host_id_->type(), |
| + host_id_->id(), |
| script_type, |
| code_string, |
| frame_scope, |