| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "wtf/MathExtras.h" | 42 #include "wtf/MathExtras.h" |
| 43 #include "wtf/StdLibExtras.h" | 43 #include "wtf/StdLibExtras.h" |
| 44 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
| 45 | 45 |
| 46 using namespace std; | 46 using namespace std; |
| 47 | 47 |
| 48 namespace WebCore { | 48 namespace WebCore { |
| 49 | 49 |
| 50 class RepeatEvent FINAL : public Event { | 50 class RepeatEvent FINAL : public Event { |
| 51 public: | 51 public: |
| 52 static PassRefPtr<RepeatEvent> create(const AtomicString& type, int repeat) | 52 static PassRefPtrWillBeRawPtr<RepeatEvent> create(const AtomicString& type,
int repeat) |
| 53 { | 53 { |
| 54 return adoptRef(new RepeatEvent(type, false, false, repeat)); | 54 return adoptRefWillBeRefCountedGarbageCollected(new RepeatEvent(type, fa
lse, false, repeat)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual ~RepeatEvent() { } | 57 virtual ~RepeatEvent() { } |
| 58 | 58 |
| 59 int repeat() const { return m_repeat; } | 59 int repeat() const { return m_repeat; } |
| 60 |
| 61 virtual void trace(Visitor* visitor) { } |
| 62 |
| 60 protected: | 63 protected: |
| 61 RepeatEvent(const AtomicString& type, bool canBubble, bool cancelable, int r
epeat = -1) | 64 RepeatEvent(const AtomicString& type, bool canBubble, bool cancelable, int r
epeat = -1) |
| 62 : Event(type, canBubble, cancelable) | 65 : Event(type, canBubble, cancelable) |
| 63 , m_repeat(repeat) | 66 , m_repeat(repeat) |
| 64 { | 67 { |
| 65 } | 68 } |
| 69 |
| 66 private: | 70 private: |
| 67 int m_repeat; | 71 int m_repeat; |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 inline RepeatEvent* toRepeatEvent(Event* event) | 74 inline RepeatEvent* toRepeatEvent(Event* event) |
| 71 { | 75 { |
| 72 ASSERT_WITH_SECURITY_IMPLICATION(!event || event->type() == "repeatn"); | 76 ASSERT_WITH_SECURITY_IMPLICATION(!event || event->type() == "repeatn"); |
| 73 return static_cast<RepeatEvent*>(event); | 77 return static_cast<RepeatEvent*>(event); |
| 74 } | 78 } |
| 75 | 79 |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 if (eventType == "repeatn") { | 1321 if (eventType == "repeatn") { |
| 1318 unsigned repeatEventCount = m_repeatEventCountList.first(); | 1322 unsigned repeatEventCount = m_repeatEventCountList.first(); |
| 1319 m_repeatEventCountList.remove(0); | 1323 m_repeatEventCountList.remove(0); |
| 1320 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount)); | 1324 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount)); |
| 1321 } else { | 1325 } else { |
| 1322 dispatchEvent(Event::create(eventType)); | 1326 dispatchEvent(Event::create(eventType)); |
| 1323 } | 1327 } |
| 1324 } | 1328 } |
| 1325 | 1329 |
| 1326 } | 1330 } |
| OLD | NEW |