| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/web_ui_runner.h" | 5 #include "content/renderer/web_ui_runner.h" |
| 6 | 6 |
| 7 #include "content/public/renderer/render_frame.h" | 7 #include "content/public/renderer/render_frame.h" |
| 8 #include "gin/modules/module_registry.h" | 8 #include "gin/modules/module_registry.h" |
| 9 #include "gin/per_context_data.h" | 9 #include "gin/per_context_data.h" |
| 10 #include "gin/public/context_holder.h" | 10 #include "gin/public/context_holder.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 void WebUIRunner::Run(const std::string& source, | 38 void WebUIRunner::Run(const std::string& source, |
| 39 const std::string& resource_name) { | 39 const std::string& resource_name) { |
| 40 frame_->executeScript( | 40 frame_->executeScript( |
| 41 blink::WebScriptSource(blink::WebString::fromUTF8(source))); | 41 blink::WebScriptSource(blink::WebString::fromUTF8(source))); |
| 42 } | 42 } |
| 43 | 43 |
| 44 v8::Handle<v8::Value> WebUIRunner::Call(v8::Handle<v8::Function> function, | 44 v8::Handle<v8::Value> WebUIRunner::Call(v8::Handle<v8::Function> function, |
| 45 v8::Handle<v8::Value> receiver, | 45 v8::Handle<v8::Value> receiver, |
| 46 int argc, | 46 int argc, |
| 47 v8::Handle<v8::Value> argv[]) { | 47 v8::Handle<v8::Value> argv[]) { |
| 48 #ifdef WEB_FRAME_USES_V8_LOCAL |
| 49 v8::Local<v8::Value>* cast_argv = |
| 50 reinterpret_cast<v8::Local<v8::Value>*>(argv); |
| 51 #else |
| 52 v8::Handle<v8::Value>* cast_argv = argv; |
| 53 #endif |
| 48 return frame_->callFunctionEvenIfScriptDisabled(function, receiver, argc, | 54 return frame_->callFunctionEvenIfScriptDisabled(function, receiver, argc, |
| 49 argv); | 55 cast_argv); |
| 50 } | 56 } |
| 51 | 57 |
| 52 gin::ContextHolder* WebUIRunner::GetContextHolder() { | 58 gin::ContextHolder* WebUIRunner::GetContextHolder() { |
| 53 return context_holder_; | 59 return context_holder_; |
| 54 } | 60 } |
| 55 | 61 |
| 56 } // namespace content | 62 } // namespace content |
| OLD | NEW |