| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 #include "wtf/MainThread.h" | 104 #include "wtf/MainThread.h" |
| 105 #include "wtf/MathExtras.h" | 105 #include "wtf/MathExtras.h" |
| 106 #include "wtf/text/WTFString.h" | 106 #include "wtf/text/WTFString.h" |
| 107 #include <algorithm> | 107 #include <algorithm> |
| 108 | 108 |
| 109 using std::min; | 109 using std::min; |
| 110 using std::max; | 110 using std::max; |
| 111 | 111 |
| 112 namespace WebCore { | 112 namespace WebCore { |
| 113 | 113 |
| 114 class PostMessageTimer : public TimerBase { | 114 class PostMessageTimer FINAL : public TimerBase { |
| 115 public: | 115 public: |
| 116 PostMessageTimer(DOMWindow* window, PassRefPtr<SerializedScriptValue> messag
e, const String& sourceOrigin, PassRefPtr<DOMWindow> source, PassOwnPtr<MessageP
ortChannelArray> channels, SecurityOrigin* targetOrigin, PassRefPtr<ScriptCallSt
ack> stackTrace) | 116 PostMessageTimer(DOMWindow* window, PassRefPtr<SerializedScriptValue> messag
e, const String& sourceOrigin, PassRefPtr<DOMWindow> source, PassOwnPtr<MessageP
ortChannelArray> channels, SecurityOrigin* targetOrigin, PassRefPtr<ScriptCallSt
ack> stackTrace) |
| 117 : m_window(window) | 117 : m_window(window) |
| 118 , m_message(message) | 118 , m_message(message) |
| 119 , m_origin(sourceOrigin) | 119 , m_origin(sourceOrigin) |
| 120 , m_source(source) | 120 , m_source(source) |
| 121 , m_channels(channels) | 121 , m_channels(channels) |
| 122 , m_targetOrigin(targetOrigin) | 122 , m_targetOrigin(targetOrigin) |
| 123 , m_stackTrace(stackTrace) | 123 , m_stackTrace(stackTrace) |
| 124 { | 124 { |
| 125 } | 125 } |
| 126 | 126 |
| 127 PassRefPtr<MessageEvent> event() | 127 PassRefPtr<MessageEvent> event() |
| 128 { | 128 { |
| 129 return MessageEvent::create(m_channels.release(), m_message, m_origin, S
tring(), m_source); | 129 return MessageEvent::create(m_channels.release(), m_message, m_origin, S
tring(), m_source); |
| 130 | 130 |
| 131 } | 131 } |
| 132 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } | 132 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } |
| 133 ScriptCallStack* stackTrace() const { return m_stackTrace.get(); } | 133 ScriptCallStack* stackTrace() const { return m_stackTrace.get(); } |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 virtual void fired() | 136 virtual void fired() OVERRIDE |
| 137 { | 137 { |
| 138 m_window->postMessageTimerFired(adoptPtr(this)); | 138 m_window->postMessageTimerFired(adoptPtr(this)); |
| 139 // This object is deleted now. | 139 // This object is deleted now. |
| 140 } | 140 } |
| 141 | 141 |
| 142 RefPtr<DOMWindow> m_window; | 142 RefPtr<DOMWindow> m_window; |
| 143 RefPtr<SerializedScriptValue> m_message; | 143 RefPtr<SerializedScriptValue> m_message; |
| 144 String m_origin; | 144 String m_origin; |
| 145 RefPtr<DOMWindow> m_source; | 145 RefPtr<DOMWindow> m_source; |
| 146 OwnPtr<MessagePortChannelArray> m_channels; | 146 OwnPtr<MessagePortChannelArray> m_channels; |
| (...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>:
:lifecycleNotifier()); | 1865 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>:
:lifecycleNotifier()); |
| 1866 } | 1866 } |
| 1867 | 1867 |
| 1868 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier() | 1868 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier() |
| 1869 { | 1869 { |
| 1870 return DOMWindowLifecycleNotifier::create(this); | 1870 return DOMWindowLifecycleNotifier::create(this); |
| 1871 } | 1871 } |
| 1872 | 1872 |
| 1873 | 1873 |
| 1874 } // namespace WebCore | 1874 } // namespace WebCore |
| OLD | NEW |