| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/events/TextEvent.h" | 28 #include "core/events/TextEvent.h" |
| 29 | 29 |
| 30 #include "core/dom/DocumentFragment.h" | 30 #include "core/dom/DocumentFragment.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 PassRefPtr<TextEvent> TextEvent::create() | 34 PassRefPtrWillBeRawPtr<TextEvent> TextEvent::create() |
| 35 { | 35 { |
| 36 return adoptRef(new TextEvent); | 36 return adoptRefWillBeRefCountedGarbageCollected(new TextEvent); |
| 37 } | 37 } |
| 38 | 38 |
| 39 PassRefPtr<TextEvent> TextEvent::create(PassRefPtrWillBeRawPtr<AbstractView> vie
w, const String& data, TextEventInputType inputType) | 39 PassRefPtrWillBeRawPtr<TextEvent> TextEvent::create(PassRefPtrWillBeRawPtr<Abstr
actView> view, const String& data, TextEventInputType inputType) |
| 40 { | 40 { |
| 41 return adoptRef(new TextEvent(view, data, inputType)); | 41 return adoptRefWillBeRefCountedGarbageCollected(new TextEvent(view, data, in
putType)); |
| 42 } | 42 } |
| 43 | 43 |
| 44 PassRefPtr<TextEvent> TextEvent::createForPlainTextPaste(PassRefPtrWillBeRawPtr<
AbstractView> view, const String& data, bool shouldSmartReplace) | 44 PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForPlainTextPaste(PassRefPtrW
illBeRawPtr<AbstractView> view, const String& data, bool shouldSmartReplace) |
| 45 { | 45 { |
| 46 return adoptRef(new TextEvent(view, data, nullptr, shouldSmartReplace, false
)); | 46 return adoptRefWillBeRefCountedGarbageCollected(new TextEvent(view, data, nu
llptr, shouldSmartReplace, false)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 PassRefPtr<TextEvent> TextEvent::createForFragmentPaste(PassRefPtrWillBeRawPtr<A
bstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, b
ool shouldMatchStyle) | 49 PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForFragmentPaste(PassRefPtrWi
llBeRawPtr<AbstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSma
rtReplace, bool shouldMatchStyle) |
| 50 { | 50 { |
| 51 return adoptRef(new TextEvent(view, "", data, shouldSmartReplace, shouldMatc
hStyle)); | 51 return adoptRefWillBeRefCountedGarbageCollected(new TextEvent(view, "", data
, shouldSmartReplace, shouldMatchStyle)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 PassRefPtr<TextEvent> TextEvent::createForDrop(PassRefPtrWillBeRawPtr<AbstractVi
ew> view, const String& data) | 54 PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForDrop(PassRefPtrWillBeRawPt
r<AbstractView> view, const String& data) |
| 55 { | 55 { |
| 56 return adoptRef(new TextEvent(view, data, TextEventInputDrop)); | 56 return adoptRefWillBeRefCountedGarbageCollected(new TextEvent(view, data, Te
xtEventInputDrop)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 TextEvent::TextEvent() | 59 TextEvent::TextEvent() |
| 60 : m_inputType(TextEventInputKeyboard) | 60 : m_inputType(TextEventInputKeyboard) |
| 61 , m_shouldSmartReplace(false) | 61 , m_shouldSmartReplace(false) |
| 62 , m_shouldMatchStyle(false) | 62 , m_shouldMatchStyle(false) |
| 63 { | 63 { |
| 64 ScriptWrappable::init(this); | 64 ScriptWrappable::init(this); |
| 65 } | 65 } |
| 66 | 66 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 { | 105 { |
| 106 return EventNames::TextEvent; | 106 return EventNames::TextEvent; |
| 107 } | 107 } |
| 108 | 108 |
| 109 void TextEvent::trace(Visitor* visitor) | 109 void TextEvent::trace(Visitor* visitor) |
| 110 { | 110 { |
| 111 UIEvent::trace(visitor); | 111 UIEvent::trace(visitor); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace WebCore | 114 } // namespace WebCore |
| OLD | NEW |