| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/MediaValuesDynamic.h" | 5 #include "core/css/MediaValuesDynamic.h" |
| 6 | 6 |
| 7 #include "core/css/CSSHelper.h" | 7 #include "core/css/CSSHelper.h" |
| 8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
| 9 #include "core/css/CSSToLengthConversionData.h" | 9 #include "core/css/CSSToLengthConversionData.h" |
| 10 #include "core/css/MediaValuesCached.h" | 10 #include "core/css/MediaValuesCached.h" |
| 11 #include "core/dom/Document.h" | 11 #include "core/dom/Document.h" |
| 12 #include "core/frame/LocalFrame.h" | 12 #include "core/frame/LocalFrame.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 PassRefPtrWillBeRawPtr<MediaValues> MediaValuesDynamic::create(Document& documen
t) | 16 RawPtr<MediaValues> MediaValuesDynamic::create(Document& document) |
| 17 { | 17 { |
| 18 return MediaValuesDynamic::create(frameFrom(document)); | 18 return MediaValuesDynamic::create(frameFrom(document)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 PassRefPtrWillBeRawPtr<MediaValues> MediaValuesDynamic::create(LocalFrame* frame
) | 21 RawPtr<MediaValues> MediaValuesDynamic::create(LocalFrame* frame) |
| 22 { | 22 { |
| 23 if (!frame || !frame->view() || !frame->document() || !frame->document()->la
youtView()) | 23 if (!frame || !frame->view() || !frame->document() || !frame->document()->la
youtView()) |
| 24 return MediaValuesCached::create(); | 24 return MediaValuesCached::create(); |
| 25 return adoptRefWillBeNoop(new MediaValuesDynamic(frame)); | 25 return (new MediaValuesDynamic(frame)); |
| 26 } | 26 } |
| 27 | 27 |
| 28 MediaValuesDynamic::MediaValuesDynamic(LocalFrame* frame) | 28 MediaValuesDynamic::MediaValuesDynamic(LocalFrame* frame) |
| 29 : m_frame(frame) | 29 : m_frame(frame) |
| 30 { | 30 { |
| 31 ASSERT(m_frame); | 31 ASSERT(m_frame); |
| 32 } | 32 } |
| 33 | 33 |
| 34 PassRefPtrWillBeRawPtr<MediaValues> MediaValuesDynamic::copy() const | 34 RawPtr<MediaValues> MediaValuesDynamic::copy() const |
| 35 { | 35 { |
| 36 return adoptRefWillBeNoop(new MediaValuesDynamic(m_frame)); | 36 return (new MediaValuesDynamic(m_frame)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool MediaValuesDynamic::computeLength(double value, CSSPrimitiveValue::UnitType
type, int& result) const | 39 bool MediaValuesDynamic::computeLength(double value, CSSPrimitiveValue::UnitType
type, int& result) const |
| 40 { | 40 { |
| 41 return MediaValues::computeLength(value, | 41 return MediaValues::computeLength(value, |
| 42 type, | 42 type, |
| 43 calculateDefaultFontSize(m_frame), | 43 calculateDefaultFontSize(m_frame), |
| 44 calculateViewportWidth(m_frame), | 44 calculateViewportWidth(m_frame), |
| 45 calculateViewportHeight(m_frame), | 45 calculateViewportHeight(m_frame), |
| 46 result); | 46 result); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 return m_frame; | 141 return m_frame; |
| 142 } | 142 } |
| 143 | 143 |
| 144 DEFINE_TRACE(MediaValuesDynamic) | 144 DEFINE_TRACE(MediaValuesDynamic) |
| 145 { | 145 { |
| 146 visitor->trace(m_frame); | 146 visitor->trace(m_frame); |
| 147 MediaValues::trace(visitor); | 147 MediaValues::trace(visitor); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace blink | 150 } // namespace blink |
| OLD | NEW |