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

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

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 17 matching lines...) Expand all
28 28
29 #include "bindings/v8/ScriptValue.h" 29 #include "bindings/v8/ScriptValue.h"
30 #include "bindings/v8/SerializedScriptValue.h" 30 #include "bindings/v8/SerializedScriptValue.h"
31 #include "core/dom/Event.h" 31 #include "core/dom/Event.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 struct CustomEventInit : public EventInit { 35 struct CustomEventInit : public EventInit {
36 CustomEventInit(); 36 CustomEventInit();
37 37
38 ScriptValue detail; 38 bool detailIsSet;
39 }; 39 };
40 40
41 class CustomEvent : public Event { 41 class CustomEvent : public Event {
42 public: 42 public:
43 virtual ~CustomEvent(); 43 virtual ~CustomEvent();
44 44
45 static PassRefPtr<CustomEvent> create() 45 static PassRefPtr<CustomEvent> create()
46 { 46 {
47 return adoptRef(new CustomEvent); 47 return adoptRef(new CustomEvent);
48 } 48 }
49 49
50 static PassRefPtr<CustomEvent> create(const AtomicString& type, const Custom EventInit& initializer) 50 static PassRefPtr<CustomEvent> create(const AtomicString& type, const Custom EventInit& initializer)
51 { 51 {
52 return adoptRef(new CustomEvent(type, initializer)); 52 return adoptRef(new CustomEvent(type, initializer));
53 } 53 }
54 54
55 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le, const ScriptValue& detail);
56 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le, PassRefPtr<SerializedScriptValue>); 55 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le, PassRefPtr<SerializedScriptValue>);
57 56
58 virtual const AtomicString& interfaceName() const; 57 virtual const AtomicString& interfaceName() const;
59 58
60 const ScriptValue& detail() const { return m_detail; }
61 PassRefPtr<SerializedScriptValue> serializedScriptValue() { return m_seriali zedScriptValue; } 59 PassRefPtr<SerializedScriptValue> serializedScriptValue() { return m_seriali zedScriptValue; }
62 60
61 bool isDetailSet() const { return m_detailIsSet; }
62
63 private: 63 private:
64 CustomEvent(); 64 CustomEvent();
65 CustomEvent(const AtomicString& type, const CustomEventInit& initializer); 65 CustomEvent(const AtomicString& type, const CustomEventInit& initializer);
66 66
67 ScriptValue m_detail;
68 RefPtr<SerializedScriptValue> m_serializedScriptValue; 67 RefPtr<SerializedScriptValue> m_serializedScriptValue;
68
69 bool m_detailIsSet;
69 }; 70 };
70 71
71 } // namespace WebCore 72 } // namespace WebCore
72 73
73 #endif // CustomEvent_h 74 #endif // CustomEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698