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

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

Issue 231793003: Add IPC Channel for new ManifestService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 13
14 #include "ppapi/c/private/ppb_nacl_private.h" 14 #include "ppapi/c/private/ppb_nacl_private.h"
15 15
16 namespace content { 16 namespace content {
17 class PepperPluginInstance; 17 class PepperPluginInstance;
18 } 18 }
19 19
20 namespace nacl { 20 namespace nacl {
21 21
22 class ManifestServiceChannel;
22 class TrustedPluginChannel; 23 class TrustedPluginChannel;
23 24
24 // NexeLoadManager provides methods for reporting the progress of loading a 25 // NexeLoadManager provides methods for reporting the progress of loading a
25 // nexe. 26 // nexe.
26 class NexeLoadManager { 27 class NexeLoadManager {
27 public: 28 public:
28 explicit NexeLoadManager(PP_Instance instance); 29 explicit NexeLoadManager(PP_Instance instance);
29 ~NexeLoadManager(); 30 ~NexeLoadManager();
30 31
31 void NexeFileDidOpen(int32_t pp_error, 32 void NexeFileDidOpen(int32_t pp_error,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 71 }
71 PP_Instance instance; 72 PP_Instance instance;
72 PP_NaClEventType event_type; 73 PP_NaClEventType event_type;
73 std::string resource_url; 74 std::string resource_url;
74 bool length_is_computable; 75 bool length_is_computable;
75 uint64_t loaded_bytes; 76 uint64_t loaded_bytes;
76 uint64_t total_bytes; 77 uint64_t total_bytes;
77 }; 78 };
78 void DispatchEvent(const ProgressEvent &event); 79 void DispatchEvent(const ProgressEvent &event);
79 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel); 80 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel);
81 void set_manifest_service_channel(
82 scoped_ptr<ManifestServiceChannel> channel);
80 83
81 PP_NaClReadyState nacl_ready_state(); 84 PP_NaClReadyState nacl_ready_state();
82 void set_nacl_ready_state(PP_NaClReadyState ready_state); 85 void set_nacl_ready_state(PP_NaClReadyState ready_state);
83 86
84 void SetReadOnlyProperty(PP_Var key, PP_Var value); 87 void SetReadOnlyProperty(PP_Var key, PP_Var value);
85 void SetLastError(const std::string& error); 88 void SetLastError(const std::string& error);
86 void LogToConsole(const std::string& message); 89 void LogToConsole(const std::string& message);
87 90
88 bool is_installed() const { return is_installed_; } 91 bool is_installed() const { return is_installed_; }
89 void set_is_installed(bool installed) { is_installed_ = installed; } 92 void set_is_installed(bool installed) { is_installed_ = installed; }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // or -1 if set_exit_status() has never been called. 137 // or -1 if set_exit_status() has never been called.
135 int32_t exit_status_; 138 int32_t exit_status_;
136 139
137 // Size of the downloaded nexe, in bytes. 140 // Size of the downloaded nexe, in bytes.
138 int64_t nexe_size_; 141 int64_t nexe_size_;
139 142
140 // Non-owning. 143 // Non-owning.
141 content::PepperPluginInstance* plugin_instance_; 144 content::PepperPluginInstance* plugin_instance_;
142 145
143 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; 146 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_;
147 scoped_ptr<ManifestServiceChannel> manifest_service_channel_;
144 base::WeakPtrFactory<NexeLoadManager> weak_factory_; 148 base::WeakPtrFactory<NexeLoadManager> weak_factory_;
145 }; 149 };
146 150
147 } // namespace nacl 151 } // namespace nacl
148 152
149 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ 153 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « components/nacl/renderer/manifest_service_channel.cc ('k') | components/nacl/renderer/nexe_load_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698