Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Side by Side Diff: Source/web/WebDevToolsAgentImpl.cpp

Issue 18729002: Enable message delivering in inspector-protocol tests when on pause (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: follow codereview Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 356
357 WebDevToolsAgentImpl::WebDevToolsAgentImpl( 357 WebDevToolsAgentImpl::WebDevToolsAgentImpl(
358 WebViewImpl* webViewImpl, 358 WebViewImpl* webViewImpl,
359 WebDevToolsAgentClient* client) 359 WebDevToolsAgentClient* client)
360 : m_hostId(client->hostIdentifier()) 360 : m_hostId(client->hostIdentifier())
361 , m_client(client) 361 , m_client(client)
362 , m_webViewImpl(webViewImpl) 362 , m_webViewImpl(webViewImpl)
363 , m_attached(false) 363 , m_attached(false)
364 { 364 {
365 ASSERT(m_hostId > 0); 365 ASSERT(m_hostId > 0);
366 ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client);
366 } 367 }
367 368
368 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() 369 WebDevToolsAgentImpl::~WebDevToolsAgentImpl()
369 { 370 {
370 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); 371 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl);
371 if (m_attached) 372 if (m_attached)
372 WebKit::Platform::current()->currentThread()->removeTaskObserver(this); 373 WebKit::Platform::current()->currentThread()->removeTaskObserver(this);
373 } 374 }
374 375
375 void WebDevToolsAgentImpl::attach() 376 void WebDevToolsAgentImpl::attach()
376 { 377 {
377 if (m_attached) 378 if (m_attached)
378 return; 379 return;
379 380
380 ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client);
381 inspectorController()->connectFrontend(this); 381 inspectorController()->connectFrontend(this);
382 inspectorController()->webViewResized(m_webViewImpl->size()); 382 inspectorController()->webViewResized(m_webViewImpl->size());
383 WebKit::Platform::current()->currentThread()->addTaskObserver(this); 383 WebKit::Platform::current()->currentThread()->addTaskObserver(this);
384 m_attached = true; 384 m_attached = true;
385 } 385 }
386 386
387 void WebDevToolsAgentImpl::reattach(const WebString& savedState) 387 void WebDevToolsAgentImpl::reattach(const WebString& savedState)
388 { 388 {
389 if (m_attached) 389 if (m_attached)
390 return; 390 return;
391 391
392 ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client);
393 inspectorController()->reuseFrontend(this, savedState); 392 inspectorController()->reuseFrontend(this, savedState);
394 WebKit::Platform::current()->currentThread()->addTaskObserver(this); 393 WebKit::Platform::current()->currentThread()->addTaskObserver(this);
395 m_attached = true; 394 m_attached = true;
396 } 395 }
397 396
398 void WebDevToolsAgentImpl::detach() 397 void WebDevToolsAgentImpl::detach()
399 { 398 {
400 WebKit::Platform::current()->currentThread()->removeTaskObserver(this); 399 WebKit::Platform::current()->currentThread()->removeTaskObserver(this);
401 400
402 // Prevent controller from sending messages to the frontend. 401 // Prevent controller from sending messages to the frontend.
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kProfiler_getCPUProfileCmd] 755 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kProfiler_getCPUProfileCmd]
757 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kHeapProfiler_getHeapSnapshotCmd]; 756 || commandName == InspectorBackendDispatcher::commandNames[InspectorBack endDispatcher::kHeapProfiler_getHeapSnapshotCmd];
758 } 757 }
759 758
760 void WebDevToolsAgent::processPendingMessages() 759 void WebDevToolsAgent::processPendingMessages()
761 { 760 {
762 PageScriptDebugServer::shared().runPendingTasks(); 761 PageScriptDebugServer::shared().runPendingTasks();
763 } 762 }
764 763
765 } // namespace WebKit 764 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698