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

Side by Side Diff: sky/engine/tonic/dart_state.h

Issue 942993002: Add support for |any| to Sky's code generator (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « sky/engine/tonic/dart_converter.h ('k') | sky/engine/tonic/dart_state.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 SKY_ENGINE_TONIC_DART_STATE_H_ 5 #ifndef SKY_ENGINE_TONIC_DART_STATE_H_
6 #define SKY_ENGINE_TONIC_DART_STATE_H_ 6 #define SKY_ENGINE_TONIC_DART_STATE_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/supports_user_data.h" 10 #include "base/supports_user_data.h"
11 #include "dart/runtime/include/dart_api.h" 11 #include "dart/runtime/include/dart_api.h"
12 #include "sky/engine/tonic/dart_api_scope.h"
13 #include "sky/engine/tonic/dart_isolate_scope.h"
12 #include "sky/engine/wtf/OwnPtr.h" 14 #include "sky/engine/wtf/OwnPtr.h"
13 #include "sky/engine/wtf/PassRefPtr.h" 15 #include "sky/engine/wtf/PassRefPtr.h"
14 #include "sky/engine/wtf/RefCounted.h" 16 #include "sky/engine/wtf/RefCounted.h"
15 17
16 namespace blink { 18 namespace blink {
17 class DartStringCache; 19 class DartStringCache;
18 class DartClassLibrary; 20 class DartClassLibrary;
19 class DartExceptionFactory; 21 class DartExceptionFactory;
20 22
21 // DartState represents the state associated with a given Dart isolate. The 23 // DartState represents the state associated with a given Dart isolate. The
22 // lifetime of this object is controlled by the DartVM. If you want to hold a 24 // lifetime of this object is controlled by the DartVM. If you want to hold a
23 // reference to a DartState instance, please hold a base::WeakPtr<DartState>. 25 // reference to a DartState instance, please hold a base::WeakPtr<DartState>.
24 // 26 //
25 // DartState is analogous to gin::PerIsolateData and JSC::ExecState. 27 // DartState is analogous to gin::PerIsolateData and JSC::ExecState.
26 class DartState : public base::SupportsUserData { 28 class DartState : public base::SupportsUserData {
27 public: 29 public:
28 class Scope { 30 class Scope {
29 public: 31 public:
30 Scope(DartState* dart_state); 32 Scope(DartState* dart_state);
31 ~Scope(); 33 ~Scope();
34
35 private:
36 DartIsolateScope scope_;
37 DartApiScope api_scope_;
32 }; 38 };
33 39
34 DartState(); 40 DartState();
35 virtual ~DartState(); 41 virtual ~DartState();
36 42
37 static DartState* From(Dart_Isolate isolate); 43 static DartState* From(Dart_Isolate isolate);
38 static DartState* Current(); 44 static DartState* Current();
39 45
40 base::WeakPtr<DartState> GetWeakPtr(); 46 base::WeakPtr<DartState> GetWeakPtr();
41 47
(...skipping 14 matching lines...) Expand all
56 OwnPtr<DartExceptionFactory> exception_factory_; 62 OwnPtr<DartExceptionFactory> exception_factory_;
57 63
58 base::WeakPtrFactory<DartState> weak_factory_; 64 base::WeakPtrFactory<DartState> weak_factory_;
59 65
60 DISALLOW_COPY_AND_ASSIGN(DartState); 66 DISALLOW_COPY_AND_ASSIGN(DartState);
61 }; 67 };
62 68
63 } // namespace blink 69 } // namespace blink
64 70
65 #endif // SKY_ENGINE_TONIC_DART_STATE_H_ 71 #endif // SKY_ENGINE_TONIC_DART_STATE_H_
OLDNEW
« no previous file with comments | « sky/engine/tonic/dart_converter.h ('k') | sky/engine/tonic/dart_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698