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 SERVICES_ASSET_BUNDLE_ASSET_BUNDLE_IMPL_H_ | 5 #ifndef SERVICES_ASSET_BUNDLE_ASSET_BUNDLE_IMPL_H_ |
6 #define SERVICES_ASSET_BUNDLE_ASSET_BUNDLE_IMPL_H_ | 6 #define SERVICES_ASSET_BUNDLE_ASSET_BUNDLE_IMPL_H_ |
7 | 7 |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/task_runner.h" | 11 #include "base/task_runner.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
13 #include "mojo/public/cpp/bindings/strong_binding.h" | 13 #include "mojo/public/cpp/bindings/strong_binding.h" |
14 #include "mojo/public/cpp/system/data_pipe.h" | 14 #include "mojo/public/cpp/system/data_pipe.h" |
15 #include "mojo/services/asset_bundle/public/interfaces/asset_bundle.mojom.h" | 15 #include "mojo/services/asset_bundle/interfaces/asset_bundle.mojom.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace asset_bundle { | 18 namespace asset_bundle { |
19 | 19 |
20 class AssetBundleImpl : public AssetBundle { | 20 class AssetBundleImpl : public AssetBundle { |
21 public: | 21 public: |
22 AssetBundleImpl(InterfaceRequest<AssetBundle> request, | 22 AssetBundleImpl(InterfaceRequest<AssetBundle> request, |
23 scoped_ptr<base::ScopedTempDir> asset_dir, | 23 scoped_ptr<base::ScopedTempDir> asset_dir, |
24 scoped_refptr<base::TaskRunner> worker_runner); | 24 scoped_refptr<base::TaskRunner> worker_runner); |
25 ~AssetBundleImpl() override; | 25 ~AssetBundleImpl() override; |
26 | 26 |
27 // AssetBundle implementation | 27 // AssetBundle implementation |
28 void GetAsStream( | 28 void GetAsStream( |
29 const String& asset_name, | 29 const String& asset_name, |
30 const Callback<void(ScopedDataPipeConsumerHandle)>& callback) override; | 30 const Callback<void(ScopedDataPipeConsumerHandle)>& callback) override; |
31 | 31 |
32 private: | 32 private: |
33 StrongBinding<AssetBundle> binding_; | 33 StrongBinding<AssetBundle> binding_; |
34 scoped_ptr<base::ScopedTempDir> asset_dir_; | 34 scoped_ptr<base::ScopedTempDir> asset_dir_; |
35 scoped_refptr<base::TaskRunner> worker_runner_; | 35 scoped_refptr<base::TaskRunner> worker_runner_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(AssetBundleImpl); | 37 DISALLOW_COPY_AND_ASSIGN(AssetBundleImpl); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace asset_bundle | 40 } // namespace asset_bundle |
41 } // namespace mojo | 41 } // namespace mojo |
42 | 42 |
43 #endif // SERVICES_ASSET_BUNDLE_ASSET_BUNDLE_IMPL_H_ | 43 #endif // SERVICES_ASSET_BUNDLE_ASSET_BUNDLE_IMPL_H_ |
OLD | NEW |