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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void SetReadOnlyProperty(PP_Var key, PP_Var value); | 77 void SetReadOnlyProperty(PP_Var key, PP_Var value); |
78 void SetLastError(const std::string& error); | 78 void SetLastError(const std::string& error); |
79 void LogToConsole(const std::string& message); | 79 void LogToConsole(const std::string& message); |
80 | 80 |
81 bool is_installed() const { return is_installed_; } | 81 bool is_installed() const { return is_installed_; } |
82 void set_is_installed(bool installed) { is_installed_ = installed; } | 82 void set_is_installed(bool installed) { is_installed_ = installed; } |
83 | 83 |
84 int64_t ready_time() const { return ready_time_; } | 84 int64_t ready_time() const { return ready_time_; } |
85 void set_ready_time(int64_t ready_time) { ready_time_ = ready_time; } | 85 void set_ready_time(int64_t ready_time) { ready_time_ = ready_time; } |
86 | 86 |
| 87 int32_t exit_status() const { return exit_status_; } |
| 88 void set_exit_status(int32_t exit_status) { exit_status_ = exit_status; } |
| 89 |
87 private: | 90 private: |
88 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); | 91 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); |
89 | 92 |
90 PP_Instance pp_instance_; | 93 PP_Instance pp_instance_; |
91 PP_NaClReadyState nacl_ready_state_; | 94 PP_NaClReadyState nacl_ready_state_; |
92 bool nexe_error_reported_; | 95 bool nexe_error_reported_; |
93 | 96 |
94 // A flag indicating if the NaCl executable is being loaded from an installed | 97 // A flag indicating if the NaCl executable is being loaded from an installed |
95 // application. This flag is used to bucket UMA statistics more precisely to | 98 // application. This flag is used to bucket UMA statistics more precisely to |
96 // help determine whether nexe loading problems are caused by networking | 99 // help determine whether nexe loading problems are caused by networking |
97 // issues. (Installed applications will be loaded from disk.) | 100 // issues. (Installed applications will be loaded from disk.) |
98 // Unfortunately, the definition of what it means to be part of an installed | 101 // Unfortunately, the definition of what it means to be part of an installed |
99 // application is a little murky - for example an installed application can | 102 // application is a little murky - for example an installed application can |
100 // register a mime handler that loads NaCl executables into an arbitrary web | 103 // register a mime handler that loads NaCl executables into an arbitrary web |
101 // page. As such, the flag actually means "our best guess, based on the URLs | 104 // page. As such, the flag actually means "our best guess, based on the URLs |
102 // for NaCl resources that we have seen so far". | 105 // for NaCl resources that we have seen so far". |
103 bool is_installed_; | 106 bool is_installed_; |
104 | 107 |
105 // Time of a successful nexe load, in microseconds since the epoch. | 108 // Time of a successful nexe load, in microseconds since the epoch. |
106 int64_t ready_time_; | 109 int64_t ready_time_; |
107 | 110 |
| 111 // The exit status of the plugin process. |
| 112 int32_t exit_status_; |
| 113 |
108 // Non-owning. | 114 // Non-owning. |
109 content::PepperPluginInstance* plugin_instance_; | 115 content::PepperPluginInstance* plugin_instance_; |
110 | 116 |
111 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; | 117 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; |
112 base::WeakPtrFactory<NexeLoadManager> weak_factory_; | 118 base::WeakPtrFactory<NexeLoadManager> weak_factory_; |
113 }; | 119 }; |
114 | 120 |
115 } // namespace nacl | 121 } // namespace nacl |
116 | 122 |
117 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ | 123 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ |
OLD | NEW |