| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "modules/mediastream/SourceInfo.h" | 26 #include "modules/mediastream/SourceInfo.h" |
| 27 | 27 |
| 28 #include "wtf/text/WTFString.h" | 28 #include "wtf/text/WTFString.h" |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 SourceInfo* SourceInfo::create(const WebSourceInfo& webSourceInfo) | 32 SourceInfo* SourceInfo::create(const WebSourceInfo& webSourceInfo) |
| 33 { | 33 { |
| 34 ASSERT(!webSourceInfo.isNull()); | 34 DCHECK(!webSourceInfo.isNull()); |
| 35 return new SourceInfo(webSourceInfo); | 35 return new SourceInfo(webSourceInfo); |
| 36 } | 36 } |
| 37 | 37 |
| 38 SourceInfo::SourceInfo(const WebSourceInfo& webSourceInfo) | 38 SourceInfo::SourceInfo(const WebSourceInfo& webSourceInfo) |
| 39 : m_webSourceInfo(webSourceInfo) | 39 : m_webSourceInfo(webSourceInfo) |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 String SourceInfo::id() const | 43 String SourceInfo::id() const |
| 44 { | 44 { |
| 45 return m_webSourceInfo.id(); | 45 return m_webSourceInfo.id(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 String SourceInfo::kind() const | 48 String SourceInfo::kind() const |
| 49 { | 49 { |
| 50 switch (m_webSourceInfo.kind()) { | 50 switch (m_webSourceInfo.kind()) { |
| 51 case WebSourceInfo::SourceKindAudio: | 51 case WebSourceInfo::SourceKindAudio: |
| 52 return "audio"; | 52 return "audio"; |
| 53 case WebSourceInfo::SourceKindVideo: | 53 case WebSourceInfo::SourceKindVideo: |
| 54 return "video"; | 54 return "video"; |
| 55 case WebSourceInfo::SourceKindNone: | 55 case WebSourceInfo::SourceKindNone: |
| 56 return "none"; | 56 return "none"; |
| 57 } | 57 } |
| 58 | 58 |
| 59 ASSERT_NOT_REACHED(); | 59 NOTREACHED(); |
| 60 return String(); | 60 return String(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 String SourceInfo::label() const | 63 String SourceInfo::label() const |
| 64 { | 64 { |
| 65 return m_webSourceInfo.label(); | 65 return m_webSourceInfo.label(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 String SourceInfo::facing() const | 68 String SourceInfo::facing() const |
| 69 { | 69 { |
| 70 switch (m_webSourceInfo.facing()) { | 70 switch (m_webSourceInfo.facing()) { |
| 71 case WebSourceInfo::VideoFacingModeNone: | 71 case WebSourceInfo::VideoFacingModeNone: |
| 72 return String(); | 72 return String(); |
| 73 case WebSourceInfo::VideoFacingModeUser: | 73 case WebSourceInfo::VideoFacingModeUser: |
| 74 return "user"; | 74 return "user"; |
| 75 case WebSourceInfo::VideoFacingModeEnvironment: | 75 case WebSourceInfo::VideoFacingModeEnvironment: |
| 76 return "environment"; | 76 return "environment"; |
| 77 } | 77 } |
| 78 | 78 |
| 79 ASSERT_NOT_REACHED(); | 79 NOTREACHED(); |
| 80 return String(); | 80 return String(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |