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

Unified Diff: third_party/WebKit/Source/modules/mediasession/MediaSessionError.cpp

Issue 1370453002: Introduce WebMediaSession (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert throwing in the constructor; would needlessly complicate existing tests Created 5 years, 2 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
Index: third_party/WebKit/Source/modules/mediasession/MediaSessionError.cpp
diff --git a/third_party/WebKit/Source/modules/mediasession/MediaSessionError.cpp b/third_party/WebKit/Source/modules/mediasession/MediaSessionError.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..af6b93d48ba6227f1a063d6e3c545b8428362c55
--- /dev/null
+++ b/third_party/WebKit/Source/modules/mediasession/MediaSessionError.cpp
@@ -0,0 +1,24 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "modules/mediasession/MediaSessionError.h"
+
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+
+namespace blink {
+
+// static
+v8::Local<v8::Value> MediaSessionError::take(ScriptPromiseResolver* resolver, const WebMediaSessionError& webError)
+{
+ v8::Isolate* isolate = resolver->scriptState()->isolate();
+
+ if (webError.errorType == WebMediaSessionError::ErrorTypeActivate)
philipj_slow 2015/10/07 14:37:12 Maybe just assert this so that there's just one er
davve 2015/10/08 09:17:35 Done.
+ return v8::Exception::TypeError(v8String(isolate, "The media session activation failed."));
mlamouri (slow - plz ping) 2015/10/07 14:19:31 I will not block this CL for that but I'm still ag
davve 2015/10/08 09:17:35 Point well taken. I'll make it a priority to follo
+
+ ASSERT_NOT_REACHED();
+ return v8::Exception::Error(v8String(isolate, "An unknown error occurred."));
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698