Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 | 113 |
| 114 | 114 |
| 115 virtual void run(Page* page) | 115 virtual void run(Page* page) |
| 116 { | 116 { |
| 117 if (m_running) | 117 if (m_running) |
| 118 return; | 118 return; |
| 119 m_running = true; | 119 m_running = true; |
| 120 | 120 |
| 121 // 0. Flush pending frontend messages. | 121 // 0. Flush pending frontend messages. |
| 122 WebViewImpl* viewImpl = WebViewImpl::fromPage(page); | 122 WebViewImpl* viewImpl = WebViewImpl::fromPage(page); |
| 123 WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(viewImp l->devToolsAgent()); | 123 WebDevToolsAgentImpl* agentImpl = static_cast<WebDevToolsAgentImpl*>(vie wImpl->devToolsAgent()); |
| 124 agent->flushPendingFrontendMessages(); | 124 agentImpl->flushPendingFrontendMessages(); |
| 125 | 125 |
| 126 Vector<WebViewImpl*> views; | 126 Vector<WebViewImpl*> views; |
| 127 | 127 |
| 128 // 1. Disable input events. | 128 // 1. Disable input events. |
| 129 const HashSet<Page*>& pages = Page::ordinaryPages(); | 129 const HashSet<Page*>& pages = Page::ordinaryPages(); |
| 130 HashSet<Page*>::const_iterator end = pages.end(); | 130 HashSet<Page*>::const_iterator end = pages.end(); |
| 131 for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it ) { | 131 for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it ) { |
| 132 WebViewImpl* view = WebViewImpl::fromPage(*it); | 132 WebViewImpl* view = WebViewImpl::fromPage(*it); |
| 133 if (!view) | 133 if (!view) |
| 134 continue; | 134 continue; |
| 135 m_frozenViews.add(view); | 135 m_frozenViews.add(view); |
| 136 views.append(view); | 136 views.append(view); |
| 137 view->setIgnoreInputEvents(true); | 137 view->setIgnoreInputEvents(true); |
| 138 WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(vie w->devToolsAgent()); | |
|
pfeldman
2014/05/18 06:10:22
You should do this for this agent only - others do
dgozman
2014/05/19 09:55:49
Done.
| |
| 139 agent->client()->willEnterModalLoop(); | |
| 138 } | 140 } |
| 139 | 141 |
| 140 // 2. Disable active objects | 142 // 2. Disable active objects |
| 141 WebView::willEnterModalLoop(); | 143 WebView::willEnterModalLoop(); |
| 142 | 144 |
| 143 // 3. Process messages until quitNow is called. | 145 // 3. Process messages until quitNow is called. |
| 144 m_messageLoop->run(); | 146 m_messageLoop->run(); |
| 145 | 147 |
| 146 // 4. Resume active objects | 148 // 4. Resume active objects |
| 147 WebView::didExitModalLoop(); | 149 WebView::didExitModalLoop(); |
| 148 | 150 |
| 149 // 5. Resume input events. | 151 // 5. Resume input events. |
| 150 for (Vector<WebViewImpl*>::iterator it = views.begin(); it != views.end( ); ++it) { | 152 for (Vector<WebViewImpl*>::iterator it = views.begin(); it != views.end( ); ++it) { |
| 151 if (m_frozenViews.contains(*it)) { | 153 if (m_frozenViews.contains(*it)) { |
| 152 // The view was not closed during the dispatch. | 154 // The view was not closed during the dispatch. |
| 153 (*it)->setIgnoreInputEvents(false); | 155 (*it)->setIgnoreInputEvents(false); |
| 156 WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*> ((*it)->devToolsAgent()); | |
| 157 agent->client()->didExitModalLoop(); | |
| 154 } | 158 } |
| 155 } | 159 } |
| 156 | 160 |
| 157 // 6. All views have been resumed, clear the set. | 161 // 6. All views have been resumed, clear the set. |
| 158 m_frozenViews.clear(); | 162 m_frozenViews.clear(); |
| 159 | 163 |
| 160 m_running = false; | 164 m_running = false; |
| 161 } | 165 } |
| 162 | 166 |
| 163 virtual void quitNow() | 167 virtual void quitNow() |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 701 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) | 705 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) |
| 702 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 706 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
| 703 } | 707 } |
| 704 | 708 |
| 705 void WebDevToolsAgent::processPendingMessages() | 709 void WebDevToolsAgent::processPendingMessages() |
| 706 { | 710 { |
| 707 PageScriptDebugServer::shared().runPendingTasks(); | 711 PageScriptDebugServer::shared().runPendingTasks(); |
| 708 } | 712 } |
| 709 | 713 |
| 710 } // namespace blink | 714 } // namespace blink |
| OLD | NEW |