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

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

Issue 469423002: NaCl: Send fatal log messages via shared memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove commented out line Created 6 years, 4 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
« no previous file with comments | « components/nacl/loader/nacl_listener.cc ('k') | components/nacl/renderer/nexe_load_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/files/file.h" 11 #include "base/files/file.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/shared_memory.h"
14 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
15 #include "base/time/time.h" 16 #include "base/time/time.h"
16 #include "ppapi/c/private/ppb_nacl_private.h" 17 #include "ppapi/c/private/ppb_nacl_private.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 namespace content { 20 namespace content {
20 class PepperPluginInstance; 21 class PepperPluginInstance;
21 } 22 }
22 23
23 namespace nacl { 24 namespace nacl {
(...skipping 22 matching lines...) Expand all
46 47
47 // console_message is a part of the error that is logged to 48 // console_message is a part of the error that is logged to
48 // the JavaScript console but is not reported to JavaScript via 49 // the JavaScript console but is not reported to JavaScript via
49 // the lastError property. This is used to report internal errors which 50 // 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 51 // 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. 52 // to come to depend on the details of these errors.
52 void ReportLoadError(PP_NaClError error, 53 void ReportLoadError(PP_NaClError error,
53 const std::string& error_message, 54 const std::string& error_message,
54 const std::string& console_message); 55 const std::string& console_message);
55 void ReportLoadAbort(); 56 void ReportLoadAbort();
56 void NexeDidCrash(const char* crash_log); 57 void NexeDidCrash();
57 58
58 // TODO(dmichael): Everything below this comment should eventually be made 59 // TODO(dmichael): Everything below this comment should eventually be made
59 // private, when ppb_nacl_private_impl.cc is no longer using them directly. 60 // 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 61 // The intent is for this class to only expose functions for reporting a
61 // load state transition (e.g., ReportLoadError, ReportProgress, 62 // load state transition (e.g., ReportLoadError, ReportProgress,
62 // ReportLoadAbort, etc.) 63 // ReportLoadAbort, etc.)
63 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel); 64 void set_trusted_plugin_channel(scoped_ptr<TrustedPluginChannel> channel);
64 void set_manifest_service_channel( 65 void set_manifest_service_channel(
65 scoped_ptr<ManifestServiceChannel> channel); 66 scoped_ptr<ManifestServiceChannel> channel);
66 67
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 bool DevInterfacesEnabled() const; 106 bool DevInterfacesEnabled() const;
106 107
107 // Returns the time that the work for PNaCl translation began. 108 // Returns the time that the work for PNaCl translation began.
108 base::Time pnacl_start_time() const { return pnacl_start_time_; } 109 base::Time pnacl_start_time() const { return pnacl_start_time_; }
109 void set_pnacl_start_time(base::Time time) { 110 void set_pnacl_start_time(base::Time time) {
110 pnacl_start_time_ = time; 111 pnacl_start_time_ = time;
111 } 112 }
112 113
113 const std::string& program_url() const { return program_url_; } 114 const std::string& program_url() const { return program_url_; }
114 115
116 void set_crash_info_shmem_handle(base::SharedMemoryHandle h) {
117 crash_info_shmem_handle_ = h;
118 }
119
115 private: 120 private:
116 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); 121 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager);
117 122
118 void ReportDeadNexe(); 123 void ReportDeadNexe();
119 124
120 // Copies a crash log to the console, one line at a time. 125 // Copies a crash log to the console, one line at a time.
121 void CopyCrashLogToJsConsole(const std::string& crash_log); 126 void CopyCrashLogToJsConsole(const std::string& crash_log);
122 127
123 PP_Instance pp_instance_; 128 PP_Instance pp_instance_;
124 PP_NaClReadyState nacl_ready_state_; 129 PP_NaClReadyState nacl_ready_state_;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 169
165 // Arguments passed to this plugin instance from the DOM. 170 // Arguments passed to this plugin instance from the DOM.
166 std::map<std::string, std::string> args_; 171 std::map<std::string, std::string> args_;
167 172
168 // We store mime_type_ outside of args_ explicitly because we change it to be 173 // We store mime_type_ outside of args_ explicitly because we change it to be
169 // lowercase. 174 // lowercase.
170 std::string mime_type_; 175 std::string mime_type_;
171 176
172 base::Time pnacl_start_time_; 177 base::Time pnacl_start_time_;
173 178
179 base::SharedMemoryHandle crash_info_shmem_handle_;
180
174 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; 181 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_;
175 scoped_ptr<ManifestServiceChannel> manifest_service_channel_; 182 scoped_ptr<ManifestServiceChannel> manifest_service_channel_;
176 base::WeakPtrFactory<NexeLoadManager> weak_factory_; 183 base::WeakPtrFactory<NexeLoadManager> weak_factory_;
177 }; 184 };
178 185
179 } // namespace nacl 186 } // namespace nacl
180 187
181 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ 188 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « components/nacl/loader/nacl_listener.cc ('k') | components/nacl/renderer/nexe_load_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698