| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_IMPL_BASE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_IMPL_BASE_H_ |
| 6 #define MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_IMPL_BASE_H_ | 6 #define MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_IMPL_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // clients to services provided by an application). | 24 // clients to services provided by an application). |
| 25 // | 25 // |
| 26 // To use this class, subclass it and implement/override the required methods | 26 // To use this class, subclass it and implement/override the required methods |
| 27 // (see below). | 27 // (see below). |
| 28 // | 28 // |
| 29 // TODO(vtl): ApplicationRunners should take this instead of an | 29 // TODO(vtl): ApplicationRunners should take this instead of an |
| 30 // ApplicationDelegate. Write more here when that's true (it's pretty hard to | 30 // ApplicationDelegate. Write more here when that's true (it's pretty hard to |
| 31 // use this class in the current setup). | 31 // use this class in the current setup). |
| 32 class ApplicationImplBase : public Application { | 32 class ApplicationImplBase : public Application { |
| 33 public: | 33 public: |
| 34 explicit ApplicationImplBase( | 34 ApplicationImplBase(); |
| 35 InterfaceRequest<Application> application_request); | |
| 36 ~ApplicationImplBase() override; | 35 ~ApplicationImplBase() override; |
| 37 | 36 |
| 37 // Binds the given |Application| request to this object. This must be done |
| 38 // with the message (run) loop available/running, and this will cause this |
| 39 // object to start serving requests (via that message loop). |
| 40 void Bind(InterfaceRequest<Application> application_request); |
| 41 |
| 38 // Quits the main run loop for this application. | 42 // Quits the main run loop for this application. |
| 39 // TODO(vtl): This is implemented in application_runner.cc (for example). Its | 43 // TODO(vtl): This is implemented in application_runner.cc (for example). Its |
| 40 // presence here is pretty dubious. | 44 // presence here is pretty dubious. |
| 41 static void Terminate(); | 45 static void Terminate(); |
| 42 | 46 |
| 43 // This will be valid after |Initialize()| has been received and remain valid | 47 // This will be valid after |Initialize()| has been received and remain valid |
| 44 // until this object is destroyed. | 48 // until this object is destroyed. |
| 45 Shell* shell() const { return shell_.get(); } | 49 Shell* shell() const { return shell_.get(); } |
| 46 | 50 |
| 47 // Returns any initial configuration arguments, passed by the shell. | 51 // Returns any initial configuration arguments, passed by the shell. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 std::string url_; | 93 std::string url_; |
| 90 | 94 |
| 91 std::vector<std::unique_ptr<ServiceProviderImpl>> service_provider_impls_; | 95 std::vector<std::unique_ptr<ServiceProviderImpl>> service_provider_impls_; |
| 92 | 96 |
| 93 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImplBase); | 97 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImplBase); |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // namespace mojo | 100 } // namespace mojo |
| 97 | 101 |
| 98 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_IMPL_BASE_H_ | 102 #endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_IMPL_BASE_H_ |
| OLD | NEW |