| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 WebUSBError_h | 5 #ifndef WebUSBError_h |
| 6 #define WebUSBError_h | 6 #define WebUSBError_h |
| 7 | 7 |
| 8 #include "public/platform/WebString.h" | 8 #include "public/platform/WebString.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 // Error object used to create DOMExceptions when a Web USB request cannot be | 12 // Error object used to create DOMExceptions when a Web USB request cannot be |
| 13 // satisfied. | 13 // satisfied. |
| 14 struct WebUSBError { | 14 struct WebUSBError { |
| 15 enum class Error { | 15 enum class Error { |
| 16 InvalidState, |
| 16 Network, | 17 Network, |
| 17 NotFound, | 18 NotFound, |
| 18 Security, | 19 Security, |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 WebUSBError(Error error, const WebString& message) | 22 WebUSBError(Error error, const WebString& message) |
| 22 : error(error) | 23 : error(error) |
| 23 , message(message) | 24 , message(message) |
| 24 { | 25 { |
| 25 } | 26 } |
| 26 | 27 |
| 27 Error error; | 28 Error error; |
| 28 WebString message; | 29 WebString message; |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 } // namespace blink | 32 } // namespace blink |
| 32 | 33 |
| 33 #endif // WebUSBError_h | 34 #endif // WebUSBError_h |
| OLD | NEW |