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 26 matching lines...) Expand all Loading... |
37 PopStateEvent::PopStateEvent(const AtomicString& type, | 37 PopStateEvent::PopStateEvent(const AtomicString& type, |
38 const PopStateEventInit& initializer) | 38 const PopStateEventInit& initializer) |
39 : Event(type, initializer), m_history(nullptr) { | 39 : Event(type, initializer), m_history(nullptr) { |
40 if (initializer.hasState()) | 40 if (initializer.hasState()) |
41 m_state = initializer.state(); | 41 m_state = initializer.state(); |
42 } | 42 } |
43 | 43 |
44 PopStateEvent::PopStateEvent(PassRefPtr<SerializedScriptValue> serializedState, | 44 PopStateEvent::PopStateEvent(PassRefPtr<SerializedScriptValue> serializedState, |
45 History* history) | 45 History* history) |
46 : Event(EventTypeNames::popstate, false, true), | 46 : Event(EventTypeNames::popstate, false, true), |
47 m_serializedState(serializedState), | 47 m_serializedState(std::move(serializedState)), |
48 m_history(history) {} | 48 m_history(history) {} |
49 | 49 |
50 PopStateEvent::~PopStateEvent() {} | 50 PopStateEvent::~PopStateEvent() {} |
51 | 51 |
52 PopStateEvent* PopStateEvent::create() { | 52 PopStateEvent* PopStateEvent::create() { |
53 return new PopStateEvent; | 53 return new PopStateEvent; |
54 } | 54 } |
55 | 55 |
56 PopStateEvent* PopStateEvent::create( | 56 PopStateEvent* PopStateEvent::create( |
57 PassRefPtr<SerializedScriptValue> serializedState, | 57 PassRefPtr<SerializedScriptValue> serializedState, |
58 History* history) { | 58 History* history) { |
59 return new PopStateEvent(std::move(serializedState), history); | 59 return new PopStateEvent(std::move(serializedState), history); |
60 } | 60 } |
61 | 61 |
62 PopStateEvent* PopStateEvent::create(const AtomicString& type, | 62 PopStateEvent* PopStateEvent::create(const AtomicString& type, |
63 const PopStateEventInit& initializer) { | 63 const PopStateEventInit& initializer) { |
64 return new PopStateEvent(type, initializer); | 64 return new PopStateEvent(type, initializer); |
65 } | 65 } |
66 | 66 |
67 const AtomicString& PopStateEvent::interfaceName() const { | 67 const AtomicString& PopStateEvent::interfaceName() const { |
68 return EventNames::PopStateEvent; | 68 return EventNames::PopStateEvent; |
69 } | 69 } |
70 | 70 |
71 DEFINE_TRACE(PopStateEvent) { | 71 DEFINE_TRACE(PopStateEvent) { |
72 visitor->trace(m_history); | 72 visitor->trace(m_history); |
73 Event::trace(visitor); | 73 Event::trace(visitor); |
74 } | 74 } |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
OLD | NEW |