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

Side by Side Diff: Source/web/WebDevToolsAgentImpl.cpp

Issue 2023313002: Fixes Dartium crashing if trying to debug code associated with an iFrame. (Closed) Base URL: https://chromium.googlesource.com/dart/dartium/blink@2454_1
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2010-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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 void run(LocalFrame* frame) override 157 void run(LocalFrame* frame) override
158 { 158 {
159 if (m_running) 159 if (m_running)
160 return; 160 return;
161 m_running = true; 161 m_running = true;
162 162
163 // 0. Flush pending frontend messages. 163 // 0. Flush pending frontend messages.
164 WebLocalFrameImpl* frameImpl = WebLocalFrameImpl::fromFrame(frame); 164 WebLocalFrameImpl* frameImpl = WebLocalFrameImpl::fromFrame(frame);
165 WebDevToolsAgentImpl* agent = frameImpl->devToolsAgentImpl(); 165 WebDevToolsAgentImpl* agent = frameImpl->devToolsAgentImpl();
166
167 // FIXME(terry): Dart fix if the current iFrame doesn't have a dev tools
168 // agent then use the main frame's agent. This allow's
169 // debugging Dart code associated with an iFrame (that's
170 // not the main frame).
171 if (!agent) {
172 LocalFrame* mainFrame = frameImpl->frame()->localFrameRoot();
173 frameImpl = WebLocalFrameImpl::fromFrame(mainFrame);
174 agent = frameImpl->devToolsAgentImpl();
175 }
176
166 agent->flushPendingProtocolNotifications(); 177 agent->flushPendingProtocolNotifications();
167 178
168 Vector<WebViewImpl*> views; 179 Vector<WebViewImpl*> views;
169 Vector<WebFrameWidgetImpl*> widgets; 180 Vector<WebFrameWidgetImpl*> widgets;
170 181
171 // 1. Disable input events. 182 // 1. Disable input events.
172 const HashSet<WebViewImpl*>& viewImpls = WebViewImpl::allInstances(); 183 const HashSet<WebViewImpl*>& viewImpls = WebViewImpl::allInstances();
173 HashSet<WebViewImpl*>::const_iterator viewImplsEnd = viewImpls.end(); 184 HashSet<WebViewImpl*>::const_iterator viewImplsEnd = viewImpls.end();
174 for (HashSet<WebViewImpl*>::const_iterator it = viewImpls.begin(); it ! = viewImplsEnd; ++it) { 185 for (HashSet<WebViewImpl*>::const_iterator it = viewImpls.begin(); it ! = viewImplsEnd; ++it) {
175 WebViewImpl* view = *it; 186 WebViewImpl* view = *it;
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) 769 if (!InspectorBackendDispatcher::getCommandName(message, &commandName))
759 return false; 770 return false;
760 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_pauseCmd) 771 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_pauseCmd)
761 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointCmd) 772 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointCmd)
762 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointByUrlCmd) 773 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointByUrlCmd)
763 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) 774 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd)
764 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); 775 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd);
765 } 776 }
766 777
767 } // namespace blink 778 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698