OLD | NEW |
---|---|
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 Loading... | |
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 // console_message is a part of error that is logged to javascript console | |
Mark Seaborn
2013/07/18 22:15:49
"javascript" -> "Javascript" or "JavaScript"
halyavin
2013/07/19 09:06:20
Done.
| |
122 // but is not reported to javascript on the page. This is need to report | |
Mark Seaborn
2013/07/18 22:15:49
More specifically: "not reported to JavaScript via
halyavin
2013/07/19 09:06:20
Done.
| |
123 // internal errors which may easily change in new versions of the browser. | |
124 void SetReportWithConsoleOnlyError(PluginErrorCode error_code, | |
125 const std::string& message, | |
126 const std::string& console_message) { | |
127 error_code_ = error_code; | |
128 message_ = message; | |
129 console_message_ = message + console_message; | |
Mark Seaborn
2013/07/18 22:15:49
Shouldn't there be some punctuation between the me
halyavin
2013/07/19 09:06:20
I used semicolon so that we don't have 2 colons in
Mark Seaborn
2013/07/19 15:25:30
FWIW, I think multiple colons in a sentence are OK
| |
118 } | 130 } |
119 | 131 |
120 PluginErrorCode error_code() const { | 132 PluginErrorCode error_code() const { |
121 return error_code_; | 133 return error_code_; |
122 } | 134 } |
123 | 135 |
124 void PrependMessage(const std::string& prefix) { | 136 void PrependMessage(const std::string& prefix) { |
125 message_ = prefix + message_; | 137 message_ = prefix + message_; |
138 console_message_ = prefix + console_message_; | |
126 } | 139 } |
127 | 140 |
128 const std::string& message() const { | 141 const std::string& message() const { |
129 return message_; | 142 return message_; |
130 } | 143 } |
131 | 144 |
145 const std::string& console_message() const { | |
146 return console_message_; | |
147 } | |
148 | |
132 private: | 149 private: |
133 PluginErrorCode error_code_; | 150 PluginErrorCode error_code_; |
134 std::string message_; | 151 std::string message_; |
152 std::string console_message_; | |
135 NACL_DISALLOW_COPY_AND_ASSIGN(ErrorInfo); | 153 NACL_DISALLOW_COPY_AND_ASSIGN(ErrorInfo); |
136 }; | 154 }; |
137 | 155 |
138 } // namespace plugin | 156 } // namespace plugin |
139 | 157 |
140 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_ERROR_H | 158 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_ERROR_H |
OLD | NEW |