OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SHELL_RUNNER_H_ | 5 #ifndef GIN_SHELL_RUNNER_H_ |
6 #define GIN_SHELL_RUNNER_H_ | 6 #define GIN_SHELL_RUNNER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "gin/runner.h" | 11 #include "gin/runner.h" |
11 | 12 |
12 namespace gin { | 13 namespace gin { |
13 | 14 |
14 class ContextHolder; | 15 class ContextHolder; |
15 class ShellRunner; | 16 class ShellRunner; |
16 class TryCatch; | 17 class TryCatch; |
17 | 18 |
18 // Subclass ShellRunnerDelegate to customize the behavior of ShellRunner. | 19 // Subclass ShellRunnerDelegate to customize the behavior of ShellRunner. |
19 // Typical embedders will want to subclass one of the specialized | 20 // Typical embedders will want to subclass one of the specialized |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 v8::Local<v8::Value> argv[]) override; | 54 v8::Local<v8::Value> argv[]) override; |
54 ContextHolder* GetContextHolder() override; | 55 ContextHolder* GetContextHolder() override; |
55 | 56 |
56 private: | 57 private: |
57 friend class Scope; | 58 friend class Scope; |
58 | 59 |
59 void Run(v8::Local<v8::Script> script); | 60 void Run(v8::Local<v8::Script> script); |
60 | 61 |
61 ShellRunnerDelegate* delegate_; | 62 ShellRunnerDelegate* delegate_; |
62 | 63 |
63 scoped_ptr<ContextHolder> context_holder_; | 64 std::unique_ptr<ContextHolder> context_holder_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(ShellRunner); | 66 DISALLOW_COPY_AND_ASSIGN(ShellRunner); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace gin | 69 } // namespace gin |
69 | 70 |
70 #endif // GIN_SHELL_RUNNER_H_ | 71 #endif // GIN_SHELL_RUNNER_H_ |
OLD | NEW |