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 #include "wtf/CrossThreadCopier.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class CORE_EXPORT MediaValuesCached final : public MediaValues { | 14 class CORE_EXPORT MediaValuesCached final : public MediaValues { |
14 public: | 15 public: |
15 struct MediaValuesCachedData final { | 16 struct MediaValuesCachedData final { |
16 DISALLOW_NEW(); | 17 DISALLOW_NEW(); |
17 // Members variables must be thread safe, since they're copied to the pa
rser thread | 18 // Members variables must be thread safe, since they're copied to the pa
rser thread |
18 double viewportWidth; | 19 double viewportWidth; |
19 double viewportHeight; | 20 double viewportHeight; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void overrideViewportDimensions(double width, double height) override; | 104 void overrideViewportDimensions(double width, double height) override; |
104 | 105 |
105 protected: | 106 protected: |
106 MediaValuesCached(); | 107 MediaValuesCached(); |
107 MediaValuesCached(LocalFrame*); | 108 MediaValuesCached(LocalFrame*); |
108 MediaValuesCached(const MediaValuesCachedData&); | 109 MediaValuesCached(const MediaValuesCachedData&); |
109 | 110 |
110 MediaValuesCachedData m_data; | 111 MediaValuesCachedData m_data; |
111 }; | 112 }; |
112 | 113 |
113 template <> | |
114 struct CrossThreadCopier<MediaValuesCached::MediaValuesCachedData> { | |
115 typedef MediaValuesCached::MediaValuesCachedData Type; | |
116 static Type copy(const MediaValuesCached::MediaValuesCachedData& data) { ret
urn data.deepCopy(); } | |
117 }; | |
118 | |
119 } // namespace blink | 114 } // namespace blink |
120 | 115 |
| 116 namespace WTF { |
| 117 |
| 118 template <> |
| 119 struct CrossThreadCopier<blink::MediaValuesCached::MediaValuesCachedData> { |
| 120 typedef blink::MediaValuesCached::MediaValuesCachedData Type; |
| 121 static Type copy(const blink::MediaValuesCached::MediaValuesCachedData& data
) { return data.deepCopy(); } |
| 122 }; |
| 123 |
| 124 } // namespace WTF |
| 125 |
121 #endif // MediaValuesCached_h | 126 #endif // MediaValuesCached_h |
OLD | NEW |