| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 PassRefPtrWillBeRawPtr<MessageEvent> event() | 135 PassRefPtrWillBeRawPtr<MessageEvent> event() |
| 136 { | 136 { |
| 137 return MessageEvent::create(m_channels.release(), m_message, m_origin, S
tring(), m_source.get()); | 137 return MessageEvent::create(m_channels.release(), m_message, m_origin, S
tring(), m_source.get()); |
| 138 | 138 |
| 139 } | 139 } |
| 140 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } | 140 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } |
| 141 ScriptCallStack* stackTrace() const { return m_stackTrace.get(); } | 141 ScriptCallStack* stackTrace() const { return m_stackTrace.get(); } |
| 142 UserGestureToken* userGestureToken() const { return m_userGestureToken.get()
; } | 142 UserGestureToken* userGestureToken() const { return m_userGestureToken.get()
; } |
| 143 LocalDOMWindow* source() const { return m_source.get(); } |
| 143 | 144 |
| 144 private: | 145 private: |
| 145 virtual void fired() OVERRIDE | 146 virtual void fired() OVERRIDE |
| 146 { | 147 { |
| 147 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceA
syncOperationCompletedCallbackStarting(executionContext(), m_asyncOperationId); | 148 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceA
syncOperationCompletedCallbackStarting(executionContext(), m_asyncOperationId); |
| 148 m_window->postMessageTimerFired(this); | 149 m_window->postMessageTimerFired(this); |
| 149 // This object is deleted now. | 150 // This object is deleted now. |
| 150 InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); | 151 InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); |
| 151 } | 152 } |
| 152 | 153 |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 if (!isCurrentlyDisplayedInFrame()) { | 873 if (!isCurrentlyDisplayedInFrame()) { |
| 873 m_postMessageTimers.remove(timer); | 874 m_postMessageTimers.remove(timer); |
| 874 return; | 875 return; |
| 875 } | 876 } |
| 876 | 877 |
| 877 RefPtrWillBeRawPtr<MessageEvent> event = timer->event(); | 878 RefPtrWillBeRawPtr<MessageEvent> event = timer->event(); |
| 878 | 879 |
| 879 // Give the embedder a chance to intercept this postMessage because this | 880 // Give the embedder a chance to intercept this postMessage because this |
| 880 // LocalDOMWindow might be a proxy for another in browsers that support | 881 // LocalDOMWindow might be a proxy for another in browsers that support |
| 881 // postMessage calls across WebKit instances. | 882 // postMessage calls across WebKit instances. |
| 882 if (m_frame->loader().client()->willCheckAndDispatchMessageEvent(timer->targ
etOrigin(), event.get())) { | 883 LocalFrame* source = timer->source()->document() ? timer->source()->document
()->frame() : 0; |
| 884 if (m_frame->client()->willCheckAndDispatchMessageEvent(timer->targetOrigin(
), event.get(), source)) { |
| 883 m_postMessageTimers.remove(timer); | 885 m_postMessageTimers.remove(timer); |
| 884 return; | 886 return; |
| 885 } | 887 } |
| 886 | 888 |
| 887 UserGestureIndicator gestureIndicator(timer->userGestureToken()); | 889 UserGestureIndicator gestureIndicator(timer->userGestureToken()); |
| 888 | 890 |
| 889 event->entangleMessagePorts(document()); | 891 event->entangleMessagePorts(document()); |
| 890 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->sta
ckTrace()); | 892 dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->sta
ckTrace()); |
| 891 m_postMessageTimers.remove(timer); | 893 m_postMessageTimers.remove(timer); |
| 892 } | 894 } |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 LifecycleContext<LocalDOMWindow>::trace(visitor); | 1922 LifecycleContext<LocalDOMWindow>::trace(visitor); |
| 1921 } | 1923 } |
| 1922 | 1924 |
| 1923 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) | 1925 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) |
| 1924 { | 1926 { |
| 1925 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. | 1927 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. |
| 1926 return v8::Handle<v8::Object>(); | 1928 return v8::Handle<v8::Object>(); |
| 1927 } | 1929 } |
| 1928 | 1930 |
| 1929 } // namespace blink | 1931 } // namespace blink |
| OLD | NEW |