| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 PassRefPtr<SecurityOrigin> targetOrigin, | 107 PassRefPtr<SecurityOrigin> targetOrigin, |
| 108 std::unique_ptr<SourceLocation> location, | 108 std::unique_ptr<SourceLocation> location, |
| 109 UserGestureToken* userGestureToken) | 109 UserGestureToken* userGestureToken) |
| 110 : SuspendableTimer(window.document(), TaskType::PostedMessage), | 110 : SuspendableTimer(window.document(), TaskType::PostedMessage), |
| 111 m_event(event), | 111 m_event(event), |
| 112 m_window(&window), | 112 m_window(&window), |
| 113 m_targetOrigin(targetOrigin), | 113 m_targetOrigin(targetOrigin), |
| 114 m_location(std::move(location)), | 114 m_location(std::move(location)), |
| 115 m_userGestureToken(userGestureToken), | 115 m_userGestureToken(userGestureToken), |
| 116 m_disposalAllowed(true) { | 116 m_disposalAllowed(true) { |
| 117 InspectorInstrumentation::asyncTaskScheduled(window.document(), | 117 probe::asyncTaskScheduled(window.document(), "postMessage", this); |
| 118 "postMessage", this); | |
| 119 } | 118 } |
| 120 | 119 |
| 121 MessageEvent* event() const { return m_event; } | 120 MessageEvent* event() const { return m_event; } |
| 122 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } | 121 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } |
| 123 std::unique_ptr<SourceLocation> takeLocation() { | 122 std::unique_ptr<SourceLocation> takeLocation() { |
| 124 return std::move(m_location); | 123 return std::move(m_location); |
| 125 } | 124 } |
| 126 UserGestureToken* userGestureToken() const { | 125 UserGestureToken* userGestureToken() const { |
| 127 return m_userGestureToken.get(); | 126 return m_userGestureToken.get(); |
| 128 } | 127 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 140 visitor->trace(m_event); | 139 visitor->trace(m_event); |
| 141 visitor->trace(m_window); | 140 visitor->trace(m_window); |
| 142 SuspendableTimer::trace(visitor); | 141 SuspendableTimer::trace(visitor); |
| 143 } | 142 } |
| 144 | 143 |
| 145 // TODO(alexclarke): Override timerTaskRunner() to pass in a document specific | 144 // TODO(alexclarke): Override timerTaskRunner() to pass in a document specific |
| 146 // default task runner. | 145 // default task runner. |
| 147 | 146 |
| 148 private: | 147 private: |
| 149 void fired() override { | 148 void fired() override { |
| 150 InspectorInstrumentation::AsyncTask asyncTask(m_window->document(), this); | 149 probe::AsyncTask asyncTask(m_window->document(), this); |
| 151 m_disposalAllowed = false; | 150 m_disposalAllowed = false; |
| 152 m_window->postMessageTimerFired(this); | 151 m_window->postMessageTimerFired(this); |
| 153 dispose(); | 152 dispose(); |
| 154 // Oilpan optimization: unregister as an observer right away. | 153 // Oilpan optimization: unregister as an observer right away. |
| 155 clearContext(); | 154 clearContext(); |
| 156 } | 155 } |
| 157 | 156 |
| 158 void dispose() { m_window->removePostMessageTimer(this); } | 157 void dispose() { m_window->removePostMessageTimer(this); } |
| 159 | 158 |
| 160 Member<MessageEvent> m_event; | 159 Member<MessageEvent> m_event; |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 // For load events, send a separate load event to the enclosing frame only. | 1497 // For load events, send a separate load event to the enclosing frame only. |
| 1499 // This is a DOM extension and is independent of bubbling/capturing rules of | 1498 // This is a DOM extension and is independent of bubbling/capturing rules of |
| 1500 // the DOM. | 1499 // the DOM. |
| 1501 FrameOwner* owner = frame() ? frame()->owner() : nullptr; | 1500 FrameOwner* owner = frame() ? frame()->owner() : nullptr; |
| 1502 if (owner) | 1501 if (owner) |
| 1503 owner->dispatchLoad(); | 1502 owner->dispatchLoad(); |
| 1504 | 1503 |
| 1505 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad", | 1504 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad", |
| 1506 TRACE_EVENT_SCOPE_THREAD, "data", | 1505 TRACE_EVENT_SCOPE_THREAD, "data", |
| 1507 InspectorMarkLoadEvent::data(frame())); | 1506 InspectorMarkLoadEvent::data(frame())); |
| 1508 InspectorInstrumentation::loadEventFired(frame()); | 1507 probe::loadEventFired(frame()); |
| 1509 } | 1508 } |
| 1510 | 1509 |
| 1511 DispatchEventResult LocalDOMWindow::dispatchEvent(Event* event, | 1510 DispatchEventResult LocalDOMWindow::dispatchEvent(Event* event, |
| 1512 EventTarget* target) { | 1511 EventTarget* target) { |
| 1513 #if DCHECK_IS_ON() | 1512 #if DCHECK_IS_ON() |
| 1514 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden()); | 1513 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden()); |
| 1515 #endif | 1514 #endif |
| 1516 | 1515 |
| 1517 event->setTrusted(true); | 1516 event->setTrusted(true); |
| 1518 event->setTarget(target ? target : this); | 1517 event->setTarget(target ? target : this); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 DOMWindow::trace(visitor); | 1652 DOMWindow::trace(visitor); |
| 1654 Supplementable<LocalDOMWindow>::trace(visitor); | 1653 Supplementable<LocalDOMWindow>::trace(visitor); |
| 1655 } | 1654 } |
| 1656 | 1655 |
| 1657 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1656 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
| 1658 visitor->traceWrappers(m_customElements); | 1657 visitor->traceWrappers(m_customElements); |
| 1659 DOMWindow::traceWrappers(visitor); | 1658 DOMWindow::traceWrappers(visitor); |
| 1660 } | 1659 } |
| 1661 | 1660 |
| 1662 } // namespace blink | 1661 } // namespace blink |
| OLD | NEW |