1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_
7 
8 #include <stdint.h>
9 
10 #include "base/strings/string16.h"
11 #include "content/common/content_export.h"
12 #include "third_party/blink/public/mojom/indexeddb/indexeddb.mojom-forward.h"
13 
14 namespace content {
15 
16 class CONTENT_EXPORT IndexedDBDatabaseError {
17  public:
18   IndexedDBDatabaseError();
19   explicit IndexedDBDatabaseError(blink::mojom::IDBException code);
20   IndexedDBDatabaseError(blink::mojom::IDBException code, const char* message);
21   IndexedDBDatabaseError(blink::mojom::IDBException code,
22                          const base::string16& message);
23   ~IndexedDBDatabaseError();
24 
25   IndexedDBDatabaseError& operator=(const IndexedDBDatabaseError& rhs);
26 
code()27   blink::mojom::IDBException code() const { return code_; }
message()28   const base::string16& message() const { return message_; }
29 
30  private:
31   blink::mojom::IDBException code_ = blink::mojom::IDBException::kNoError;
32   base::string16 message_;
33 };
34 
35 }  // namespace content
36 
37 #endif  // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_
38