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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 class DebuggerTask : public PageScriptDebugServer::Task { | 183 class DebuggerTask : public PageScriptDebugServer::Task { |
184 public: | 184 public: |
185 DebuggerTask(PassOwnPtr<WebDevToolsAgent::MessageDescriptor> descriptor) | 185 DebuggerTask(PassOwnPtr<WebDevToolsAgent::MessageDescriptor> descriptor) |
186 : m_descriptor(descriptor) | 186 : m_descriptor(descriptor) |
187 { | 187 { |
188 } | 188 } |
189 | 189 |
190 virtual ~DebuggerTask() { } | 190 virtual ~DebuggerTask() { } |
191 virtual void run() | 191 virtual void run() |
192 { | 192 { |
193 if (WebDevToolsAgent* webagent = m_descriptor->agent()) | 193 WebDevToolsAgent* webagent = m_descriptor->agent(); |
194 webagent->dispatchOnInspectorBackend(m_descriptor->message()); | 194 if (!webagent) |
| 195 return; |
| 196 |
| 197 WebDevToolsAgentImpl* agentImpl = static_cast<WebDevToolsAgentImpl*>(web
agent); |
| 198 if (agentImpl->m_attached) |
| 199 agentImpl->inspectorController()->dispatchMessageFromFrontend(m_desc
riptor->message()); |
195 } | 200 } |
196 | 201 |
197 private: | 202 private: |
198 OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor; | 203 OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor; |
199 }; | 204 }; |
200 | 205 |
201 WebDevToolsAgentImpl::WebDevToolsAgentImpl( | 206 WebDevToolsAgentImpl::WebDevToolsAgentImpl( |
202 WebViewImpl* webViewImpl, | 207 WebViewImpl* webViewImpl, |
203 WebDevToolsAgentClient* client) | 208 WebDevToolsAgentClient* client) |
204 : m_layerTreeId(0) | 209 : m_layerTreeId(0) |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 m_generatingEvent = true; | 442 m_generatingEvent = true; |
438 WebMouseEvent webEvent = WebMouseEventBuilder(m_webViewImpl->mainFrameImpl()
->frameView(), event); | 443 WebMouseEvent webEvent = WebMouseEventBuilder(m_webViewImpl->mainFrameImpl()
->frameView(), event); |
439 m_webViewImpl->handleInputEvent(webEvent); | 444 m_webViewImpl->handleInputEvent(webEvent); |
440 m_generatingEvent = false; | 445 m_generatingEvent = false; |
441 } | 446 } |
442 | 447 |
443 void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message) | 448 void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message) |
444 { | 449 { |
445 if (!m_attached) | 450 if (!m_attached) |
446 return; | 451 return; |
447 inspectorController()->dispatchMessageFromFrontend(message); | 452 if (WebDevToolsAgent::shouldInterruptForMessage(message)) |
| 453 PageScriptDebugServer::shared().runPendingTasks(); |
| 454 else |
| 455 inspectorController()->dispatchMessageFromFrontend(message); |
448 } | 456 } |
449 | 457 |
450 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) | 458 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) |
451 { | 459 { |
452 m_webViewImpl->inspectElementAt(point); | 460 m_webViewImpl->inspectElementAt(point); |
453 } | 461 } |
454 | 462 |
455 InspectorController* WebDevToolsAgentImpl::inspectorController() | 463 InspectorController* WebDevToolsAgentImpl::inspectorController() |
456 { | 464 { |
457 if (Page* page = m_webViewImpl->page()) | 465 if (Page* page = m_webViewImpl->page()) |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 584 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
577 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 585 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
578 } | 586 } |
579 | 587 |
580 void WebDevToolsAgent::processPendingMessages() | 588 void WebDevToolsAgent::processPendingMessages() |
581 { | 589 { |
582 PageScriptDebugServer::shared().runPendingTasks(); | 590 PageScriptDebugServer::shared().runPendingTasks(); |
583 } | 591 } |
584 | 592 |
585 } // namespace blink | 593 } // namespace blink |
OLD | NEW |