| OLD | NEW |
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 static PassRefPtrWillBeRawPtr<CloseEvent> create(const AtomicString& type, c
onst CloseEventInit& initializer) | 59 static PassRefPtrWillBeRawPtr<CloseEvent> create(const AtomicString& type, c
onst CloseEventInit& initializer) |
| 60 { | 60 { |
| 61 return adoptRefWillBeNoop(new CloseEvent(type, initializer)); | 61 return adoptRefWillBeNoop(new CloseEvent(type, initializer)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool wasClean() const { return m_wasClean; } | 64 bool wasClean() const { return m_wasClean; } |
| 65 unsigned short code() const { return m_code; } | 65 unsigned short code() const { return m_code; } |
| 66 String reason() const { return m_reason; } | 66 String reason() const { return m_reason; } |
| 67 | 67 |
| 68 // Event function. | 68 // Event function. |
| 69 virtual const AtomicString& interfaceName() const override { return EventNam
es::CloseEvent; } | 69 const AtomicString& interfaceName() const override { return EventNames::Clos
eEvent; } |
| 70 | 70 |
| 71 DEFINE_INLINE_VIRTUAL_TRACE() { Event::trace(visitor); } | 71 DEFINE_INLINE_VIRTUAL_TRACE() { Event::trace(visitor); } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 CloseEvent() | 74 CloseEvent() |
| 75 : Event(EventTypeNames::close, false, false) | 75 : Event(EventTypeNames::close, false, false) |
| 76 , m_wasClean(false) | 76 , m_wasClean(false) |
| 77 , m_code(0) { } | 77 , m_code(0) { } |
| 78 | 78 |
| 79 CloseEvent(bool wasClean, int code, const String& reason) | 79 CloseEvent(bool wasClean, int code, const String& reason) |
| 80 : Event(EventTypeNames::close, false, false) | 80 : Event(EventTypeNames::close, false, false) |
| 81 , m_wasClean(wasClean) | 81 , m_wasClean(wasClean) |
| 82 , m_code(code) | 82 , m_code(code) |
| 83 , m_reason(reason) { } | 83 , m_reason(reason) { } |
| 84 | 84 |
| 85 CloseEvent(const AtomicString& type, const CloseEventInit& initializer); | 85 CloseEvent(const AtomicString& type, const CloseEventInit& initializer); |
| 86 | 86 |
| 87 bool m_wasClean; | 87 bool m_wasClean; |
| 88 unsigned short m_code; | 88 unsigned short m_code; |
| 89 String m_reason; | 89 String m_reason; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace blink | 92 } // namespace blink |
| 93 | 93 |
| 94 #endif // CloseEvent_h | 94 #endif // CloseEvent_h |
| OLD | NEW |