Index: third_party/WebKit/Source/core/css/MediaValuesCached.h |
diff --git a/third_party/WebKit/Source/core/css/MediaValuesCached.h b/third_party/WebKit/Source/core/css/MediaValuesCached.h |
index 53c6734a7fb23610a3cb4011fc59b33f4709dac5..50b1a5a90588c4bab4f30ea109f0dd703313df13 100644 |
--- a/third_party/WebKit/Source/core/css/MediaValuesCached.h |
+++ b/third_party/WebKit/Source/core/css/MediaValuesCached.h |
@@ -12,7 +12,7 @@ namespace blink { |
class CORE_EXPORT MediaValuesCached final : public MediaValues { |
public: |
- struct MediaValuesCachedData { |
+ struct MediaValuesCachedData final { |
DISALLOW_NEW(); |
// Members variables must be thread safe, since they're copied to the parser thread |
double viewportWidth; |
@@ -50,14 +50,35 @@ public: |
, displayMode(WebDisplayModeBrowser) |
{ |
} |
+ |
+ explicit MediaValuesCachedData(Document&); |
+ |
+ MediaValuesCachedData deepCopy() const |
+ { |
+ MediaValuesCachedData data; |
+ data.viewportWidth = viewportWidth; |
+ data.viewportHeight = viewportHeight; |
+ data.deviceWidth = deviceWidth; |
+ data.deviceHeight = deviceHeight; |
+ data.devicePixelRatio = devicePixelRatio; |
+ data.colorBitsPerComponent = colorBitsPerComponent; |
+ data.monochromeBitsPerComponent = monochromeBitsPerComponent; |
+ data.primaryPointerType = primaryPointerType; |
+ data.availablePointerTypes = availablePointerTypes; |
+ data.primaryHoverType = primaryHoverType; |
+ data.availableHoverTypes = availableHoverTypes; |
+ data.defaultFontSize = defaultFontSize; |
+ data.threeDEnabled = threeDEnabled; |
+ data.strictMode = strictMode; |
+ data.mediaType = mediaType.isolatedCopy(); |
+ data.displayMode = displayMode; |
+ return data; |
+ } |
}; |
static PassRefPtrWillBeRawPtr<MediaValuesCached> create(); |
- static PassRefPtrWillBeRawPtr<MediaValuesCached> create(Document&); |
- static PassRefPtrWillBeRawPtr<MediaValuesCached> create(LocalFrame*); |
- static PassRefPtrWillBeRawPtr<MediaValuesCached> create(MediaValuesCachedData&); |
+ static PassRefPtrWillBeRawPtr<MediaValuesCached> create(const MediaValuesCachedData&); |
PassRefPtrWillBeRawPtr<MediaValues> copy() const override; |
- bool isSafeToSendToAnotherThread() const; |
bool computeLength(double value, CSSPrimitiveValue::UnitType, int& result) const override; |
bool computeLength(double value, CSSPrimitiveValue::UnitType, double& result) const override; |
@@ -90,6 +111,11 @@ protected: |
MediaValuesCachedData m_data; |
}; |
+template<> struct CrossThreadCopierBase<false, false, false, MediaValuesCached::MediaValuesCachedData> { |
Yoav Weiss
2016/02/01 09:29:30
Where is this used? Is it implicitly called somewh
hiroshige
2016/02/01 09:42:10
CrossThreadCopier is called inside threadSafeBind(
|
+ typedef MediaValuesCached::MediaValuesCachedData Type; |
+ static Type copy(const MediaValuesCached::MediaValuesCachedData& data) { return data.deepCopy(); } |
+}; |
+ |
} // namespace blink |
#endif // MediaValuesCached_h |