| 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/css/MediaValues.h" | 8 #include "core/css/MediaValues.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class MediaValuesCached FINAL : public MediaValues { | 12 class MediaValuesCached final : public MediaValues { |
| 13 public: | 13 public: |
| 14 struct MediaValuesCachedData { | 14 struct MediaValuesCachedData { |
| 15 // Members variables must be thread safe, since they're copied to the pa
rser thread | 15 // Members variables must be thread safe, since they're copied to the pa
rser thread |
| 16 int viewportWidth; | 16 int viewportWidth; |
| 17 int viewportHeight; | 17 int viewportHeight; |
| 18 int deviceWidth; | 18 int deviceWidth; |
| 19 int deviceHeight; | 19 int deviceHeight; |
| 20 float devicePixelRatio; | 20 float devicePixelRatio; |
| 21 int colorBitsPerComponent; | 21 int colorBitsPerComponent; |
| 22 int monochromeBitsPerComponent; | 22 int monochromeBitsPerComponent; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 , threeDEnabled(false) | 45 , threeDEnabled(false) |
| 46 , strictMode(true) | 46 , strictMode(true) |
| 47 { | 47 { |
| 48 } | 48 } |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 static PassRefPtr<MediaValues> create(); | 51 static PassRefPtr<MediaValues> create(); |
| 52 static PassRefPtr<MediaValues> create(Document&); | 52 static PassRefPtr<MediaValues> create(Document&); |
| 53 static PassRefPtr<MediaValues> create(LocalFrame*); | 53 static PassRefPtr<MediaValues> create(LocalFrame*); |
| 54 static PassRefPtr<MediaValues> create(MediaValuesCachedData&); | 54 static PassRefPtr<MediaValues> create(MediaValuesCachedData&); |
| 55 virtual PassRefPtr<MediaValues> copy() const OVERRIDE; | 55 virtual PassRefPtr<MediaValues> copy() const override; |
| 56 virtual bool isSafeToSendToAnotherThread() const OVERRIDE; | 56 virtual bool isSafeToSendToAnotherThread() const override; |
| 57 virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, int& r
esult) const OVERRIDE; | 57 virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, int& r
esult) const override; |
| 58 virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, double
& result) const OVERRIDE; | 58 virtual bool computeLength(double value, CSSPrimitiveValue::UnitType, double
& result) const override; |
| 59 | 59 |
| 60 virtual int viewportWidth() const OVERRIDE; | 60 virtual int viewportWidth() const override; |
| 61 virtual int viewportHeight() const OVERRIDE; | 61 virtual int viewportHeight() const override; |
| 62 virtual int deviceWidth() const OVERRIDE; | 62 virtual int deviceWidth() const override; |
| 63 virtual int deviceHeight() const OVERRIDE; | 63 virtual int deviceHeight() const override; |
| 64 virtual float devicePixelRatio() const OVERRIDE; | 64 virtual float devicePixelRatio() const override; |
| 65 virtual int colorBitsPerComponent() const OVERRIDE; | 65 virtual int colorBitsPerComponent() const override; |
| 66 virtual int monochromeBitsPerComponent() const OVERRIDE; | 66 virtual int monochromeBitsPerComponent() const override; |
| 67 virtual PointerType primaryPointerType() const OVERRIDE; | 67 virtual PointerType primaryPointerType() const override; |
| 68 virtual int availablePointerTypes() const OVERRIDE; | 68 virtual int availablePointerTypes() const override; |
| 69 virtual HoverType primaryHoverType() const OVERRIDE; | 69 virtual HoverType primaryHoverType() const override; |
| 70 virtual int availableHoverTypes() const OVERRIDE; | 70 virtual int availableHoverTypes() const override; |
| 71 virtual bool threeDEnabled() const OVERRIDE; | 71 virtual bool threeDEnabled() const override; |
| 72 virtual bool strictMode() const OVERRIDE; | 72 virtual bool strictMode() const override; |
| 73 virtual Document* document() const OVERRIDE; | 73 virtual Document* document() const override; |
| 74 virtual bool hasValues() const OVERRIDE; | 74 virtual bool hasValues() const override; |
| 75 virtual const String mediaType() const OVERRIDE; | 75 virtual const String mediaType() const override; |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 MediaValuesCached(); | 78 MediaValuesCached(); |
| 79 MediaValuesCached(LocalFrame*); | 79 MediaValuesCached(LocalFrame*); |
| 80 MediaValuesCached(const MediaValuesCachedData&); | 80 MediaValuesCached(const MediaValuesCachedData&); |
| 81 | 81 |
| 82 MediaValuesCachedData m_data; | 82 MediaValuesCachedData m_data; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace | 85 } // namespace |
| 86 | 86 |
| 87 #endif // MediaValuesCached_h | 87 #endif // MediaValuesCached_h |
| OLD | NEW |