Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / nacl / renderer / plugin / plugin_error.h
blob237b872acfe13f18ba32ad623f8f52c999cc4034
1 /*
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
4 * found in the LICENSE file.
5 */
7 /*
8 * Error codes and data structures used to report errors when loading a nexe.
9 */
11 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_PLUGIN_ERROR_H
12 #define COMPONENTS_NACL_RENDERER_PLUGIN_PLUGIN_ERROR_H
14 #include <string>
16 #include "components/nacl/renderer/ppb_nacl_private.h"
17 #include "native_client/src/include/nacl_macros.h"
19 namespace plugin {
21 class ErrorInfo {
22 public:
23 ErrorInfo() {
24 SetReport(PP_NACL_ERROR_UNKNOWN, std::string());
27 void SetReport(PP_NaClError error_code, const std::string& message) {
28 error_code_ = error_code;
29 message_ = message;
32 PP_NaClError error_code() const {
33 return error_code_;
36 const std::string& message() const {
37 return message_;
40 private:
41 PP_NaClError error_code_;
42 std::string message_;
43 NACL_DISALLOW_COPY_AND_ASSIGN(ErrorInfo);
46 } // namespace plugin
48 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_PLUGIN_ERROR_H