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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class TrustedPluginChannel; | 22 class TrustedPluginChannel; |
23 | 23 |
24 // NexeLoadManager provides methods for reporting the progress of loading a | 24 // NexeLoadManager provides methods for reporting the progress of loading a |
25 // nexe. | 25 // nexe. |
26 class NexeLoadManager { | 26 class NexeLoadManager { |
27 public: | 27 public: |
28 explicit NexeLoadManager(PP_Instance instance); | 28 explicit NexeLoadManager(PP_Instance instance); |
29 ~NexeLoadManager(); | 29 ~NexeLoadManager(); |
30 | 30 |
31 void ReportLoadError(PP_NaClError error, const std::string& error_message); | 31 void ReportLoadError(PP_NaClError error, |
| 32 const std::string& error_message, |
| 33 const std::string& console_message); |
32 | 34 |
33 // TODO(dmichael): Everything below this comment should eventually be made | 35 // TODO(dmichael): Everything below this comment should eventually be made |
34 // private, when ppb_nacl_private_impl.cc is no longer using them directly. | 36 // private, when ppb_nacl_private_impl.cc is no longer using them directly. |
35 // The intent is for this class to only expose functions for reporting a | 37 // The intent is for this class to only expose functions for reporting a |
36 // load state transition (e.g., ReportLoadError, ReportProgress, | 38 // load state transition (e.g., ReportLoadError, ReportProgress, |
37 // ReportLoadAbort, etc.) | 39 // ReportLoadAbort, etc.) |
38 struct ProgressEvent { | 40 struct ProgressEvent { |
39 explicit ProgressEvent(PP_NaClEventType event_type_param) | 41 explicit ProgressEvent(PP_NaClEventType event_type_param) |
40 : event_type(event_type_param), | 42 : event_type(event_type_param), |
41 length_is_computable(false), | 43 length_is_computable(false), |
(...skipping 10 matching lines...) Expand all Loading... |
52 void DispatchEvent(const ProgressEvent &event); | 54 void DispatchEvent(const ProgressEvent &event); |
53 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel); | 55 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel); |
54 | 56 |
55 bool nexe_error_reported(); | 57 bool nexe_error_reported(); |
56 void set_nexe_error_reported(bool error_reported); | 58 void set_nexe_error_reported(bool error_reported); |
57 | 59 |
58 PP_NaClReadyState nacl_ready_state(); | 60 PP_NaClReadyState nacl_ready_state(); |
59 void set_nacl_ready_state(PP_NaClReadyState ready_state); | 61 void set_nacl_ready_state(PP_NaClReadyState ready_state); |
60 | 62 |
61 void SetReadOnlyProperty(PP_Var key, PP_Var value); | 63 void SetReadOnlyProperty(PP_Var key, PP_Var value); |
| 64 void LogToConsole(const std::string& message); |
62 | 65 |
63 bool is_installed() { return is_installed_; } | 66 bool is_installed() { return is_installed_; } |
64 void set_is_installed(bool installed) { is_installed_ = installed; } | 67 void set_is_installed(bool installed) { is_installed_ = installed; } |
65 | 68 |
66 private: | 69 private: |
67 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); | 70 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); |
68 | 71 |
69 PP_Instance pp_instance_; | 72 PP_Instance pp_instance_; |
70 PP_NaClReadyState nacl_ready_state_; | 73 PP_NaClReadyState nacl_ready_state_; |
71 bool nexe_error_reported_; | 74 bool nexe_error_reported_; |
(...skipping 12 matching lines...) Expand all Loading... |
84 // Non-owning. | 87 // Non-owning. |
85 content::PepperPluginInstance* plugin_instance_; | 88 content::PepperPluginInstance* plugin_instance_; |
86 | 89 |
87 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; | 90 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; |
88 base::WeakPtrFactory<NexeLoadManager> weak_factory_; | 91 base::WeakPtrFactory<NexeLoadManager> weak_factory_; |
89 }; | 92 }; |
90 | 93 |
91 } // namespace nacl | 94 } // namespace nacl |
92 | 95 |
93 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ | 96 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ |
OLD | NEW |