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

Unified Diff: Source/modules/presentation/PresentationError.cpp

Issue 1212423003: Presentation API: Blink changes to allow getAvailability() to be rejected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@presentation-availability-cleanups
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/presentation/PresentationError.h ('k') | Source/modules/presentation/PresentationSession.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/presentation/PresentationError.cpp
diff --git a/Source/modules/presentation/PresentationError.cpp b/Source/modules/presentation/PresentationError.cpp
index 25470794cb8ee61adfd4959a16f0e71bbc5c6c71..00b580b284a4ff57b11f20de51da09585ee4bcf4 100644
--- a/Source/modules/presentation/PresentationError.cpp
+++ b/Source/modules/presentation/PresentationError.cpp
@@ -13,13 +13,10 @@
namespace blink {
// static
-DOMException* PresentationError::take(WebPresentationError* errorRaw)
+DOMException* PresentationError::take(const WebPresentationError& error)
{
- ASSERT(errorRaw);
- OwnPtr<WebPresentationError> error = adoptPtr(errorRaw);
-
ExceptionCode code = UnknownError;
- switch (error->errorType) {
+ switch (error.errorType) {
case WebPresentationError::ErrorTypeNoAvailableScreens:
case WebPresentationError::ErrorTypeNoPresentationFound:
code = NotFoundError;
@@ -27,18 +24,15 @@ DOMException* PresentationError::take(WebPresentationError* errorRaw)
case WebPresentationError::ErrorTypeSessionRequestCancelled:
code = AbortError;
break;
+ case WebPresentationError::ErrorTypeAvailabilityNotSupported:
+ code = NotSupportedError;
+ break;
case WebPresentationError::ErrorTypeUnknown:
code = UnknownError;
break;
}
- return DOMException::create(code, error->message);
-}
-
-// static
-void PresentationError::dispose(WebPresentationError* error)
-{
- delete error;
+ return DOMException::create(code, error.message);
}
} // namespace blink
« no previous file with comments | « Source/modules/presentation/PresentationError.h ('k') | Source/modules/presentation/PresentationSession.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698