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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); | 233 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); |
234 if (m_attached) | 234 if (m_attached) |
235 Platform::current()->currentThread()->removeTaskObserver(this); | 235 Platform::current()->currentThread()->removeTaskObserver(this); |
236 } | 236 } |
237 | 237 |
238 void WebDevToolsAgentImpl::attach(const WebString& hostId) | 238 void WebDevToolsAgentImpl::attach(const WebString& hostId) |
239 { | 239 { |
240 if (m_attached) | 240 if (m_attached) |
241 return; | 241 return; |
242 | 242 |
| 243 // Set the attached bit first so that sync notifications were delivered. |
| 244 m_attached = true; |
243 inspectorController()->connectFrontend(hostId, this); | 245 inspectorController()->connectFrontend(hostId, this); |
244 Platform::current()->currentThread()->addTaskObserver(this); | 246 Platform::current()->currentThread()->addTaskObserver(this); |
245 m_attached = true; | |
246 } | 247 } |
247 | 248 |
248 void WebDevToolsAgentImpl::reattach(const WebString& hostId, const WebString& sa
vedState) | 249 void WebDevToolsAgentImpl::reattach(const WebString& hostId, const WebString& sa
vedState) |
249 { | 250 { |
250 if (m_attached) | 251 if (m_attached) |
251 return; | 252 return; |
252 | 253 |
| 254 // Set the attached bit first so that sync notifications were delivered. |
| 255 m_attached = true; |
253 inspectorController()->reuseFrontend(hostId, this, savedState); | 256 inspectorController()->reuseFrontend(hostId, this, savedState); |
254 Platform::current()->currentThread()->addTaskObserver(this); | 257 Platform::current()->currentThread()->addTaskObserver(this); |
255 m_attached = true; | |
256 } | 258 } |
257 | 259 |
258 void WebDevToolsAgentImpl::detach() | 260 void WebDevToolsAgentImpl::detach() |
259 { | 261 { |
260 Platform::current()->currentThread()->removeTaskObserver(this); | 262 Platform::current()->currentThread()->removeTaskObserver(this); |
261 | 263 |
262 // Prevent controller from sending messages to the frontend. | 264 // Prevent controller from sending messages to the frontend. |
263 InspectorController* ic = inspectorController(); | 265 InspectorController* ic = inspectorController(); |
264 ic->disconnectFrontend(); | 266 ic->disconnectFrontend(); |
265 m_attached = false; | 267 m_attached = false; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) | 581 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) |
580 return false; | 582 return false; |
581 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) | 583 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) |
582 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) | 584 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) |
583 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) | 585 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) |
584 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 586 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
585 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 587 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
586 } | 588 } |
587 | 589 |
588 } // namespace blink | 590 } // namespace blink |
OLD | NEW |