| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 return adoptPtrWillBeNoop(agent); | 294 return adoptPtrWillBeNoop(agent); |
| 295 } | 295 } |
| 296 | 296 |
| 297 WebDevToolsAgentImpl::WebDevToolsAgentImpl( | 297 WebDevToolsAgentImpl::WebDevToolsAgentImpl( |
| 298 WebLocalFrameImpl* webLocalFrameImpl, | 298 WebLocalFrameImpl* webLocalFrameImpl, |
| 299 WebDevToolsAgentClient* client, | 299 WebDevToolsAgentClient* client, |
| 300 RawPtr<InspectorOverlay> overlay) | 300 RawPtr<InspectorOverlay> overlay) |
| 301 : m_client(client) | 301 : m_client(client) |
| 302 , m_webLocalFrameImpl(webLocalFrameImpl) | 302 , m_webLocalFrameImpl(webLocalFrameImpl) |
| 303 , m_attached(false) | 303 , m_attached(false) |
| 304 #if ENABLE(ASSERT) | 304 #if DCHECK_IS_ON() |
| 305 , m_hasBeenDisposed(false) | 305 , m_hasBeenDisposed(false) |
| 306 #endif | 306 #endif |
| 307 , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents()) | 307 , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents()) |
| 308 , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalF
rameImpl->frame())) | 308 , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalF
rameImpl->frame())) |
| 309 , m_overlay(overlay) | 309 , m_overlay(overlay) |
| 310 , m_inspectedFrames(InspectedFrames::create(m_webLocalFrameImpl->frame())) | 310 , m_inspectedFrames(InspectedFrames::create(m_webLocalFrameImpl->frame())) |
| 311 , m_domAgent(nullptr) | 311 , m_domAgent(nullptr) |
| 312 , m_pageAgent(nullptr) | 312 , m_pageAgent(nullptr) |
| 313 , m_resourceAgent(nullptr) | 313 , m_resourceAgent(nullptr) |
| 314 , m_layerTreeAgent(nullptr) | 314 , m_layerTreeAgent(nullptr) |
| 315 , m_tracingAgent(nullptr) | 315 , m_tracingAgent(nullptr) |
| 316 , m_agents(m_instrumentingAgents.get()) | 316 , m_agents(m_instrumentingAgents.get()) |
| 317 , m_deferredAgentsInitialized(false) | 317 , m_deferredAgentsInitialized(false) |
| 318 , m_sessionId(0) | 318 , m_sessionId(0) |
| 319 , m_stateMuted(false) | 319 , m_stateMuted(false) |
| 320 , m_layerTreeId(0) | 320 , m_layerTreeId(0) |
| 321 { | 321 { |
| 322 ASSERT(isMainThread()); | 322 DCHECK(isMainThread()); |
| 323 ASSERT(m_webLocalFrameImpl->frame()); | 323 DCHECK(m_webLocalFrameImpl->frame()); |
| 324 } | 324 } |
| 325 | 325 |
| 326 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() | 326 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() |
| 327 { | 327 { |
| 328 ASSERT(m_hasBeenDisposed); | 328 #if DCHECK_IS_ON() |
| 329 DCHECK(m_hasBeenDisposed); |
| 330 #endif |
| 329 } | 331 } |
| 330 | 332 |
| 331 void WebDevToolsAgentImpl::dispose() | 333 void WebDevToolsAgentImpl::dispose() |
| 332 { | 334 { |
| 333 // Explicitly dispose of the agent before destructing to ensure | 335 // Explicitly dispose of the agent before destructing to ensure |
| 334 // same behavior (and correctness) with and without Oilpan. | 336 // same behavior (and correctness) with and without Oilpan. |
| 335 if (m_attached) | 337 if (m_attached) |
| 336 Platform::current()->currentThread()->removeTaskObserver(this); | 338 Platform::current()->currentThread()->removeTaskObserver(this); |
| 337 #if ENABLE(ASSERT) | 339 #if DCHECK_IS_ON() |
| 338 ASSERT(!m_hasBeenDisposed); | 340 DCHECK(!m_hasBeenDisposed); |
| 339 m_hasBeenDisposed = true; | 341 m_hasBeenDisposed = true; |
| 340 #endif | 342 #endif |
| 341 } | 343 } |
| 342 | 344 |
| 343 // static | 345 // static |
| 344 void WebDevToolsAgentImpl::webViewImplClosed(WebViewImpl* webViewImpl) | 346 void WebDevToolsAgentImpl::webViewImplClosed(WebViewImpl* webViewImpl) |
| 345 { | 347 { |
| 346 ClientMessageLoopAdapter::webViewImplClosed(webViewImpl); | 348 ClientMessageLoopAdapter::webViewImplClosed(webViewImpl); |
| 347 } | 349 } |
| 348 | 350 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 362 visitor->trace(m_domAgent); | 364 visitor->trace(m_domAgent); |
| 363 visitor->trace(m_pageAgent); | 365 visitor->trace(m_pageAgent); |
| 364 visitor->trace(m_resourceAgent); | 366 visitor->trace(m_resourceAgent); |
| 365 visitor->trace(m_layerTreeAgent); | 367 visitor->trace(m_layerTreeAgent); |
| 366 visitor->trace(m_tracingAgent); | 368 visitor->trace(m_tracingAgent); |
| 367 visitor->trace(m_agents); | 369 visitor->trace(m_agents); |
| 368 } | 370 } |
| 369 | 371 |
| 370 void WebDevToolsAgentImpl::willBeDestroyed() | 372 void WebDevToolsAgentImpl::willBeDestroyed() |
| 371 { | 373 { |
| 372 ASSERT(m_webLocalFrameImpl->frame()); | 374 DCHECK(m_webLocalFrameImpl->frame()); |
| 373 ASSERT(m_inspectedFrames->root()->view()); | 375 DCHECK(m_inspectedFrames->root()->view()); |
| 374 | 376 |
| 375 detach(); | 377 detach(); |
| 376 m_resourceContentLoader->dispose(); | 378 m_resourceContentLoader->dispose(); |
| 377 m_agents.discardAgents(); | 379 m_agents.discardAgents(); |
| 378 m_instrumentingAgents->reset(); | 380 m_instrumentingAgents->reset(); |
| 379 } | 381 } |
| 380 | 382 |
| 381 void WebDevToolsAgentImpl::initializeDeferredAgents() | 383 void WebDevToolsAgentImpl::initializeDeferredAgents() |
| 382 { | 384 { |
| 383 if (m_deferredAgentsInitialized) | 385 if (m_deferredAgentsInitialized) |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 if (!protocol::Dispatcher::getCommandName(message, &commandName)) | 725 if (!protocol::Dispatcher::getCommandName(message, &commandName)) |
| 724 return false; | 726 return false; |
| 725 return commandName == "Debugger.pause" | 727 return commandName == "Debugger.pause" |
| 726 || commandName == "Debugger.setBreakpoint" | 728 || commandName == "Debugger.setBreakpoint" |
| 727 || commandName == "Debugger.setBreakpointByUrl" | 729 || commandName == "Debugger.setBreakpointByUrl" |
| 728 || commandName == "Debugger.removeBreakpoint" | 730 || commandName == "Debugger.removeBreakpoint" |
| 729 || commandName == "Debugger.setBreakpointsActive"; | 731 || commandName == "Debugger.setBreakpointsActive"; |
| 730 } | 732 } |
| 731 | 733 |
| 732 } // namespace blink | 734 } // namespace blink |
| OLD | NEW |