| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "third_party/WebKit/public/platform/WebIDBDatabaseError.h" | |
| 12 | 11 |
| 13 namespace content { | 12 namespace content { |
| 14 | 13 |
| 15 class IndexedDBDatabaseError { | 14 class IndexedDBDatabaseError { |
| 16 public: | 15 public: |
| 17 IndexedDBDatabaseError(uint16 code, const char* message) | 16 IndexedDBDatabaseError(uint16 code, const char* message) |
| 18 : code_(code), message_(ASCIIToUTF16(message)) {} | 17 : code_(code), message_(ASCIIToUTF16(message)) {} |
| 19 IndexedDBDatabaseError(uint16 code, const string16& message) | 18 IndexedDBDatabaseError(uint16 code, const string16& message) |
| 20 : code_(code), message_(message) {} | 19 : code_(code), message_(message) {} |
| 21 explicit IndexedDBDatabaseError(const WebKit::WebIDBDatabaseError& other) | |
| 22 : code_(other.code()), message_(other.message()) {} | |
| 23 ~IndexedDBDatabaseError() {} | 20 ~IndexedDBDatabaseError() {} |
| 24 | 21 |
| 25 uint16 code() const { return code_; } | 22 uint16 code() const { return code_; } |
| 26 const string16& message() const { return message_; } | 23 const string16& message() const { return message_; } |
| 27 | 24 |
| 28 private: | 25 private: |
| 29 const uint16 code_; | 26 const uint16 code_; |
| 30 const string16 message_; | 27 const string16 message_; |
| 31 }; | 28 }; |
| 32 | 29 |
| 33 } // namespace content | 30 } // namespace content |
| 34 | 31 |
| 35 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_ | 32 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_ERROR_H_ |
| OLD | NEW |