| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SHELL_DYNAMIC_SERVICE_RUNNER_H_ | 5 #ifndef SHELL_DYNAMIC_SERVICE_RUNNER_H_ |
| 6 #define SHELL_DYNAMIC_SERVICE_RUNNER_H_ | 6 #define SHELL_DYNAMIC_SERVICE_RUNNER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 virtual ~DynamicServiceRunnerFactory() {} | 56 virtual ~DynamicServiceRunnerFactory() {} |
| 57 virtual scoped_ptr<DynamicServiceRunner> Create(Context* context) = 0; | 57 virtual scoped_ptr<DynamicServiceRunner> Create(Context* context) = 0; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // A generic factory. | 60 // A generic factory. |
| 61 template <class DynamicServiceRunnerImpl> | 61 template <class DynamicServiceRunnerImpl> |
| 62 class DynamicServiceRunnerFactoryImpl : public DynamicServiceRunnerFactory { | 62 class DynamicServiceRunnerFactoryImpl : public DynamicServiceRunnerFactory { |
| 63 public: | 63 public: |
| 64 DynamicServiceRunnerFactoryImpl() {} | 64 DynamicServiceRunnerFactoryImpl() {} |
| 65 virtual ~DynamicServiceRunnerFactoryImpl() {} | 65 virtual ~DynamicServiceRunnerFactoryImpl() {} |
| 66 virtual scoped_ptr<DynamicServiceRunner> Create(Context* context) override { | 66 scoped_ptr<DynamicServiceRunner> Create(Context* context) override { |
| 67 return scoped_ptr<DynamicServiceRunner>( | 67 return scoped_ptr<DynamicServiceRunner>( |
| 68 new DynamicServiceRunnerImpl(context)); | 68 new DynamicServiceRunnerImpl(context)); |
| 69 } | 69 } |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace shell | 72 } // namespace shell |
| 73 } // namespace mojo | 73 } // namespace mojo |
| 74 | 74 |
| 75 #endif // SHELL_DYNAMIC_SERVICE_RUNNER_H_ | 75 #endif // SHELL_DYNAMIC_SERVICE_RUNNER_H_ |
| OLD | NEW |