| 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_PUBLIC_COMMON_MOJO_APPLICATION_INFO_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_MOJO_APPLICATION_INFO_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_MOJO_APPLICATION_INFO_H_ | 6 #define CONTENT_PUBLIC_COMMON_MOJO_APPLICATION_INFO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "services/shell/public/cpp/shell_client.h" | 13 #include "services/shell/public/cpp/shell_client.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 17 } // namespace base | 17 } // namespace base |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 // MojoApplicationInfo provides details necessary to construct and bind new |
| 22 // instances of embedded Mojo applications. |
| 21 struct CONTENT_EXPORT MojoApplicationInfo { | 23 struct CONTENT_EXPORT MojoApplicationInfo { |
| 22 using ApplicationFactory = base::Callback<std::unique_ptr<shell::ShellClient>( | 24 using ApplicationFactory = base::Callback<std::unique_ptr<shell::ShellClient>( |
| 23 const base::Closure& quit_closure)>; | 25 const base::Closure& quit_closure)>; |
| 24 | 26 |
| 25 MojoApplicationInfo(); | 27 MojoApplicationInfo(); |
| 26 MojoApplicationInfo(const MojoApplicationInfo& other); | 28 MojoApplicationInfo(const MojoApplicationInfo& other); |
| 27 ~MojoApplicationInfo(); | 29 ~MojoApplicationInfo(); |
| 28 | 30 |
| 31 // A factory function which will be called to produce a new ShellClient |
| 32 // instance for this app whenever one is needed. |
| 29 ApplicationFactory application_factory; | 33 ApplicationFactory application_factory; |
| 34 |
| 35 // The task runner on which to construct and bind new ShellClient instances |
| 36 // for this app. If null, behavior depends on the value of |use_own_thread| |
| 37 // below. |
| 30 scoped_refptr<base::SingleThreadTaskRunner> application_task_runner; | 38 scoped_refptr<base::SingleThreadTaskRunner> application_task_runner; |
| 39 |
| 40 // If |application_task_runner| is null, setting this to |true| will give |
| 41 // each instance of this app its own thread to run on. Setting this to |false| |
| 42 // (the default) will instead run the app on the main thread's task runner. |
| 43 // |
| 44 // If |application_task_runner| is not null, this value is ignored. |
| 45 bool use_own_thread = false; |
| 31 }; | 46 }; |
| 32 | 47 |
| 33 } // namespace content | 48 } // namespace content |
| 34 | 49 |
| 35 #endif // CONTENT_PUBLIC_COMMON_MOJO_APPLICATION_INFO_H_ | 50 #endif // CONTENT_PUBLIC_COMMON_MOJO_APPLICATION_INFO_H_ |
| OLD | NEW |