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

Side by Side Diff: gin/runner.h

Issue 76353002: Introduce a Gin class instead of using global functions to control gin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates 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
« no previous file with comments | « gin/initialize.cc ('k') | gin/runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GIN_RUNNER_H_ 5 #ifndef GIN_RUNNER_H_
6 #define GIN_RUNNER_H_ 6 #define GIN_RUNNER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 base::WeakPtr<Runner> GetWeakPtr() { 43 base::WeakPtr<Runner> GetWeakPtr() {
44 return weak_factory_.GetWeakPtr(); 44 return weak_factory_.GetWeakPtr();
45 } 45 }
46 46
47 class Scope { 47 class Scope {
48 public: 48 public:
49 explicit Scope(Runner* runner); 49 explicit Scope(Runner* runner);
50 ~Scope(); 50 ~Scope();
51 51
52 private: 52 private:
53 v8::Isolate::Scope isolate_scope_;
53 v8::HandleScope handle_scope_; 54 v8::HandleScope handle_scope_;
54 v8::Context::Scope scope_; 55 v8::Context::Scope scope_;
55 56
56 DISALLOW_COPY_AND_ASSIGN(Scope); 57 DISALLOW_COPY_AND_ASSIGN(Scope);
57 }; 58 };
58 59
59 private: 60 private:
60 friend class Scope; 61 friend class Scope;
61 62
62 RunnerDelegate* delegate_; 63 RunnerDelegate* delegate_;
63 64
64 base::WeakPtrFactory<Runner> weak_factory_; 65 base::WeakPtrFactory<Runner> weak_factory_;
65 66
66 DISALLOW_COPY_AND_ASSIGN(Runner); 67 DISALLOW_COPY_AND_ASSIGN(Runner);
67 }; 68 };
68 69
69 } // namespace gin 70 } // namespace gin
70 71
71 #endif // GIN_RUNNER_H_ 72 #endif // GIN_RUNNER_H_
OLDNEW
« no previous file with comments | « gin/initialize.cc ('k') | gin/runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698