Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: third_party/WebKit/Source/modules/webusb/USBError.cpp

Issue 1850023002: Consume Mojo services directly in Blink's WebUSB implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't do assignments in if statements. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "modules/webusb/USBError.h"
6
7 #include "core/dom/DOMException.h"
8 #include "core/dom/ExceptionCode.h"
9 #include "public/platform/modules/webusb/WebUSBError.h"
10
11 namespace blink {
12
13 DOMException* USBError::take(ScriptPromiseResolver*, const WebUSBError& webError )
14 {
15 switch (webError.error) {
16 case WebUSBError::Error::InvalidState:
17 return DOMException::create(InvalidStateError, webError.message);
18 case WebUSBError::Error::Network:
19 return DOMException::create(NetworkError, webError.message);
20 case WebUSBError::Error::NotFound:
21 return DOMException::create(NotFoundError, webError.message);
22 case WebUSBError::Error::Security:
23 return DOMException::create(SecurityError, webError.message);
24 }
25 ASSERT_NOT_REACHED();
26 return DOMException::create(UnknownError);
27 }
28
29 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USBError.h ('k') | third_party/WebKit/Source/modules/webusb/USBInTransferResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698