OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2009 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 13 matching lines...) Expand all Loading... |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #ifndef ClientRect_h | 27 #ifndef ClientRect_h |
28 #define ClientRect_h | 28 #define ClientRect_h |
29 | 29 |
30 #include "bindings/core/v8/ScriptWrappable.h" | 30 #include "bindings/core/v8/ScriptWrappable.h" |
31 #include "core/CoreExport.h" | 31 #include "core/CoreExport.h" |
32 #include "platform/geometry/FloatRect.h" | 32 #include "platform/geometry/FloatRect.h" |
33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
34 #include "wtf/PassRefPtr.h" | |
35 #include "wtf/RefCounted.h" | |
36 | 34 |
37 namespace blink { | 35 namespace blink { |
38 | 36 |
39 class IntRect; | 37 class IntRect; |
40 | 38 |
41 class CORE_EXPORT ClientRect final : public RefCountedWillBeGarbageCollected<Cli
entRect>, public ScriptWrappable { | 39 class CORE_EXPORT ClientRect final : public GarbageCollected<ClientRect>, public
ScriptWrappable { |
42 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
43 public: | 41 public: |
44 static PassRefPtrWillBeRawPtr<ClientRect> create() | 42 static ClientRect* create() |
45 { | 43 { |
46 return adoptRefWillBeNoop(new ClientRect); | 44 return new ClientRect; |
47 } | 45 } |
48 static PassRefPtrWillBeRawPtr<ClientRect> create(const IntRect& rect) | 46 static ClientRect* create(const IntRect& rect) |
49 { | 47 { |
50 return adoptRefWillBeNoop(new ClientRect(rect)); | 48 return new ClientRect(rect); |
51 } | 49 } |
52 static PassRefPtrWillBeRawPtr<ClientRect> create(const FloatRect& rect) | 50 static ClientRect* create(const FloatRect& rect) |
53 { | 51 { |
54 return adoptRefWillBeNoop(new ClientRect(rect)); | 52 return new ClientRect(rect); |
55 } | 53 } |
56 | 54 |
57 float top() const { return m_rect.y(); } | 55 float top() const { return m_rect.y(); } |
58 float right() const { return m_rect.maxX(); } | 56 float right() const { return m_rect.maxX(); } |
59 float bottom() const { return m_rect.maxY(); } | 57 float bottom() const { return m_rect.maxY(); } |
60 float left() const { return m_rect.x(); } | 58 float left() const { return m_rect.x(); } |
61 float width() const { return m_rect.width(); } | 59 float width() const { return m_rect.width(); } |
62 float height() const { return m_rect.height(); } | 60 float height() const { return m_rect.height(); } |
63 | 61 |
64 DEFINE_INLINE_TRACE() { } | 62 DEFINE_INLINE_TRACE() { } |
65 | 63 |
66 private: | 64 private: |
67 ClientRect(); | 65 ClientRect(); |
68 explicit ClientRect(const IntRect&); | 66 explicit ClientRect(const IntRect&); |
69 explicit ClientRect(const FloatRect&); | 67 explicit ClientRect(const FloatRect&); |
70 | 68 |
71 FloatRect m_rect; | 69 FloatRect m_rect; |
72 }; | 70 }; |
73 | 71 |
74 } // namespace blink | 72 } // namespace blink |
75 | 73 |
76 #endif // ClientRect_h | 74 #endif // ClientRect_h |
OLD | NEW |