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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationError.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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
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 #include "modules/presentation/PresentationError.h" 5 #include "modules/presentation/PresentationError.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "public/platform/modules/presentation/WebPresentationError.h" 9 #include "public/platform/modules/presentation/WebPresentationError.h"
10 #include "wtf/OwnPtr.h"
11 10
12 namespace blink { 11 namespace blink {
13 12
14 // static 13 // static
15 DOMException* PresentationError::take(ScriptPromiseResolver*, const WebPresentat ionError& error) 14 DOMException* PresentationError::take(ScriptPromiseResolver*, const WebPresentat ionError& error)
16 { 15 {
17 ExceptionCode code = UnknownError; 16 ExceptionCode code = UnknownError;
18 switch (error.errorType) { 17 switch (error.errorType) {
19 case WebPresentationError::ErrorTypeNoAvailableScreens: 18 case WebPresentationError::ErrorTypeNoAvailableScreens:
20 case WebPresentationError::ErrorTypeNoPresentationFound: 19 case WebPresentationError::ErrorTypeNoPresentationFound:
21 code = NotFoundError; 20 code = NotFoundError;
22 break; 21 break;
23 case WebPresentationError::ErrorTypeSessionRequestCancelled: 22 case WebPresentationError::ErrorTypeSessionRequestCancelled:
24 code = AbortError; 23 code = AbortError;
25 break; 24 break;
26 case WebPresentationError::ErrorTypeAvailabilityNotSupported: 25 case WebPresentationError::ErrorTypeAvailabilityNotSupported:
27 code = NotSupportedError; 26 code = NotSupportedError;
28 break; 27 break;
29 case WebPresentationError::ErrorTypeUnknown: 28 case WebPresentationError::ErrorTypeUnknown:
30 code = UnknownError; 29 code = UnknownError;
31 break; 30 break;
32 } 31 }
33 32
34 return DOMException::create(code, error.message); 33 return DOMException::create(code, error.message);
35 } 34 }
36 35
37 } // namespace blink 36 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698