OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2194 // is called, |m_playPromiseResolvers| needs to be populated. What this code | 2194 // is called, |m_playPromiseResolvers| needs to be populated. What this code |
2195 // does is to populate |m_playPromiseResolvers| before calling ::play() and | 2195 // does is to populate |m_playPromiseResolvers| before calling ::play() and |
2196 // remove the Promise if ::play() failed. | 2196 // remove the Promise if ::play() failed. |
2197 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); | 2197 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
2198 ScriptPromise promise = resolver->promise(); | 2198 ScriptPromise promise = resolver->promise(); |
2199 m_playPromiseResolvers.append(resolver); | 2199 m_playPromiseResolvers.append(resolver); |
2200 | 2200 |
2201 Nullable<ExceptionCode> code = play(); | 2201 Nullable<ExceptionCode> code = play(); |
2202 if (!code.isNull()) { | 2202 if (!code.isNull()) { |
2203 DCHECK(!m_playPromiseResolvers.isEmpty()); | 2203 DCHECK(!m_playPromiseResolvers.isEmpty()); |
2204 m_playPromiseResolvers.removeLast(); | 2204 m_playPromiseResolvers.pop_back(); |
2205 | 2205 |
2206 String message; | 2206 String message; |
2207 switch (code.get()) { | 2207 switch (code.get()) { |
2208 case NotAllowedError: | 2208 case NotAllowedError: |
2209 message = "play() can only be initiated by a user gesture."; | 2209 message = "play() can only be initiated by a user gesture."; |
2210 break; | 2210 break; |
2211 case NotSupportedError: | 2211 case NotSupportedError: |
2212 message = "The element has no supported sources."; | 2212 message = "The element has no supported sources."; |
2213 break; | 2213 break; |
2214 default: | 2214 default: |
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4163 | 4163 |
4164 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() | 4164 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() |
4165 const { | 4165 const { |
4166 IntRect result; | 4166 IntRect result; |
4167 if (LayoutObject* object = m_element->layoutObject()) | 4167 if (LayoutObject* object = m_element->layoutObject()) |
4168 result = object->absoluteBoundingBoxRect(); | 4168 result = object->absoluteBoundingBoxRect(); |
4169 return result; | 4169 return result; |
4170 } | 4170 } |
4171 | 4171 |
4172 } // namespace blink | 4172 } // namespace blink |
OLD | NEW |