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

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

Issue 231243002: PPAPI: Move some of NexeFileDidOpen to NexeLoadManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix crash 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
« no previous file with comments | « no previous file | 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 <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 10 matching lines...) Expand all
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 NexeFileDidOpen(int32_t pp_error,
32 int32_t fd,
33 int32_t http_status,
34 int64_t nexe_bytes_read,
35 const std::string& url);
31 void ReportLoadSuccess(const std::string& url, 36 void ReportLoadSuccess(const std::string& url,
32 uint64_t loaded_bytes, 37 uint64_t loaded_bytes,
33 uint64_t total_bytes); 38 uint64_t total_bytes);
34 void ReportLoadError(PP_NaClError error, 39 void ReportLoadError(PP_NaClError error,
35 const std::string& error_message); 40 const std::string& error_message);
36 void ReportLoadError(PP_NaClError error, 41 void ReportLoadError(PP_NaClError error,
37 const std::string& error_message, 42 const std::string& error_message,
38 const std::string& console_message); 43 const std::string& console_message);
39 void ReportLoadAbort(); 44 void ReportLoadAbort();
40 void NexeDidCrash(const char* crash_log); 45 void NexeDidCrash(const char* crash_log);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void set_ready_time() { ready_time_ = base::Time::Now(); } 89 void set_ready_time() { ready_time_ = base::Time::Now(); }
85 90
86 int32_t exit_status() const { return exit_status_; } 91 int32_t exit_status() const { return exit_status_; }
87 void set_exit_status(int32_t exit_status); 92 void set_exit_status(int32_t exit_status);
88 93
89 void set_init_time() { init_time_ = base::Time::Now(); } 94 void set_init_time() { init_time_ = base::Time::Now(); }
90 95
91 void ReportStartupOverhead() const; 96 void ReportStartupOverhead() const;
92 97
93 int64_t nexe_size() const { return nexe_size_; } 98 int64_t nexe_size() const { return nexe_size_; }
94 void set_nexe_size(int64_t nexe_size) { nexe_size_ = nexe_size; }
95 99
96 private: 100 private:
97 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager); 101 DISALLOW_COPY_AND_ASSIGN(NexeLoadManager);
98 102
99 void ReportDeadNexe(); 103 void ReportDeadNexe();
100 104
101 // Copies a crash log to the console, one line at a time. 105 // Copies a crash log to the console, one line at a time.
102 void CopyCrashLogToJsConsole(const std::string& crash_log); 106 void CopyCrashLogToJsConsole(const std::string& crash_log);
103 107
104 PP_Instance pp_instance_; 108 PP_Instance pp_instance_;
(...skipping 28 matching lines...) Expand all
133 // Non-owning. 137 // Non-owning.
134 content::PepperPluginInstance* plugin_instance_; 138 content::PepperPluginInstance* plugin_instance_;
135 139
136 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_; 140 scoped_ptr<TrustedPluginChannel> trusted_plugin_channel_;
137 base::WeakPtrFactory<NexeLoadManager> weak_factory_; 141 base::WeakPtrFactory<NexeLoadManager> weak_factory_;
138 }; 142 };
139 143
140 } // namespace nacl 144 } // namespace nacl
141 145
142 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_ 146 #endif // COMPONENTS_NACL_RENDERER_NEXE_LOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | components/nacl/renderer/nexe_load_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698