| 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 #ifndef MediaValuesCached_h | 5 #ifndef MediaValuesCached_h |
| 6 #define MediaValuesCached_h | 6 #define MediaValuesCached_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/MediaValues.h" | 9 #include "core/css/MediaValues.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class CORE_EXPORT MediaValuesCached final : public MediaValues { | 13 class CORE_EXPORT MediaValuesCached final : public MediaValues { |
| 14 public: | 14 public: |
| 15 struct MediaValuesCachedData { | 15 struct MediaValuesCachedData { |
| 16 DISALLOW_NEW(); | 16 DISALLOW_NEW(); |
| 17 // Members variables must be thread safe, since they're copied to the pa
rser thread | 17 // Members variables must be thread safe, since they're copied to the pa
rser thread |
| 18 int viewportWidth; | 18 double viewportWidth; |
| 19 int viewportHeight; | 19 double viewportHeight; |
| 20 int deviceWidth; | 20 int deviceWidth; |
| 21 int deviceHeight; | 21 int deviceHeight; |
| 22 float devicePixelRatio; | 22 float devicePixelRatio; |
| 23 int colorBitsPerComponent; | 23 int colorBitsPerComponent; |
| 24 int monochromeBitsPerComponent; | 24 int monochromeBitsPerComponent; |
| 25 PointerType primaryPointerType; | 25 PointerType primaryPointerType; |
| 26 int availablePointerTypes; | 26 int availablePointerTypes; |
| 27 HoverType primaryHoverType; | 27 HoverType primaryHoverType; |
| 28 int availableHoverTypes; | 28 int availableHoverTypes; |
| 29 int defaultFontSize; | 29 int defaultFontSize; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 54 | 54 |
| 55 static PassRefPtrWillBeRawPtr<MediaValues> create(); | 55 static PassRefPtrWillBeRawPtr<MediaValues> create(); |
| 56 static PassRefPtrWillBeRawPtr<MediaValues> create(Document&); | 56 static PassRefPtrWillBeRawPtr<MediaValues> create(Document&); |
| 57 static PassRefPtrWillBeRawPtr<MediaValues> create(LocalFrame*); | 57 static PassRefPtrWillBeRawPtr<MediaValues> create(LocalFrame*); |
| 58 static PassRefPtrWillBeRawPtr<MediaValues> create(MediaValuesCachedData&); | 58 static PassRefPtrWillBeRawPtr<MediaValues> create(MediaValuesCachedData&); |
| 59 PassRefPtrWillBeRawPtr<MediaValues> copy() const override; | 59 PassRefPtrWillBeRawPtr<MediaValues> copy() const override; |
| 60 bool isSafeToSendToAnotherThread() const override; | 60 bool isSafeToSendToAnotherThread() const override; |
| 61 bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) c
onst override; | 61 bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) c
onst override; |
| 62 bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result
) const override; | 62 bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result
) const override; |
| 63 | 63 |
| 64 int viewportWidth() const override; | 64 double viewportWidth() const override; |
| 65 int viewportHeight() const override; | 65 double viewportHeight() const override; |
| 66 int deviceWidth() const override; | 66 int deviceWidth() const override; |
| 67 int deviceHeight() const override; | 67 int deviceHeight() const override; |
| 68 float devicePixelRatio() const override; | 68 float devicePixelRatio() const override; |
| 69 int colorBitsPerComponent() const override; | 69 int colorBitsPerComponent() const override; |
| 70 int monochromeBitsPerComponent() const override; | 70 int monochromeBitsPerComponent() const override; |
| 71 PointerType primaryPointerType() const override; | 71 PointerType primaryPointerType() const override; |
| 72 int availablePointerTypes() const override; | 72 int availablePointerTypes() const override; |
| 73 HoverType primaryHoverType() const override; | 73 HoverType primaryHoverType() const override; |
| 74 int availableHoverTypes() const override; | 74 int availableHoverTypes() const override; |
| 75 bool threeDEnabled() const override; | 75 bool threeDEnabled() const override; |
| 76 bool strictMode() const override; | 76 bool strictMode() const override; |
| 77 Document* document() const override; | 77 Document* document() const override; |
| 78 bool hasValues() const override; | 78 bool hasValues() const override; |
| 79 const String mediaType() const override; | 79 const String mediaType() const override; |
| 80 WebDisplayMode displayMode() const override; | 80 WebDisplayMode displayMode() const override; |
| 81 | 81 |
| 82 void setViewportWidth(int); | 82 void setViewportWidth(double); |
| 83 void setViewportHeight(int); | 83 void setViewportHeight(double); |
| 84 | 84 |
| 85 bool isCached() const override { return true; } | 85 bool isCached() const override { return true; } |
| 86 protected: | 86 protected: |
| 87 MediaValuesCached(); | 87 MediaValuesCached(); |
| 88 MediaValuesCached(LocalFrame*); | 88 MediaValuesCached(LocalFrame*); |
| 89 MediaValuesCached(const MediaValuesCachedData&); | 89 MediaValuesCached(const MediaValuesCachedData&); |
| 90 | 90 |
| 91 MediaValuesCachedData m_data; | 91 MediaValuesCachedData m_data; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| 95 | 95 |
| 96 #endif // MediaValuesCached_h | 96 #endif // MediaValuesCached_h |
| OLD | NEW |