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

Side by Side Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 404953003: DevTools: Async call stacks for window.postMessage() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 : SuspendableTimer(window.document()) 121 : SuspendableTimer(window.document())
122 , m_window(&window) 122 , m_window(&window)
123 , m_message(message) 123 , m_message(message)
124 , m_origin(sourceOrigin) 124 , m_origin(sourceOrigin)
125 , m_source(source) 125 , m_source(source)
126 , m_channels(channels) 126 , m_channels(channels)
127 , m_targetOrigin(targetOrigin) 127 , m_targetOrigin(targetOrigin)
128 , m_stackTrace(stackTrace) 128 , m_stackTrace(stackTrace)
129 , m_userGestureToken(userGestureToken) 129 , m_userGestureToken(userGestureToken)
130 { 130 {
131 m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarti ng(executionContext(), "postMessage");
131 } 132 }
132 133
133 PassRefPtrWillBeRawPtr<MessageEvent> event() 134 PassRefPtrWillBeRawPtr<MessageEvent> event()
134 { 135 {
135 return MessageEvent::create(m_channels.release(), m_message, m_origin, S tring(), m_source.get()); 136 return MessageEvent::create(m_channels.release(), m_message, m_origin, S tring(), m_source.get());
136 137
137 } 138 }
138 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); } 139 SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); }
139 ScriptCallStack* stackTrace() const { return m_stackTrace.get(); } 140 ScriptCallStack* stackTrace() const { return m_stackTrace.get(); }
140 UserGestureToken* userGestureToken() const { return m_userGestureToken.get() ; } 141 UserGestureToken* userGestureToken() const { return m_userGestureToken.get() ; }
141 142
142 private: 143 private:
143 virtual void fired() OVERRIDE 144 virtual void fired() OVERRIDE
144 { 145 {
146 InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceA syncOperationCompletedCallbackStarting(executionContext(), m_asyncOperationId);
145 m_window->postMessageTimerFired(this); 147 m_window->postMessageTimerFired(this);
146 // This object is deleted now. 148 // This object is deleted now.
149 InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
147 } 150 }
148 151
149 // FIXME: Oilpan: This raw pointer is safe because the PostMessageTimer is 152 // FIXME: Oilpan: This raw pointer is safe because the PostMessageTimer is
150 // owned by the LocalDOMWindow. Ideally PostMessageTimer should be moved to 153 // owned by the LocalDOMWindow. Ideally PostMessageTimer should be moved to
151 // the heap and use Member<LocalDOMWindow>. 154 // the heap and use Member<LocalDOMWindow>.
152 LocalDOMWindow* m_window; 155 LocalDOMWindow* m_window;
153 RefPtr<SerializedScriptValue> m_message; 156 RefPtr<SerializedScriptValue> m_message;
154 String m_origin; 157 String m_origin;
155 RefPtrWillBePersistent<LocalDOMWindow> m_source; 158 RefPtrWillBePersistent<LocalDOMWindow> m_source;
156 OwnPtr<MessagePortChannelArray> m_channels; 159 OwnPtr<MessagePortChannelArray> m_channels;
157 RefPtr<SecurityOrigin> m_targetOrigin; 160 RefPtr<SecurityOrigin> m_targetOrigin;
158 RefPtrWillBePersistent<ScriptCallStack> m_stackTrace; 161 RefPtrWillBePersistent<ScriptCallStack> m_stackTrace;
159 RefPtr<UserGestureToken> m_userGestureToken; 162 RefPtr<UserGestureToken> m_userGestureToken;
163 int m_asyncOperationId;
160 }; 164 };
161 165
162 static void disableSuddenTermination() 166 static void disableSuddenTermination()
163 { 167 {
164 blink::Platform::current()->suddenTerminationChanged(false); 168 blink::Platform::current()->suddenTerminationChanged(false);
165 } 169 }
166 170
167 static void enableSuddenTermination() 171 static void enableSuddenTermination()
168 { 172 {
169 blink::Platform::current()->suddenTerminationChanged(true); 173 blink::Platform::current()->suddenTerminationChanged(true);
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 visitor->trace(m_localStorage); 1953 visitor->trace(m_localStorage);
1950 visitor->trace(m_applicationCache); 1954 visitor->trace(m_applicationCache);
1951 visitor->trace(m_performance); 1955 visitor->trace(m_performance);
1952 visitor->trace(m_css); 1956 visitor->trace(m_css);
1953 visitor->trace(m_eventQueue); 1957 visitor->trace(m_eventQueue);
1954 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); 1958 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor);
1955 EventTargetWithInlineData::trace(visitor); 1959 EventTargetWithInlineData::trace(visitor);
1956 } 1960 }
1957 1961
1958 } // namespace blink 1962 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698