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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/plugin_error.h

Issue 18045007: Show more different NaCl loading errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * Error codes and data structures used to report errors when loading a nexe. 8 * Error codes and data structures used to report errors when loading a nexe.
9 */ 9 */
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 Reset(); 108 Reset();
109 } 109 }
110 110
111 void Reset() { 111 void Reset() {
112 SetReport(ERROR_UNKNOWN, std::string()); 112 SetReport(ERROR_UNKNOWN, std::string());
113 } 113 }
114 114
115 void SetReport(PluginErrorCode error_code, const std::string& message) { 115 void SetReport(PluginErrorCode error_code, const std::string& message) {
116 error_code_ = error_code; 116 error_code_ = error_code;
117 message_ = message; 117 message_ = message;
118 console_message_ = message;
119 }
120
121 void SetReport(PluginErrorCode error_code, const std::string& message,
Mark Seaborn 2013/07/17 18:21:49 Please avoid function overloading when possible: i
halyavin 2013/07/18 09:32:22 Done.
122 const std::string& console_message) {
123 error_code_ = error_code;
124 message_ = message;
125 console_message_ = console_message;
Mark Seaborn 2013/07/17 18:21:49 Are you going to concatenate the messages like we
halyavin 2013/07/18 09:32:22 Done.
118 } 126 }
119 127
120 PluginErrorCode error_code() const { 128 PluginErrorCode error_code() const {
121 return error_code_; 129 return error_code_;
122 } 130 }
123 131
124 void PrependMessage(const std::string& prefix) { 132 void PrependMessage(const std::string& prefix) {
125 message_ = prefix + message_; 133 message_ = prefix + message_;
134 console_message_ = prefix + console_message_;
126 } 135 }
127 136
128 const std::string& message() const { 137 const std::string& message() const {
129 return message_; 138 return message_;
130 } 139 }
131 140
141 const std::string& console_message() const {
142 return console_message_;
143 }
144
132 private: 145 private:
133 PluginErrorCode error_code_; 146 PluginErrorCode error_code_;
134 std::string message_; 147 std::string message_;
148 std::string console_message_;
135 NACL_DISALLOW_COPY_AND_ASSIGN(ErrorInfo); 149 NACL_DISALLOW_COPY_AND_ASSIGN(ErrorInfo);
136 }; 150 };
137 151
138 } // namespace plugin 152 } // namespace plugin
139 153
140 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_ERROR_H 154 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_ERROR_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698