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