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

Side by Side Diff: third_party/WebKit/Source/core/html/media/MediaError.cpp

Issue 2660003003: Add MediaError.message (Closed)
Patch Set: --flakiness by using std::map, update virtual/stable/[win,mac] global interface listing too 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/html/media/MediaError.h"
6
7 #include "platform/json/JSONValues.h"
8
9 namespace blink {
10
11 MediaError::MediaError(ErrorCode code, const JSONObject* messages)
12 : code_(code) {
13 if (!messages->size()) {
14 // A message containing an empty serialized JSON object ("{}") is invalid
15 // and just an empty string should be used in this case per spec:
16 // https://html.spec.whatwg.org/multipage/embedded-content.html#mediaerror
17 // "...whose message is a string containing any details the user agent is
18 // able to supply about the cause of the error condition, or the empty
19 // string if the user agent is unable to supply such details..."
20 message_ = "";
21 return;
22 }
23
24 // https://html.spec.whatwg.org/multipage/embedded-content.html#mediaerror
25 // "The message and message format are not generally uniform across
26 // different user agents."
27 // We use a readily-parsable serialized JSON object to represent these error
28 // messages, if we have anything additional to report beyond just the code.
29 message_ = messages->ToJSONString();
30 }
31
32 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698