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

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: Reverted to version that expects GetHiddenValue to not return an empty Handle for undefined Created 7 years, 5 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 14 matching lines...) Expand all
25 25
26 #ifndef CustomEvent_h 26 #ifndef CustomEvent_h
27 #define CustomEvent_h 27 #define CustomEvent_h
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 typedef EventInit CustomEventInit;
haraken 2013/06/27 04:50:27 Why do you need to make this change? Given the spe
adamk 2013/06/27 17:11:45 I asked for this change; I just see a typedef as c
jww 2013/06/27 17:44:42 adamk's response is what I was going to say as wel
36 CustomEventInit();
37
38 ScriptValue detail;
39 };
40 36
41 class CustomEvent : public Event { 37 class CustomEvent : public Event {
42 public: 38 public:
43 virtual ~CustomEvent(); 39 virtual ~CustomEvent();
44 40
45 static PassRefPtr<CustomEvent> create() 41 static PassRefPtr<CustomEvent> create()
46 { 42 {
47 return adoptRef(new CustomEvent); 43 return adoptRef(new CustomEvent);
48 } 44 }
49 45
50 static PassRefPtr<CustomEvent> create(const AtomicString& type, const Custom EventInit& initializer) 46 static PassRefPtr<CustomEvent> create(const AtomicString& type, const Custom EventInit& initializer)
51 { 47 {
52 return adoptRef(new CustomEvent(type, initializer)); 48 return adoptRef(new CustomEvent(type, initializer));
53 } 49 }
54 50
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>); 51 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelab le, PassRefPtr<SerializedScriptValue>);
57 52
58 virtual const AtomicString& interfaceName() const; 53 virtual const AtomicString& interfaceName() const;
59 54
60 const ScriptValue& detail() const { return m_detail; }
61 PassRefPtr<SerializedScriptValue> serializedScriptValue() { return m_seriali zedScriptValue; } 55 PassRefPtr<SerializedScriptValue> serializedScriptValue() { return m_seriali zedScriptValue; }
62 56
63 private: 57 private:
64 CustomEvent(); 58 CustomEvent();
65 CustomEvent(const AtomicString& type, const CustomEventInit& initializer); 59 CustomEvent(const AtomicString& type, const CustomEventInit& initializer);
66 60
67 ScriptValue m_detail;
68 RefPtr<SerializedScriptValue> m_serializedScriptValue; 61 RefPtr<SerializedScriptValue> m_serializedScriptValue;
69 }; 62 };
70 63
71 } // namespace WebCore 64 } // namespace WebCore
72 65
73 #endif // CustomEvent_h 66 #endif // CustomEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698