Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: components/nacl/renderer/nexe_load_manager.h

Issue 276423003: Pepper: Nexe downloading out of the trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add PlatformFile include Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/platform_file.h"
15 #include "base/time/time.h"
14 #include "ppapi/c/private/ppb_nacl_private.h" 16 #include "ppapi/c/private/ppb_nacl_private.h"
15 #include "url/gurl.h" 17 #include "url/gurl.h"
16 18
17 namespace content { 19 namespace content {
18 class PepperPluginInstance; 20 class PepperPluginInstance;
19 } 21 }
20 22
21 namespace nacl { 23 namespace nacl {
22 24
23 class ManifestServiceChannel; 25 class ManifestServiceChannel;
24 class TrustedPluginChannel; 26 class TrustedPluginChannel;
25 27
26 // NexeLoadManager provides methods for reporting the progress of loading a 28 // NexeLoadManager provides methods for reporting the progress of loading a
27 // nexe. 29 // nexe.
28 class NexeLoadManager { 30 class NexeLoadManager {
29 public: 31 public:
30 explicit NexeLoadManager(PP_Instance instance); 32 explicit NexeLoadManager(PP_Instance instance);
31 ~NexeLoadManager(); 33 ~NexeLoadManager();
32 34
33 void NexeFileDidOpen(int32_t pp_error, 35 void NexeFileDidOpen(int32_t pp_error,
34 int32_t fd, 36 base::PlatformFile file,
35 int32_t http_status, 37 int32_t http_status,
36 int64_t nexe_bytes_read, 38 int64_t nexe_bytes_read,
37 const std::string& url, 39 const std::string& url,
38 int64_t time_since_open); 40 base::TimeDelta time_since_open);
39 void ReportLoadSuccess(const std::string& url, 41 void ReportLoadSuccess(const std::string& url,
40 uint64_t loaded_bytes, 42 uint64_t loaded_bytes,
41 uint64_t total_bytes); 43 uint64_t total_bytes);
42 void ReportLoadError(PP_NaClError error, 44 void ReportLoadError(PP_NaClError error,
43 const std::string& error_message); 45 const std::string& error_message);
44 void ReportLoadError(PP_NaClError error, 46 void ReportLoadError(PP_NaClError error,
45 const std::string& error_message, 47 const std::string& error_message,
46 const std::string& console_message); 48 const std::string& console_message);
47 void ReportLoadAbort(); 49 void ReportLoadAbort();
48 void NexeDidCrash(const char* crash_log); 50 void NexeDidCrash(const char* crash_log);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 std::string mime_type_; 154 std::string mime_type_;
153 155
154 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; 156 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_;
155 scoped_ptr<ManifestServiceChannel> manifest_service_channel_; 157 scoped_ptr<ManifestServiceChannel> manifest_service_channel_;
156 base::WeakPtrFactory<NexeLoadManager> weak_factory_; 158 base::WeakPtrFactory<NexeLoadManager> weak_factory_;
157 }; 159 };
158 160
159 } // namespace nacl 161 } // namespace nacl
160 162
161 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ 163 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698