Add DAWN_NO_DISCARD to ErrorData

ErrorData should not be discarded. The error must be handled.

Bug: chromium:1063810
Change-Id: I55e782e499f307b91790db10a42878afdc7540dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17501
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Austin Eng 2020-03-24 18:24:24 +00:00 committed by Commit Bot service account
parent 4c6c40d47d
commit b867e14cac
1 changed files with 8 additions and 6 deletions

View File

@ -15,6 +15,8 @@
#ifndef DAWNNATIVE_ERRORDATA_H_
#define DAWNNATIVE_ERRORDATA_H_
#include "common/Compiler.h"
#include <cstdint>
#include <memory>
#include <string>
@ -31,13 +33,13 @@ namespace dawn {
namespace dawn_native {
enum class InternalErrorType : uint32_t;
class ErrorData {
class DAWN_NO_DISCARD ErrorData {
public:
static std::unique_ptr<ErrorData> Create(InternalErrorType type,
std::string message,
const char* file,
const char* function,
int line);
static DAWN_NO_DISCARD std::unique_ptr<ErrorData> Create(InternalErrorType type,
std::string message,
const char* file,
const char* function,
int line);
ErrorData(InternalErrorType type, std::string message);
struct BacktraceRecord {