OLD | NEW |
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_CORE_SCRIPT_DART_CONTROLLER_H_ | 5 #ifndef SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_ |
6 #define SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_ | 6 #define SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 class DartController { | 29 class DartController { |
30 public: | 30 public: |
31 DartController(); | 31 DartController(); |
32 ~DartController(); | 32 ~DartController(); |
33 | 33 |
34 static void InitVM(); | 34 static void InitVM(); |
35 | 35 |
36 typedef base::Callback<void(RefPtr<AbstractModule>, RefPtr<DartValue>)> | 36 typedef base::Callback<void(RefPtr<AbstractModule>, RefPtr<DartValue>)> |
37 LoadFinishedCallback; | 37 LoadFinishedCallback; |
38 | 38 |
39 void LoadSnapshot(const KURL& url, mojo::URLResponsePtr response = nullptr); | |
40 | |
41 void RunFromLibrary(const String& name, | 39 void RunFromLibrary(const String& name, |
42 DartLibraryProvider* library_provider); | 40 DartLibraryProvider* library_provider); |
| 41 void RunFromSnapshot(mojo::ScopedDataPipeConsumerHandle snapshot); |
43 | 42 |
44 void LoadScriptInModule(AbstractModule* module, | 43 void LoadScriptInModule(AbstractModule* module, |
45 const String& source, | 44 const String& source, |
46 const TextPosition& textPosition, | 45 const TextPosition& textPosition, |
47 const LoadFinishedCallback& load_finished_callback); | 46 const LoadFinishedCallback& load_finished_callback); |
48 void ExecuteLibraryInModule(AbstractModule* module, | 47 void ExecuteLibraryInModule(AbstractModule* module, |
49 Dart_Handle library, | 48 Dart_Handle library, |
50 HTMLScriptElement* script); | 49 HTMLScriptElement* script); |
51 | 50 |
52 void ClearForClose(); | 51 void ClearForClose(); |
(...skipping 17 matching lines...) Expand all Loading... |
70 OwnPtr<DartSnapshotLoader> snapshot_loader_; | 69 OwnPtr<DartSnapshotLoader> snapshot_loader_; |
71 | 70 |
72 base::WeakPtrFactory<DartController> weak_factory_; | 71 base::WeakPtrFactory<DartController> weak_factory_; |
73 | 72 |
74 DISALLOW_COPY_AND_ASSIGN(DartController); | 73 DISALLOW_COPY_AND_ASSIGN(DartController); |
75 }; | 74 }; |
76 | 75 |
77 } | 76 } |
78 | 77 |
79 #endif // SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_ | 78 #endif // SKY_ENGINE_CORE_SCRIPT_DART_CONTROLLER_H_ |
OLD | NEW |