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 COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ | 5 #ifndef COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ |
6 #define COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ | 6 #define COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/files/file.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "base/platform_file.h" | |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "ppapi/c/private/ppb_nacl_private.h" | 16 #include "ppapi/c/private/ppb_nacl_private.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class PepperPluginInstance; | 20 class PepperPluginInstance; |
21 } | 21 } |
22 | 22 |
23 namespace nacl { | 23 namespace nacl { |
24 | 24 |
25 class ManifestServiceChannel; | 25 class ManifestServiceChannel; |
26 class TrustedPluginChannel; | 26 class TrustedPluginChannel; |
27 | 27 |
28 // NexeLoadManager provides methods for reporting the progress of loading a | 28 // NexeLoadManager provides methods for reporting the progress of loading a |
29 // nexe. | 29 // nexe. |
30 class NexeLoadManager { | 30 class NexeLoadManager { |
31 public: | 31 public: |
32 explicit NexeLoadManager(PP_Instance instance); | 32 explicit NexeLoadManager(PP_Instance instance); |
33 ~NexeLoadManager(); | 33 ~NexeLoadManager(); |
34 | 34 |
35 void NexeFileDidOpen(int32_t pp_error, | 35 void NexeFileDidOpen(int32_t pp_error, |
36 base::PlatformFile file, | 36 const base::File& file, |
37 int32_t http_status, | 37 int32_t http_status, |
38 int64_t nexe_bytes_read, | 38 int64_t nexe_bytes_read, |
39 const std::string& url, | 39 const std::string& url, |
40 base::TimeDelta time_since_open); | 40 base::TimeDelta time_since_open); |
41 void ReportLoadSuccess(const std::string& url, | 41 void ReportLoadSuccess(const std::string& url, |
42 uint64_t loaded_bytes, | 42 uint64_t loaded_bytes, |
43 uint64_t total_bytes); | 43 uint64_t total_bytes); |
44 void ReportLoadError(PP_NaClError error, | 44 void ReportLoadError(PP_NaClError error, |
45 const std::string& error_message); | 45 const std::string& error_message); |
46 | 46 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 std::string mime_type_; | 160 std::string mime_type_; |
161 | 161 |
162 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; | 162 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; |
163 scoped_ptr<ManifestServiceChannel> manifest_service_channel_; | 163 scoped_ptr<ManifestServiceChannel> manifest_service_channel_; |
164 base::WeakPtrFactory<NexeLoadManager> weak_factory_; | 164 base::WeakPtrFactory<NexeLoadManager> weak_factory_; |
165 }; | 165 }; |
166 | 166 |
167 } // namespace nacl | 167 } // namespace nacl |
168 | 168 |
169 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ | 169 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ |
OLD | NEW |