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

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

Issue 2194683003: [DevTools] Cleanup v8_inspector console API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Source/web/WebDevToolsAgentImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents()) 305 , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents())
306 , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalF rameImpl->frame())) 306 , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalF rameImpl->frame()))
307 , m_overlay(overlay) 307 , m_overlay(overlay)
308 , m_inspectedFrames(InspectedFrames::create(m_webLocalFrameImpl->frame())) 308 , m_inspectedFrames(InspectedFrames::create(m_webLocalFrameImpl->frame()))
309 , m_resourceContainer(new InspectorResourceContainer(m_inspectedFrames)) 309 , m_resourceContainer(new InspectorResourceContainer(m_inspectedFrames))
310 , m_domAgent(nullptr) 310 , m_domAgent(nullptr)
311 , m_pageAgent(nullptr) 311 , m_pageAgent(nullptr)
312 , m_networkAgent(nullptr) 312 , m_networkAgent(nullptr)
313 , m_layerTreeAgent(nullptr) 313 , m_layerTreeAgent(nullptr)
314 , m_tracingAgent(nullptr) 314 , m_tracingAgent(nullptr)
315 , m_logAgent(nullptr)
316 , m_includeViewAgents(includeViewAgents) 315 , m_includeViewAgents(includeViewAgents)
317 , m_layerTreeId(0) 316 , m_layerTreeId(0)
318 { 317 {
319 DCHECK(isMainThread()); 318 DCHECK(isMainThread());
320 DCHECK(m_webLocalFrameImpl->frame()); 319 DCHECK(m_webLocalFrameImpl->frame());
321 } 320 }
322 321
323 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() 322 WebDevToolsAgentImpl::~WebDevToolsAgentImpl()
324 { 323 {
325 DCHECK(!m_client); 324 DCHECK(!m_client);
(...skipping 17 matching lines...) Expand all
343 visitor->trace(m_instrumentingAgents); 342 visitor->trace(m_instrumentingAgents);
344 visitor->trace(m_resourceContentLoader); 343 visitor->trace(m_resourceContentLoader);
345 visitor->trace(m_overlay); 344 visitor->trace(m_overlay);
346 visitor->trace(m_inspectedFrames); 345 visitor->trace(m_inspectedFrames);
347 visitor->trace(m_resourceContainer); 346 visitor->trace(m_resourceContainer);
348 visitor->trace(m_domAgent); 347 visitor->trace(m_domAgent);
349 visitor->trace(m_pageAgent); 348 visitor->trace(m_pageAgent);
350 visitor->trace(m_networkAgent); 349 visitor->trace(m_networkAgent);
351 visitor->trace(m_layerTreeAgent); 350 visitor->trace(m_layerTreeAgent);
352 visitor->trace(m_tracingAgent); 351 visitor->trace(m_tracingAgent);
353 visitor->trace(m_logAgent);
354 visitor->trace(m_session); 352 visitor->trace(m_session);
355 } 353 }
356 354
357 void WebDevToolsAgentImpl::willBeDestroyed() 355 void WebDevToolsAgentImpl::willBeDestroyed()
358 { 356 {
359 DCHECK(m_webLocalFrameImpl->frame()); 357 DCHECK(m_webLocalFrameImpl->frame());
360 DCHECK(m_inspectedFrames->root()->view()); 358 DCHECK(m_inspectedFrames->root()->view());
361 detach(); 359 detach();
362 m_resourceContentLoader->dispose(); 360 m_resourceContentLoader->dispose();
363 m_client = nullptr; 361 m_client = nullptr;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 m_session->append(tracingAgent); 401 m_session->append(tracingAgent);
404 402
405 m_session->append(new InspectorDOMDebuggerAgent(isolate, m_domAgent, m_sessi on->v8Session())); 403 m_session->append(new InspectorDOMDebuggerAgent(isolate, m_domAgent, m_sessi on->v8Session()));
406 404
407 m_session->append(InspectorInputAgent::create(m_inspectedFrames.get())); 405 m_session->append(InspectorInputAgent::create(m_inspectedFrames.get()));
408 406
409 InspectorPageAgent* pageAgent = InspectorPageAgent::create(m_inspectedFrames .get(), this, m_resourceContentLoader.get(), m_session->v8Session()); 407 InspectorPageAgent* pageAgent = InspectorPageAgent::create(m_inspectedFrames .get(), this, m_resourceContentLoader.get(), m_session->v8Session());
410 m_pageAgent = pageAgent; 408 m_pageAgent = pageAgent;
411 m_session->append(pageAgent); 409 m_session->append(pageAgent);
412 410
413 m_logAgent = new InspectorLogAgent(&m_inspectedFrames->root()->host()->conso leMessageStorage()); 411 m_session->append(new InspectorLogAgent(&m_inspectedFrames->root()->host()-> consoleMessageStorage()));
414 m_session->append(m_logAgent.get());
415 412
416 m_tracingAgent->setLayerTreeId(m_layerTreeId); 413 m_tracingAgent->setLayerTreeId(m_layerTreeId);
417 m_networkAgent->setHostId(hostId); 414 m_networkAgent->setHostId(hostId);
418 415
419 if (m_includeViewAgents) { 416 if (m_includeViewAgents) {
420 // TODO(dgozman): we should actually pass the view instead of frame, but during 417 // TODO(dgozman): we should actually pass the view instead of frame, but during
421 // remote->local transition we cannot access mainFrameImpl() yet, so we have to store the 418 // remote->local transition we cannot access mainFrameImpl() yet, so we have to store the
422 // frame which will become the main frame later. 419 // frame which will become the main frame later.
423 m_session->append(InspectorRenderingAgent::create(m_webLocalFrameImpl, m _overlay.get())); 420 m_session->append(InspectorRenderingAgent::create(m_webLocalFrameImpl, m _overlay.get()));
424 m_session->append(InspectorEmulationAgent::create(m_webLocalFrameImpl, t his)); 421 m_session->append(InspectorEmulationAgent::create(m_webLocalFrameImpl, t his));
(...skipping 15 matching lines...) Expand all
440 void WebDevToolsAgentImpl::destroySession() 437 void WebDevToolsAgentImpl::destroySession()
441 { 438 {
442 if (m_overlay) 439 if (m_overlay)
443 m_overlay->clear(); 440 m_overlay->clear();
444 441
445 m_tracingAgent.clear(); 442 m_tracingAgent.clear();
446 m_layerTreeAgent.clear(); 443 m_layerTreeAgent.clear();
447 m_networkAgent.clear(); 444 m_networkAgent.clear();
448 m_pageAgent.clear(); 445 m_pageAgent.clear();
449 m_domAgent.clear(); 446 m_domAgent.clear();
450 m_logAgent.clear();
451 447
452 m_session->dispose(); 448 m_session->dispose();
453 m_session.clear(); 449 m_session.clear();
454 450
455 Platform::current()->currentThread()->removeTaskObserver(this); 451 Platform::current()->currentThread()->removeTaskObserver(this);
456 } 452 }
457 453
458 void WebDevToolsAgentImpl::attach(const WebString& hostId, int sessionId) 454 void WebDevToolsAgentImpl::attach(const WebString& hostId, int sessionId)
459 { 455 {
460 if (attached()) 456 if (attached())
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 if (m_overlay) 599 if (m_overlay)
604 m_overlay->suspend(); 600 m_overlay->suspend();
605 } 601 }
606 602
607 void WebDevToolsAgentImpl::profilingStopped() 603 void WebDevToolsAgentImpl::profilingStopped()
608 { 604 {
609 if (m_overlay) 605 if (m_overlay)
610 m_overlay->resume(); 606 m_overlay->resume();
611 } 607 }
612 608
613 void WebDevToolsAgentImpl::consoleCleared()
614 {
615 if (m_domAgent)
616 m_domAgent->releaseDanglingNodes();
617 if (m_logAgent)
618 m_logAgent->clear(nullptr);
619 }
620
621 void WebDevToolsAgentImpl::pageLayoutInvalidated(bool resized) 609 void WebDevToolsAgentImpl::pageLayoutInvalidated(bool resized)
622 { 610 {
623 if (m_overlay) 611 if (m_overlay)
624 m_overlay->pageLayoutInvalidated(resized); 612 m_overlay->pageLayoutInvalidated(resized);
625 } 613 }
626 614
627 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String& message) 615 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String& message)
628 { 616 {
629 if (m_overlay) 617 if (m_overlay)
630 m_overlay->setPausedInDebuggerMessage(message); 618 m_overlay->setPausedInDebuggerMessage(message);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 bool WebDevToolsAgent::shouldInterruptForMethod(const WebString& method) 675 bool WebDevToolsAgent::shouldInterruptForMethod(const WebString& method)
688 { 676 {
689 return method == "Debugger.pause" 677 return method == "Debugger.pause"
690 || method == "Debugger.setBreakpoint" 678 || method == "Debugger.setBreakpoint"
691 || method == "Debugger.setBreakpointByUrl" 679 || method == "Debugger.setBreakpointByUrl"
692 || method == "Debugger.removeBreakpoint" 680 || method == "Debugger.removeBreakpoint"
693 || method == "Debugger.setBreakpointsActive"; 681 || method == "Debugger.setBreakpointsActive";
694 } 682 }
695 683
696 } // namespace blink 684 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebDevToolsAgentImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698