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

Unified Diff: third_party/WebKit/Source/core/html/media/MediaError.h

Issue 2660003003: Add MediaError.message (Closed)
Patch Set: Address dalecurtis@'s comment: undef STRINGIFY_STATUS_CASE Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/media/MediaError.h
diff --git a/third_party/WebKit/Source/core/html/media/MediaError.h b/third_party/WebKit/Source/core/html/media/MediaError.h
index 8580a06a33a4b46a9593e81a81150c28f238c9fd..1d41800db51eed753d918a3a2c55a2d15d4dd1a4 100644
--- a/third_party/WebKit/Source/core/html/media/MediaError.h
+++ b/third_party/WebKit/Source/core/html/media/MediaError.h
@@ -29,11 +29,13 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
+#include "platform/wtf/text/WTFString.h"
namespace blink {
-class CORE_EXPORT MediaError final : public GarbageCollected<MediaError>,
- public ScriptWrappable {
+class CORE_EXPORT MediaError final
+ : public GarbageCollectedFinalized<MediaError>,
mlamouri (slow - plz ping) 2017/04/21 10:26:24 Why Finalized? Finalized adds an overhead for the
wolenetz 2017/04/21 10:47:00 WTFString has a RefPtr private member, which IIUC
+ public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -44,16 +46,24 @@ class CORE_EXPORT MediaError final : public GarbageCollected<MediaError>,
kMediaErrSrcNotSupported,
};
- static MediaError* Create(ErrorCode code) { return new MediaError(code); }
+ static MediaError* Create(ErrorCode code, const String& message) {
+ return new MediaError(code, message);
+ }
ErrorCode code() const { return code_; }
+ // Returns either an empty string, or a human readable string describing
+ // additional error detail.
+ String message() const { return message_; }
+
DEFINE_INLINE_TRACE() {}
private:
- MediaError(ErrorCode code) : code_(code) {}
+ MediaError(ErrorCode code, const String& message)
+ : code_(code), message_(message) {}
ErrorCode code_;
+ String message_;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698