HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Kitkat
|
4.4.4_r1
下载
查看原文件
收藏
根目录
external
chromium_org
gin
runner.cc
// Copyright 2013 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 "gin/runner.h" #include "gin/converter.h" #include "gin/per_context_data.h" #include "gin/try_catch.h" using v8::Context; using v8::HandleScope; using v8::Isolate; using v8::Object; using v8::ObjectTemplate; using v8::Script; namespace gin { RunnerDelegate::RunnerDelegate() { } RunnerDelegate::~RunnerDelegate() { } v8::Handle
RunnerDelegate::GetGlobalTemplate(Runner* runner) { return v8::Handle
(); } void RunnerDelegate::DidCreateContext(Runner* runner) { } void RunnerDelegate::WillRunScript(Runner* runner) { } void RunnerDelegate::DidRunScript(Runner* runner) { } void RunnerDelegate::UnhandledException(Runner* runner, TryCatch& try_catch) { } Runner::Runner(RunnerDelegate* delegate, Isolate* isolate) : ContextHolder(isolate), delegate_(delegate), weak_factory_(this) { v8::Isolate::Scope isolate_scope(isolate); HandleScope handle_scope(isolate); v8::Handle
context = Context::New(isolate, NULL, delegate_->GetGlobalTemplate(this)); SetContext(context); PerContextData::From(context)->set_runner(this); v8::Context::Scope scope(context); delegate_->DidCreateContext(this); } Runner::~Runner() { } void Runner::Run(const std::string& source, const std::string& resource_name) { Run(Script::New(StringToV8(isolate(), source), StringToV8(isolate(), resource_name))); } void Runner::Run(v8::Handle
登录后可以享受更多权益
您还没有登录,登录后您可以:
收藏Android系统代码
收藏喜欢的文章
多个平台共享账号
去登录
首次使用?从这里
注册