Chromium Code Reviews| 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) |
| + return v8::Exception::TypeError(v8String(isolate, "The media session activation failed.")); |
|
mlamouri (slow - plz ping)
2015/09/28 15:16:03
TypeError... Let's see how the discussion on the s
davve
2015/10/06 12:05:13
Yes. I'll leave it be for now.
|
| + |
| + ASSERT_NOT_REACHED(); |
| + return v8::Exception::Error(v8String(isolate, "An unknown error occurred.")); |
| +} |
| + |
| +} // namespace blink |