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

Side by Side Diff: mojo/public/bindings/js/v8_runner.h

Issue 59153005: Begin implementing V8 bindings for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix style nits Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PUBLIC_BINDINGS_JS_V8_MAIN_H_
6 #define MOJO_PUBLIC_BINDINGS_JS_V8_MAIN_H_
7
8 #include "mojo/public/system/macros.h"
9 #include "v8/include/v8.h"
10
11 namespace mojo {
12 namespace js {
13
14 class Runner {
15 public:
16 explicit Runner(v8::Isolate* isolate);
17 ~Runner();
18
19 void Run(v8::Handle<v8::Script> script);
20
21 v8::Handle<v8::Context> context(v8::Isolate* isolate) {
22 return v8::Local<v8::Context>::New(isolate, context_);
23 }
24
25 class Scope {
26 public:
27 explicit Scope(Runner* runner);
28 ~Scope();
29
30 private:
31 v8::HandleScope handle_scope_;
32 v8::Context::Scope scope_;
33
34 MOJO_DISALLOW_COPY_AND_ASSIGN(Scope);
35 };
36
37 private:
38 friend class Scope;
39
40 v8::Isolate* isolate_;
41 v8::Persistent<v8::Context> context_;
42
43 MOJO_DISALLOW_COPY_AND_ASSIGN(Runner);
44 };
45
46
47 } // namespace js
48 } // namespace mojo
49
50 #endif // MOJO_PUBLIC_BINDINGS_JS_V8_MAIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698