OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
| 6 #define MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| 11 #include "mojo/shell/public/interfaces/application.mojom.h" |
| 12 |
| 13 class GURL; |
| 14 |
| 15 namespace mojo { |
| 16 namespace shell { |
| 17 |
| 18 // BackgroundShell starts up the mojo shell on a background thread, and |
| 19 // destroys the thread in the destructor. Once created use CreateApplication() |
| 20 // to obtain an InterfaceRequest for the Application. The InterfaceRequest can |
| 21 // then be bound to an ApplicationImpl. |
| 22 class BackgroundShell { |
| 23 public: |
| 24 BackgroundShell(); |
| 25 ~BackgroundShell(); |
| 26 |
| 27 void Init(); |
| 28 |
| 29 // Obtains an InterfaceRequest for the specified url. |
| 30 InterfaceRequest<mojom::Application> CreateApplication(const GURL& url); |
| 31 |
| 32 private: |
| 33 class MojoThread; |
| 34 |
| 35 scoped_ptr<MojoThread> thread_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(BackgroundShell); |
| 38 }; |
| 39 |
| 40 } // namespace shell |
| 41 } // namespace mojo |
| 42 |
| 43 #endif // MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
OLD | NEW |