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

Side by Side Diff: third_party/WebKit/Source/modules/mediasession/MediaImage.cpp

Issue 2612003002: Media Session: use dictionary instead of an interface for MediaImage. (Closed)
Patch Set: rebase Created 3 years, 11 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 2016 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 "modules/mediasession/MediaImage.h"
6
7 #include "core/dom/ExecutionContext.h"
8 #include "core/inspector/ConsoleMessage.h"
9 #include "modules/mediasession/MediaImageInit.h"
10 #include "platform/weborigin/KURL.h"
11 #include "wtf/text/StringOperators.h"
12
13 namespace blink {
14
15 // static
16 MediaImage* MediaImage::create(ExecutionContext* context,
17 const MediaImageInit& image) {
18 return new MediaImage(context, image);
19 }
20
21 MediaImage::MediaImage(ExecutionContext* context, const MediaImageInit& image) {
22 m_src = context->completeURL(image.src());
23 if (!KURL(ParsedURLString, m_src).isValid()) {
24 context->addConsoleMessage(
25 ConsoleMessage::create(JSMessageSource, WarningMessageLevel,
26 "MediaImage src is invalid: " + image.src()));
27 }
28 m_sizes = image.sizes();
29 m_type = image.type();
30 }
31
32 String MediaImage::src() const {
33 return m_src;
34 }
35
36 String MediaImage::sizes() const {
37 return m_sizes;
38 }
39
40 String MediaImage::type() const {
41 return m_type;
42 }
43
44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698