Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPaintValue.h

Issue 1866623002: Hook up CSSPaintValue::image to CSS Paint API callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CSSPaintValue_h 5 #ifndef CSSPaintValue_h
6 #define CSSPaintValue_h 6 #define CSSPaintValue_h
7 7
8 #include "core/css/CSSCustomIdentValue.h" 8 #include "core/css/CSSCustomIdentValue.h"
9 #include "core/css/CSSImageGeneratorValue.h" 9 #include "core/css/CSSImageGeneratorValue.h"
10 #include "core/css/CSSPaintImageGenerator.h"
10 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 class CSSPaintValue : public CSSImageGeneratorValue { 15 class CSSPaintValue : public CSSImageGeneratorValue {
15 public: 16 public:
16 static CSSPaintValue* create(CSSCustomIdentValue* name) 17 static CSSPaintValue* create(CSSCustomIdentValue* name)
17 { 18 {
18 return new CSSPaintValue(name); 19 return new CSSPaintValue(name);
19 } 20 }
(...skipping 12 matching lines...) Expand all
32 33
33 void loadSubimages(Document*) { } 34 void loadSubimages(Document*) { }
34 35
35 bool equals(const CSSPaintValue&) const; 36 bool equals(const CSSPaintValue&) const;
36 37
37 DECLARE_TRACE_AFTER_DISPATCH(); 38 DECLARE_TRACE_AFTER_DISPATCH();
38 39
39 private: 40 private:
40 explicit CSSPaintValue(CSSCustomIdentValue* name); 41 explicit CSSPaintValue(CSSCustomIdentValue* name);
41 42
43 class Observer final : public CSSPaintImageGenerator::Observer {
44 DISALLOW_NEW();
45 public:
46 explicit Observer(CSSPaintValue* ownerValue)
47 : m_ownerValue(ownerValue)
48 {
49 }
50
51 ~Observer() override { }
52 DEFINE_INLINE_TRACE()
53 {
54 visitor->trace(m_ownerValue);
55 }
56
57 void paintImageGeneratorReady() final;
58 private:
59 Member<CSSPaintValue> m_ownerValue;
60 };
61
62 void paintImageGeneratorReady();
63
42 Member<CSSCustomIdentValue> m_name; 64 Member<CSSCustomIdentValue> m_name;
65 Member<CSSPaintImageGenerator> m_generator;
66 Observer m_paintImageGeneratorObserver;
haraken 2016/04/08 04:31:19 How about just making CSSPaintValue CSSPaintImageG
ikilpatrick 2016/04/08 18:43:21 CSSPaintValue inherits from CSSValue which is a tr
43 }; 67 };
44 68
45 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPaintValue, isPaintValue()); 69 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPaintValue, isPaintValue());
46 70
47 } // namespace blink 71 } // namespace blink
48 72
49 #endif // CSSPaintValue_h 73 #endif // CSSPaintValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698