| 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 hasXHeight; | |
| 27 double xHeight; | |
| 28 double zeroWidth; | |
| 29 bool threeDEnabled; | |
| 30 bool scanMediaType; | |
| 31 bool screenMediaType; | |
| 32 bool printMediaType; | |
| 33 bool strictMode; | |
| 34 }; | |
| 35 | |
| 36 static PassRefPtr<MediaValues> create(Document&); | |
| 37 static PassRefPtr<MediaValues> create(LocalFrame*, RenderStyle*); | |
| 38 static PassRefPtr<MediaValues> create(MediaValuesCachedData&); | |
| 39 virtual PassRefPtr<MediaValues> copy() const OVERRIDE; | |
| 40 virtual bool isSafeToSendToAnotherThread() const OVERRIDE; | |
| 41 virtual bool computeLength(double value, unsigned short type, int& result) c
onst OVERRIDE; | |
| 42 | |
| 43 virtual int viewportWidth() const OVERRIDE; | |
| 44 virtual int viewportHeight() const OVERRIDE; | |
| 45 virtual int deviceWidth() const OVERRIDE; | |
| 46 virtual int deviceHeight() const OVERRIDE; | |
| 47 virtual float devicePixelRatio() const OVERRIDE; | |
| 48 virtual int colorBitsPerComponent() const OVERRIDE; | |
| 49 virtual int monochromeBitsPerComponent() const OVERRIDE; | |
| 50 virtual PointerDeviceType pointer() const OVERRIDE; | |
| 51 virtual bool threeDEnabled() const OVERRIDE; | |
| 52 virtual bool scanMediaType() const OVERRIDE; | |
| 53 virtual bool screenMediaType() const OVERRIDE; | |
| 54 virtual bool printMediaType() const OVERRIDE; | |
| 55 virtual bool strictMode() const OVERRIDE; | |
| 56 virtual Document* document() const OVERRIDE; | |
| 57 virtual bool hasValues() const OVERRIDE; | |
| 58 | |
| 59 protected: | |
| 60 MediaValuesCached(LocalFrame*, RenderStyle*); | |
| 61 MediaValuesCached(const MediaValuesCachedData&); | |
| 62 | |
| 63 MediaValuesCachedData m_data; | |
| 64 }; | |
| 65 | |
| 66 } // namespace | |
| 67 | |
| 68 #endif // MediaValuesCached_h | |
| OLD | NEW |