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

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: Added GC test 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 16 matching lines...) Expand all
27 #include "core/dom/CustomEvent.h" 27 #include "core/dom/CustomEvent.h"
28 28
29 #include "core/dom/EventNames.h" 29 #include "core/dom/EventNames.h"
30 30
31 namespace WebCore { 31 namespace WebCore {
32 32
33 CustomEventInit::CustomEventInit() 33 CustomEventInit::CustomEventInit()
34 { 34 {
35 } 35 }
36 36
37 CustomEvent::CustomEvent() 37 CustomEvent::CustomEvent()
adamk 2013/06/27 00:15:04 You need to initialize m_detailIsSet here, otherwi
jww 2013/06/27 04:35:35 Getting rid of m_detailIsSet.
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) 44 , m_detailIsSet(initializer.detailIsSet)
45 { 45 {
46 ScriptWrappable::init(this); 46 ScriptWrappable::init(this);
47 } 47 }
48 48
49 CustomEvent::~CustomEvent() 49 CustomEvent::~CustomEvent()
50 { 50 {
51 } 51 }
52 52
53 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& detail)
54 {
55 ASSERT(!m_serializedScriptValue.get());
56 if (dispatched())
57 return;
58
59 initEvent(type, canBubble, cancelable);
60
61 m_detail = detail;
62 }
63
64 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue) 53 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue)
65 { 54 {
66 ASSERT(m_detail.hasNoValue());
67 if (dispatched()) 55 if (dispatched())
68 return; 56 return;
69 57
70 initEvent(type, canBubble, cancelable); 58 initEvent(type, canBubble, cancelable);
71 59
72 m_serializedScriptValue = serializedScriptValue; 60 m_serializedScriptValue = serializedScriptValue;
73 } 61 }
74 62
75 const AtomicString& CustomEvent::interfaceName() const 63 const AtomicString& CustomEvent::interfaceName() const
76 { 64 {
77 return eventNames().interfaceForCustomEvent; 65 return eventNames().interfaceForCustomEvent;
78 } 66 }
79 67
80 } // namespace WebCore 68 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698