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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 static bool resumeForCreateWindow() | 156 static bool resumeForCreateWindow() |
157 { | 157 { |
158 return s_instance ? s_instance->quitForCreateWindow() : false; | 158 return s_instance ? s_instance->quitForCreateWindow() : false; |
159 } | 159 } |
160 | 160 |
161 private: | 161 private: |
162 ClientMessageLoopAdapter(PassOwnPtr<WebDevToolsAgentClient::WebKitClientMess
ageLoop> messageLoop) | 162 ClientMessageLoopAdapter(PassOwnPtr<WebDevToolsAgentClient::WebKitClientMess
ageLoop> messageLoop) |
163 : m_runningForDebugBreak(false) | 163 : m_runningForDebugBreak(false) |
164 , m_runningForCreateWindow(false) | 164 , m_runningForCreateWindow(false) |
165 , m_messageLoop(messageLoop) { } | 165 , m_messageLoop(std::move(messageLoop)) { } |
166 | 166 |
167 void run(LocalFrame* frame) override | 167 void run(LocalFrame* frame) override |
168 { | 168 { |
169 if (m_runningForDebugBreak) | 169 if (m_runningForDebugBreak) |
170 return; | 170 return; |
171 | 171 |
172 m_runningForDebugBreak = true; | 172 m_runningForDebugBreak = true; |
173 if (!m_runningForCreateWindow) | 173 if (!m_runningForCreateWindow) |
174 runLoop(WebLocalFrameImpl::fromFrame(frame)); | 174 runLoop(WebLocalFrameImpl::fromFrame(frame)); |
175 } | 175 } |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 return; | 671 return; |
672 | 672 |
673 WebDevToolsAgentImpl* agentImpl = static_cast<WebDevToolsAgentImpl*>(webagen
t); | 673 WebDevToolsAgentImpl* agentImpl = static_cast<WebDevToolsAgentImpl*>(webagen
t); |
674 if (agentImpl->attached()) | 674 if (agentImpl->attached()) |
675 agentImpl->dispatchMessageFromFrontend(sessionId, descriptor->message())
; | 675 agentImpl->dispatchMessageFromFrontend(sessionId, descriptor->message())
; |
676 } | 676 } |
677 | 677 |
678 void WebDevToolsAgent::interruptAndDispatch(int sessionId, MessageDescriptor* ra
wDescriptor) | 678 void WebDevToolsAgent::interruptAndDispatch(int sessionId, MessageDescriptor* ra
wDescriptor) |
679 { | 679 { |
680 // rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a Web
Kit API function. | 680 // rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a Web
Kit API function. |
681 MainThreadDebugger::interruptMainThreadAndRun(threadSafeBind(WebDevToolsAgen
tImpl::runDebuggerTask, sessionId, adoptPtr(rawDescriptor))); | 681 MainThreadDebugger::interruptMainThreadAndRun(threadSafeBind(WebDevToolsAgen
tImpl::runDebuggerTask, sessionId, passed(adoptPtr(rawDescriptor)))); |
682 } | 682 } |
683 | 683 |
684 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) | 684 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) |
685 { | 685 { |
686 String16 commandName; | 686 String16 commandName; |
687 if (!protocol::Dispatcher::getCommandName(message, &commandName)) | 687 if (!protocol::Dispatcher::getCommandName(message, &commandName)) |
688 return false; | 688 return false; |
689 return commandName == "Debugger.pause" | 689 return commandName == "Debugger.pause" |
690 || commandName == "Debugger.setBreakpoint" | 690 || commandName == "Debugger.setBreakpoint" |
691 || commandName == "Debugger.setBreakpointByUrl" | 691 || commandName == "Debugger.setBreakpointByUrl" |
692 || commandName == "Debugger.removeBreakpoint" | 692 || commandName == "Debugger.removeBreakpoint" |
693 || commandName == "Debugger.setBreakpointsActive"; | 693 || commandName == "Debugger.setBreakpointsActive"; |
694 } | 694 } |
695 | 695 |
696 } // namespace blink | 696 } // namespace blink |
OLD | NEW |