| 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 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // console_message is a part of the error that is logged to | 47 // console_message is a part of the error that is logged to |
| 48 // the JavaScript console but is not reported to JavaScript via | 48 // the JavaScript console but is not reported to JavaScript via |
| 49 // the lastError property. This is used to report internal errors which | 49 // the lastError property. This is used to report internal errors which |
| 50 // may easily change in new versions of the browser and we don't want apps | 50 // may easily change in new versions of the browser and we don't want apps |
| 51 // to come to depend on the details of these errors. | 51 // to come to depend on the details of these errors. |
| 52 void ReportLoadError(PP_NaClError error, | 52 void ReportLoadError(PP_NaClError error, |
| 53 const std::string& error_message, | 53 const std::string& error_message, |
| 54 const std::string& console_message); | 54 const std::string& console_message); |
| 55 void ReportLoadAbort(); | 55 void ReportLoadAbort(); |
| 56 void NexeDidCrash(const char* crash_log); | 56 void NexeDidCrash(); |
| 57 | 57 |
| 58 // TODO(dmichael): Everything below this comment should eventually be made | 58 // TODO(dmichael): Everything below this comment should eventually be made |
| 59 // private, when ppb_nacl_private_impl.cc is no longer using them directly. | 59 // private, when ppb_nacl_private_impl.cc is no longer using them directly. |
| 60 // The intent is for this class to only expose functions for reporting a | 60 // The intent is for this class to only expose functions for reporting a |
| 61 // load state transition (e.g., ReportLoadError, ReportProgress, | 61 // load state transition (e.g., ReportLoadError, ReportProgress, |
| 62 // ReportLoadAbort, etc.) | 62 // ReportLoadAbort, etc.) |
| 63 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel); | 63 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel); |
| 64 void set_manifest_service_channel( | 64 void set_manifest_service_channel( |
| 65 scoped_ptr<ManifestServiceChannel> channel); | 65 scoped_ptr<ManifestServiceChannel> channel); |
| 66 | 66 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 pnacl_start_time_ = time; | 110 pnacl_start_time_ = time; |
| 111 } | 111 } |
| 112 | 112 |
| 113 const std::string& program_url() const { return program_url_; } | 113 const std::string& program_url() const { return program_url_; } |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); | 116 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); |
| 117 | 117 |
| 118 void ReportDeadNexe(); | 118 void ReportDeadNexe(); |
| 119 | 119 |
| 120 // Copies a crash log to the console, one line at a time. | |
| 121 void CopyCrashLogToJsConsole(const std::string& crash_log); | |
| 122 | |
| 123 PP_Instance pp_instance_; | 120 PP_Instance pp_instance_; |
| 124 PP_NaClReadyState nacl_ready_state_; | 121 PP_NaClReadyState nacl_ready_state_; |
| 125 bool nexe_error_reported_; | 122 bool nexe_error_reported_; |
| 126 | 123 |
| 127 std::string program_url_; | 124 std::string program_url_; |
| 128 | 125 |
| 129 // A flag indicating if the NaCl executable is being loaded from an installed | 126 // A flag indicating if the NaCl executable is being loaded from an installed |
| 130 // application. This flag is used to bucket UMA statistics more precisely to | 127 // application. This flag is used to bucket UMA statistics more precisely to |
| 131 // help determine whether nexe loading problems are caused by networking | 128 // help determine whether nexe loading problems are caused by networking |
| 132 // issues. (Installed applications will be loaded from disk.) | 129 // issues. (Installed applications will be loaded from disk.) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 base::Time pnacl_start_time_; | 169 base::Time pnacl_start_time_; |
| 173 | 170 |
| 174 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; | 171 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; |
| 175 scoped_ptr<ManifestServiceChannel> manifest_service_channel_; | 172 scoped_ptr<ManifestServiceChannel> manifest_service_channel_; |
| 176 base::WeakPtrFactory<NexeLoadManager> weak_factory_; | 173 base::WeakPtrFactory<NexeLoadManager> weak_factory_; |
| 177 }; | 174 }; |
| 178 | 175 |
| 179 } // namespace nacl | 176 } // namespace nacl |
| 180 | 177 |
| 181 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ | 178 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ |
| OLD | NEW |