| 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 "config.h" | 5 #include "config.h" |
| 6 #include "bindings/core/v8/PrivateScriptRunner.h" | 6 #include "bindings/core/v8/PrivateScriptRunner.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "bindings/core/v8/V8PerContextData.h" | 9 #include "bindings/core/v8/V8PerContextData.h" |
| 10 #include "bindings/core/v8/V8ScriptRunner.h" | 10 #include "bindings/core/v8/V8ScriptRunner.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 compilePrivateScript(isolate, className); | 58 compilePrivateScript(isolate, className); |
| 59 compiledClass = v8::Handle<v8::Object>::Cast(installedClasses)->Get(v8St
ring(isolate, className)); | 59 compiledClass = v8::Handle<v8::Object>::Cast(installedClasses)->Get(v8St
ring(isolate, className)); |
| 60 RELEASE_ASSERT(!compiledClass.IsEmpty()); | 60 RELEASE_ASSERT(!compiledClass.IsEmpty()); |
| 61 RELEASE_ASSERT(compiledClass->IsObject()); | 61 RELEASE_ASSERT(compiledClass->IsObject()); |
| 62 scriptState->perContextData()->setCompiledPrivateScript(className, compi
ledClass); | 62 scriptState->perContextData()->setCompiledPrivateScript(className, compi
ledClass); |
| 63 } | 63 } |
| 64 return v8::Handle<v8::Object>::Cast(compiledClass)->Get(v8String(isolate, pr
opertyName)); | 64 return v8::Handle<v8::Object>::Cast(compiledClass)->Get(v8String(isolate, pr
opertyName)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 v8::Handle<v8::Value> PrivateScriptRunner::runDOMMethod(ScriptState* scriptState
, String className, String operationName, v8::Handle<v8::Value> holder, int argc
, v8::Handle<v8::Value> argv[]) | 67 v8::Handle<v8::Value> PrivateScriptRunner::run(ScriptState* scriptState, String
className, String functionName, v8::Handle<v8::Value> holder, int argc, v8::Hand
le<v8::Value> argv[]) |
| 68 { | 68 { |
| 69 v8::Handle<v8::Value> operation = propertyValue(scriptState, className, oper
ationName); | 69 v8::Handle<v8::Value> function = propertyValue(scriptState, className, funct
ionName); |
| 70 RELEASE_ASSERT(!operation.IsEmpty()); | 70 RELEASE_ASSERT(!function.IsEmpty()); |
| 71 RELEASE_ASSERT(operation->IsFunction()); | 71 RELEASE_ASSERT(function->IsFunction()); |
| 72 return V8ScriptRunner::callFunction(v8::Handle<v8::Function>::Cast(operation
), scriptState->executionContext(), holder, argc, argv, scriptState->isolate()); | 72 return V8ScriptRunner::callFunction(v8::Handle<v8::Function>::Cast(function)
, scriptState->executionContext(), holder, argc, argv, scriptState->isolate()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace WebCore | 75 } // namespace WebCore |
| OLD | NEW |