| 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 CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_ | 5 #ifndef CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_ |
| 6 #define CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_ | 6 #define CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 explicit StaticApplicationLoader(const ApplicationFactory& factory); | 35 explicit StaticApplicationLoader(const ApplicationFactory& factory); |
| 36 | 36 |
| 37 // Constructs a static loader for |factory| with a closure that will be called | 37 // Constructs a static loader for |factory| with a closure that will be called |
| 38 // when the loaded application quits. | 38 // when the loaded application quits. |
| 39 StaticApplicationLoader(const ApplicationFactory& factory, | 39 StaticApplicationLoader(const ApplicationFactory& factory, |
| 40 const base::Closure& quit_callback); | 40 const base::Closure& quit_callback); |
| 41 | 41 |
| 42 ~StaticApplicationLoader() override; | 42 ~StaticApplicationLoader() override; |
| 43 | 43 |
| 44 // mojo::shell::ApplicationLoader: | 44 // mojo::shell::ApplicationLoader: |
| 45 void Load(const GURL& url, | 45 void Load(const std::string& name, |
| 46 mojo::shell::mojom::ShellClientRequest request) override; | 46 mojo::shell::mojom::ShellClientRequest request) override; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 void StopAppThread(); | 49 void StopAppThread(); |
| 50 | 50 |
| 51 // The factory used t create new instances of the application delegate. | 51 // The factory used t create new instances of the application delegate. |
| 52 ApplicationFactory factory_; | 52 ApplicationFactory factory_; |
| 53 | 53 |
| 54 // If not null, this is run when the loaded application quits. | 54 // If not null, this is run when the loaded application quits. |
| 55 base::Closure quit_callback_; | 55 base::Closure quit_callback_; |
| 56 | 56 |
| 57 // Thread for the application if currently running. | 57 // Thread for the application if currently running. |
| 58 scoped_ptr<base::SimpleThread> thread_; | 58 scoped_ptr<base::SimpleThread> thread_; |
| 59 | 59 |
| 60 base::WeakPtrFactory<StaticApplicationLoader> weak_factory_; | 60 base::WeakPtrFactory<StaticApplicationLoader> weak_factory_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(StaticApplicationLoader); | 62 DISALLOW_COPY_AND_ASSIGN(StaticApplicationLoader); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace content | 65 } // namespace content |
| 66 | 66 |
| 67 #endif // CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_ | 67 #endif // CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_ |
| OLD | NEW |