Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: Source/bindings/v8/PrivateScriptRunner.cpp

Issue 351423002: Moved files under Source/bindings/v8 to Source/bindings/core/v8. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/PrivateScriptRunner.h ('k') | Source/bindings/v8/PrivateScriptRunner.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/PrivateScriptRunner.cpp
diff --git a/Source/bindings/v8/PrivateScriptRunner.cpp b/Source/bindings/v8/PrivateScriptRunner.cpp
deleted file mode 100644
index c1315b8cbddd442cb4ee86049b14e1c191fcda6f..0000000000000000000000000000000000000000
--- a/Source/bindings/v8/PrivateScriptRunner.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "bindings/v8/PrivateScriptRunner.h"
-
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8PerContextData.h"
-#include "bindings/v8/V8ScriptRunner.h"
-#include "core/PrivateScriptSources.h"
-
-namespace WebCore {
-
-static v8::Handle<v8::Value> compilePrivateScript(v8::Isolate* isolate, String className)
-{
- size_t index;
- // |kPrivateScriptSources| is defined in V8PrivateScriptSources.h, which is auto-generated
- // by make_private_script.py.
- for (index = 0; index < WTF_ARRAY_LENGTH(kPrivateScriptSources); index++) {
- if (className == kPrivateScriptSources[index].name)
- break;
- }
- RELEASE_ASSERT(index != WTF_ARRAY_LENGTH(kPrivateScriptSources));
- String source(reinterpret_cast<const char*>(kPrivateScriptSources[index].source), kPrivateScriptSources[index].size);
- return V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, source), isolate);
-}
-
-v8::Handle<v8::Value> PrivateScriptRunner::run(ScriptState* scriptState, String className, String functionName, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8::Value> argv[])
-{
- ASSERT(scriptState->perContextData());
- ASSERT(scriptState->executionContext());
- v8::Isolate* isolate = scriptState->isolate();
- v8::Handle<v8::Value> compiledClass = scriptState->perContextData()->compiledPrivateScript(className);
- if (compiledClass.IsEmpty()) {
- v8::Handle<v8::Value> installedClasses = scriptState->perContextData()->compiledPrivateScript("PrivateScriptRunner");
- if (installedClasses.IsEmpty()) {
- installedClasses = compilePrivateScript(isolate, "PrivateScriptRunner");
- scriptState->perContextData()->setCompiledPrivateScript("PrivateScriptRunner", installedClasses);
- }
- RELEASE_ASSERT(!installedClasses.IsEmpty());
- RELEASE_ASSERT(installedClasses->IsObject());
-
- compilePrivateScript(isolate, className);
- compiledClass = v8::Handle<v8::Object>::Cast(installedClasses)->Get(v8String(isolate, className));
- RELEASE_ASSERT(!compiledClass.IsEmpty());
- RELEASE_ASSERT(compiledClass->IsObject());
- scriptState->perContextData()->setCompiledPrivateScript(className, compiledClass);
- }
-
- v8::Handle<v8::Value> function = v8::Handle<v8::Object>::Cast(compiledClass)->Get(v8String(isolate, functionName));
- RELEASE_ASSERT(!function.IsEmpty());
- RELEASE_ASSERT(function->IsFunction());
-
- return V8ScriptRunner::callFunction(v8::Handle<v8::Function>::Cast(function), scriptState->executionContext(), receiver, argc, argv, isolate);
-}
-
-} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/PrivateScriptRunner.h ('k') | Source/bindings/v8/PrivateScriptRunner.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698