| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |