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

Side by Side Diff: Source/modules/websockets/CloseEvent.h

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webmidi/MIDIPort.cpp ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #ifndef CloseEvent_h 31 #ifndef CloseEvent_h
32 #define CloseEvent_h 32 #define CloseEvent_h
33 33
34 #include "modules/EventModules.h" 34 #include "modules/EventModules.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 struct CloseEventInit : public EventInit { 38 struct CloseEventInit : public EventInit {
39 CloseEventInit() 39 CloseEventInit()
40 : wasClean(false) 40 : wasClean(false)
41 , code(0) 41 , code(0) { }
42 {
43 }
44 42
45 bool wasClean; 43 bool wasClean;
46 unsigned short code; 44 unsigned short code;
47 String reason; 45 String reason;
48 }; 46 };
49 47
50 class CloseEvent FINAL : public Event { 48 class CloseEvent FINAL : public Event {
51 DEFINE_WRAPPERTYPEINFO(); 49 DEFINE_WRAPPERTYPEINFO();
52 public: 50 public:
53 static PassRefPtrWillBeRawPtr<CloseEvent> create() 51 static PassRefPtrWillBeRawPtr<CloseEvent> create()
(...skipping 17 matching lines...) Expand all
71 69
72 // Event function. 70 // Event function.
73 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam es::CloseEvent; } 71 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam es::CloseEvent; }
74 72
75 virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); } 73 virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); }
76 74
77 private: 75 private:
78 CloseEvent() 76 CloseEvent()
79 : Event(EventTypeNames::close, false, false) 77 : Event(EventTypeNames::close, false, false)
80 , m_wasClean(false) 78 , m_wasClean(false)
81 , m_code(0) 79 , m_code(0) { }
82 {
83 ScriptWrappable::init(this);
84 }
85 80
86 CloseEvent(bool wasClean, int code, const String& reason) 81 CloseEvent(bool wasClean, int code, const String& reason)
87 : Event(EventTypeNames::close, false, false) 82 : Event(EventTypeNames::close, false, false)
88 , m_wasClean(wasClean) 83 , m_wasClean(wasClean)
89 , m_code(code) 84 , m_code(code)
90 , m_reason(reason) 85 , m_reason(reason) { }
91 {
92 ScriptWrappable::init(this);
93 }
94 86
95 CloseEvent(const AtomicString& type, const CloseEventInit& initializer) 87 CloseEvent(const AtomicString& type, const CloseEventInit& initializer)
96 : Event(type, initializer) 88 : Event(type, initializer)
97 , m_wasClean(initializer.wasClean) 89 , m_wasClean(initializer.wasClean)
98 , m_code(initializer.code) 90 , m_code(initializer.code)
99 , m_reason(initializer.reason) 91 , m_reason(initializer.reason) { }
100 {
101 ScriptWrappable::init(this);
102 }
103 92
104 bool m_wasClean; 93 bool m_wasClean;
105 unsigned short m_code; 94 unsigned short m_code;
106 String m_reason; 95 String m_reason;
107 }; 96 };
108 97
109 } // namespace blink 98 } // namespace blink
110 99
111 #endif // CloseEvent_h 100 #endif // CloseEvent_h
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIPort.cpp ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698