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 SERVICES_DART_DART_APP_H_ | 5 #ifndef SERVICES_DART_DART_APP_H_ |
6 #define SERVICES_DART_DART_APP_H_ | 6 #define SERVICES_DART_DART_APP_H_ |
7 | 7 |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "mojo/application/content_handler_factory.h" | 9 #include "mojo/application/content_handler_factory.h" |
10 #include "mojo/dart/embedder/dart_controller.h" | 10 #include "mojo/dart/embedder/dart_controller.h" |
11 #include "mojo/public/cpp/system/message_pipe.h" | 11 #include "mojo/public/cpp/system/message_pipe.h" |
12 #include "mojo/public/interfaces/application/application.mojom.h" | 12 #include "mojo/public/interfaces/application/application.mojom.h" |
13 #include "mojo/public/interfaces/application/shell.mojom.h" | 13 #include "mojo/public/interfaces/application/shell.mojom.h" |
14 | 14 |
15 namespace dart { | 15 namespace dart { |
16 | 16 |
17 class DartApp; | 17 class DartApp; |
18 class ApplicationDelegateImpl; | 18 class ApplicationDelegateImpl; |
19 | 19 |
20 // Each Dart app started by content handler runs on its own thread and | 20 // Each Dart app started by content handler runs on its own thread and |
21 // in its own Dart isolate. This class represents one running Dart app. | 21 // in its own Dart isolate. This class represents one running Dart app. |
22 | 22 |
23 class DartApp : public mojo::ContentHandlerFactory::HandledApplicationHolder { | 23 class DartApp : public mojo::ContentHandlerFactory::HandledApplicationHolder { |
24 public: | 24 public: |
| 25 // When running from an extracted zip file. |
25 DartApp(mojo::InterfaceRequest<mojo::Application> application_request, | 26 DartApp(mojo::InterfaceRequest<mojo::Application> application_request, |
26 const base::FilePath& application_dir, | 27 const base::FilePath& application_dir, |
27 bool strict); | 28 bool strict); |
| 29 // When running from a dart file. |
| 30 DartApp(mojo::InterfaceRequest<mojo::Application> application_request, |
| 31 const std::string& url, |
| 32 bool strict); |
28 virtual ~DartApp(); | 33 virtual ~DartApp(); |
29 | 34 |
30 private: | 35 private: |
31 void OnAppLoaded(); | 36 void OnAppLoaded(); |
32 | 37 |
33 mojo::InterfaceRequest<mojo::Application> application_request_; | 38 mojo::InterfaceRequest<mojo::Application> application_request_; |
34 mojo::dart::DartControllerConfig config_; | 39 mojo::dart::DartControllerConfig config_; |
35 base::FilePath application_dir_; | 40 base::FilePath application_dir_; |
36 | 41 |
37 DISALLOW_COPY_AND_ASSIGN(DartApp); | 42 DISALLOW_COPY_AND_ASSIGN(DartApp); |
38 }; | 43 }; |
39 | 44 |
40 } // namespace dart | 45 } // namespace dart |
41 | 46 |
42 #endif // SERVICES_DART_DART_APP_H_ | 47 #endif // SERVICES_DART_DART_APP_H_ |
OLD | NEW |