OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MediaValuesCached_h |
| 6 #define MediaValuesCached_h |
| 7 |
| 8 #include "core/css/MediaValues.h" |
| 9 |
| 10 namespace WebCore { |
| 11 |
| 12 class MediaValuesCached FINAL : public MediaValues { |
| 13 public: |
| 14 struct MediaValuesCachedData { |
| 15 // Members variables must be thread safe, since they're copied to the pa
rser thread |
| 16 int viewportWidth; |
| 17 int viewportHeight; |
| 18 int deviceWidth; |
| 19 int deviceHeight; |
| 20 float devicePixelRatio; |
| 21 int colorBitsPerComponent; |
| 22 int monochromeBitsPerComponent; |
| 23 PointerDeviceType pointer; |
| 24 int defaultFontSize; |
| 25 int computedFontSize; |
| 26 bool threeDEnabled; |
| 27 bool scanMediaType; |
| 28 bool screenMediaType; |
| 29 bool printMediaType; |
| 30 bool strictMode; |
| 31 }; |
| 32 |
| 33 static PassRefPtr<MediaValues> create(Document&); |
| 34 static PassRefPtr<MediaValues> create(LocalFrame*, RenderStyle*); |
| 35 static PassRefPtr<MediaValues> create(MediaValuesCachedData&); |
| 36 virtual PassRefPtr<MediaValues> copy() const OVERRIDE; |
| 37 virtual bool isSafeToSendToAnotherThread() const OVERRIDE; |
| 38 virtual bool computeLength(double value, unsigned short type, int& result) c
onst OVERRIDE; |
| 39 |
| 40 virtual int viewportWidth() const OVERRIDE; |
| 41 virtual int viewportHeight() const OVERRIDE; |
| 42 virtual int deviceWidth() const OVERRIDE; |
| 43 virtual int deviceHeight() const OVERRIDE; |
| 44 virtual float devicePixelRatio() const OVERRIDE; |
| 45 virtual int colorBitsPerComponent() const OVERRIDE; |
| 46 virtual int monochromeBitsPerComponent() const OVERRIDE; |
| 47 virtual PointerDeviceType pointer() const OVERRIDE; |
| 48 virtual bool threeDEnabled() const OVERRIDE; |
| 49 virtual bool scanMediaType() const OVERRIDE; |
| 50 virtual bool screenMediaType() const OVERRIDE; |
| 51 virtual bool printMediaType() const OVERRIDE; |
| 52 virtual bool strictMode() const OVERRIDE; |
| 53 virtual Document* document() const OVERRIDE; |
| 54 virtual bool hasValues() const OVERRIDE; |
| 55 |
| 56 protected: |
| 57 MediaValuesCached(LocalFrame*, RenderStyle*); |
| 58 MediaValuesCached(const MediaValuesCachedData&); |
| 59 |
| 60 MediaValuesCachedData m_data; |
| 61 }; |
| 62 |
| 63 } // namespace |
| 64 |
| 65 #endif // MediaValuesCached_h |
OLD | NEW |