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

Unified Diff: sky/viewer/script/script_runner.cc

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/viewer/script/script_runner.h ('k') | sky/viewer/script/support.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/script/script_runner.cc
diff --git a/sky/viewer/script/script_runner.cc b/sky/viewer/script/script_runner.cc
deleted file mode 100644
index c47b156b9046bcd14bb556e4fd76273d44f3de7a..0000000000000000000000000000000000000000
--- a/sky/viewer/script/script_runner.cc
+++ /dev/null
@@ -1,56 +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 "sky/viewer/script/script_runner.h"
-
-#include "gin/per_context_data.h"
-#include "gin/try_catch.h"
-#include "sky/engine/public/web/WebFrame.h"
-#include "sky/engine/public/web/WebScriptSource.h"
-#include "sky/engine/public/web/WebView.h"
-#include "v8/include/v8.h"
-#include <iostream>
-
-namespace sky {
-
-ScriptRunner::ScriptRunner(blink::WebFrame* frame,
- v8::Handle<v8::Context> context)
- : frame_(frame),
- context_holder_(nullptr) {
- gin::PerContextData* context_data = gin::PerContextData::From(context);
- context_data->set_runner(this);
- context_holder_ = context_data->context_holder();
-}
-
-ScriptRunner::~ScriptRunner() {
-}
-
-void ScriptRunner::Run(const std::string& source,
- const std::string& resource_name) {
- gin::TryCatch try_catch;
- frame_->executeScript(blink::WebScriptSource(
- blink::WebString::fromUTF8(source),
- GURL("internal-resouce:" + resource_name)));
- // FIXME: We should really log to the console rather than to INFO.
- if (try_catch.HasCaught())
- std::cout << try_catch.GetStackTrace();
-}
-
-v8::Handle<v8::Value> ScriptRunner::Call(v8::Handle<v8::Function> function,
- v8::Handle<v8::Value> receiver,
- int argc,
- v8::Handle<v8::Value> argv[]) {
- gin::TryCatch try_catch;
- v8::Handle<v8::Value> result = frame_->callFunctionEvenIfScriptDisabled(
- function, receiver, argc, argv);
- if (try_catch.HasCaught())
- std::cout << try_catch.GetStackTrace();
- return result;
-}
-
-gin::ContextHolder* ScriptRunner::GetContextHolder() {
- return context_holder_;
-}
-
-} // namespace sky
« no previous file with comments | « sky/viewer/script/script_runner.h ('k') | sky/viewer/script/support.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698