Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/core/dom/CustomEvent.cpp

Issue 17063016: Remove leak of objects between isolated worlds on custom events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
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 23 matching lines...) Expand all
34 { 34 {
35 } 35 }
36 36
37 CustomEvent::CustomEvent() 37 CustomEvent::CustomEvent()
38 { 38 {
39 ScriptWrappable::init(this); 39 ScriptWrappable::init(this);
40 } 40 }
41 41
42 CustomEvent::CustomEvent(const AtomicString& type, const CustomEventInit& initia lizer) 42 CustomEvent::CustomEvent(const AtomicString& type, const CustomEventInit& initia lizer)
43 : Event(type, initializer) 43 : Event(type, initializer)
44 , m_detail(initializer.detail)
45 { 44 {
46 ScriptWrappable::init(this); 45 ScriptWrappable::init(this);
47 } 46 }
48 47
49 CustomEvent::~CustomEvent() 48 CustomEvent::~CustomEvent()
50 { 49 {
51 } 50 }
52 51
53 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& detail) 52 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable)
54 { 53 {
55 ASSERT(!m_serializedScriptValue.get()); 54 ASSERT(!m_serializedScriptValue.get());
56 if (dispatched()) 55 if (dispatched())
57 return; 56 return;
58 57
59 initEvent(type, canBubble, cancelable); 58 initEvent(type, canBubble, cancelable);
60
61 m_detail = detail;
62 } 59 }
63 60
64 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue) 61 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue)
65 { 62 {
66 ASSERT(m_detail.hasNoValue());
67 if (dispatched()) 63 if (dispatched())
68 return; 64 return;
69 65
70 initEvent(type, canBubble, cancelable); 66 initEvent(type, canBubble, cancelable);
71 67
72 m_serializedScriptValue = serializedScriptValue; 68 m_serializedScriptValue = serializedScriptValue;
73 } 69 }
74 70
75 const AtomicString& CustomEvent::interfaceName() const 71 const AtomicString& CustomEvent::interfaceName() const
76 { 72 {
77 return eventNames().interfaceForCustomEvent; 73 return eventNames().interfaceForCustomEvent;
78 } 74 }
79 75
80 } // namespace WebCore 76 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698