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