| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 explicit CSSCanvasValue(const String& name) | 58 explicit CSSCanvasValue(const String& name) |
| 59 : CSSImageGeneratorValue(CanvasClass) | 59 : CSSImageGeneratorValue(CanvasClass) |
| 60 , m_canvasObserver(adoptPtrWillBeNoop(new CanvasObserverProxy(this))) | 60 , m_canvasObserver(adoptPtrWillBeNoop(new CanvasObserverProxy(this))) |
| 61 , m_name(name) | 61 , m_name(name) |
| 62 , m_element(nullptr) | 62 , m_element(nullptr) |
| 63 { | 63 { |
| 64 } | 64 } |
| 65 | 65 |
| 66 // NOTE: We put the CanvasObserver in a member instead of inheriting from it | 66 // NOTE: We put the CanvasObserver in a member instead of inheriting from it |
| 67 // to avoid adding a vptr to CSSCanvasValue. | 67 // to avoid adding a vptr to CSSCanvasValue. |
| 68 class CanvasObserverProxy FINAL : public NoBaseWillBeGarbageCollected<Canvas
ObserverProxy>, public CanvasObserver { | 68 class CanvasObserverProxy final : public NoBaseWillBeGarbageCollected<Canvas
ObserverProxy>, public CanvasObserver { |
| 69 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasObserverProxy); | 69 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasObserverProxy); |
| 70 public: | 70 public: |
| 71 explicit CanvasObserverProxy(CSSCanvasValue* ownerValue) : m_ownerValue(
ownerValue) { } | 71 explicit CanvasObserverProxy(CSSCanvasValue* ownerValue) : m_ownerValue(
ownerValue) { } |
| 72 | 72 |
| 73 virtual void canvasChanged(HTMLCanvasElement* canvas, const FloatRect& c
hangedRect) OVERRIDE | 73 virtual void canvasChanged(HTMLCanvasElement* canvas, const FloatRect& c
hangedRect) override |
| 74 { | 74 { |
| 75 m_ownerValue->canvasChanged(canvas, changedRect); | 75 m_ownerValue->canvasChanged(canvas, changedRect); |
| 76 } | 76 } |
| 77 virtual void canvasResized(HTMLCanvasElement* canvas) OVERRIDE | 77 virtual void canvasResized(HTMLCanvasElement* canvas) override |
| 78 { | 78 { |
| 79 m_ownerValue->canvasResized(canvas); | 79 m_ownerValue->canvasResized(canvas); |
| 80 } | 80 } |
| 81 #if !ENABLE(OILPAN) | 81 #if !ENABLE(OILPAN) |
| 82 virtual void canvasDestroyed(HTMLCanvasElement* canvas) OVERRIDE | 82 virtual void canvasDestroyed(HTMLCanvasElement* canvas) override |
| 83 { | 83 { |
| 84 m_ownerValue->canvasDestroyed(canvas); | 84 m_ownerValue->canvasDestroyed(canvas); |
| 85 } | 85 } |
| 86 #endif | 86 #endif |
| 87 virtual void trace(Visitor* visitor) OVERRIDE | 87 virtual void trace(Visitor* visitor) override |
| 88 { | 88 { |
| 89 visitor->trace(m_ownerValue); | 89 visitor->trace(m_ownerValue); |
| 90 CanvasObserver::trace(visitor); | 90 CanvasObserver::trace(visitor); |
| 91 } | 91 } |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 RawPtrWillBeMember<CSSCanvasValue> m_ownerValue; | 94 RawPtrWillBeMember<CSSCanvasValue> m_ownerValue; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 void canvasChanged(HTMLCanvasElement*, const FloatRect& changedRect); | 97 void canvasChanged(HTMLCanvasElement*, const FloatRect& changedRect); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 109 String m_name; | 109 String m_name; |
| 110 // The document supplies the element and owns it. | 110 // The document supplies the element and owns it. |
| 111 RawPtrWillBeWeakMember<HTMLCanvasElement> m_element; | 111 RawPtrWillBeWeakMember<HTMLCanvasElement> m_element; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCanvasValue, isCanvasValue()); | 114 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCanvasValue, isCanvasValue()); |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| 117 | 117 |
| 118 #endif // CSSCanvasValue_h | 118 #endif // CSSCanvasValue_h |
| OLD | NEW |