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