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

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

Issue 1738073002: DevTools: introduce protocol::Value, baseline for hierarchical data in remote debugging protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "core/inspector/PageRuntimeAgent.h" 64 #include "core/inspector/PageRuntimeAgent.h"
65 #include "core/layout/LayoutView.h" 65 #include "core/layout/LayoutView.h"
66 #include "core/page/FocusController.h" 66 #include "core/page/FocusController.h"
67 #include "core/page/Page.h" 67 #include "core/page/Page.h"
68 #include "modules/accessibility/InspectorAccessibilityAgent.h" 68 #include "modules/accessibility/InspectorAccessibilityAgent.h"
69 #include "modules/cachestorage/InspectorCacheStorageAgent.h" 69 #include "modules/cachestorage/InspectorCacheStorageAgent.h"
70 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" 70 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h"
71 #include "modules/indexeddb/InspectorIndexedDBAgent.h" 71 #include "modules/indexeddb/InspectorIndexedDBAgent.h"
72 #include "modules/storage/InspectorDOMStorageAgent.h" 72 #include "modules/storage/InspectorDOMStorageAgent.h"
73 #include "modules/webdatabase/InspectorDatabaseAgent.h" 73 #include "modules/webdatabase/InspectorDatabaseAgent.h"
74 #include "platform/JSONValues.h"
75 #include "platform/RuntimeEnabledFeatures.h" 74 #include "platform/RuntimeEnabledFeatures.h"
76 #include "platform/TraceEvent.h" 75 #include "platform/TraceEvent.h"
77 #include "platform/graphics/GraphicsContext.h" 76 #include "platform/graphics/GraphicsContext.h"
78 #include "platform/graphics/paint/PaintController.h" 77 #include "platform/graphics/paint/PaintController.h"
79 #include "platform/inspector_protocol/Dispatcher.h" 78 #include "platform/inspector_protocol/Dispatcher.h"
80 #include "platform/inspector_protocol/Frontend.h" 79 #include "platform/inspector_protocol/Frontend.h"
80 #include "platform/inspector_protocol/Values.h"
81 #include "public/platform/Platform.h" 81 #include "public/platform/Platform.h"
82 #include "public/platform/WebLayerTreeView.h" 82 #include "public/platform/WebLayerTreeView.h"
83 #include "public/platform/WebRect.h" 83 #include "public/platform/WebRect.h"
84 #include "public/platform/WebString.h" 84 #include "public/platform/WebString.h"
85 #include "public/web/WebDevToolsAgentClient.h" 85 #include "public/web/WebDevToolsAgentClient.h"
86 #include "public/web/WebSettings.h" 86 #include "public/web/WebSettings.h"
87 #include "web/DevToolsEmulator.h" 87 #include "web/DevToolsEmulator.h"
88 #include "web/InspectorEmulationAgent.h" 88 #include "web/InspectorEmulationAgent.h"
89 #include "web/InspectorOverlay.h" 89 #include "web/InspectorOverlay.h"
90 #include "web/InspectorRenderingAgent.h" 90 #include "web/InspectorRenderingAgent.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 m_agents.append(InspectorProfilerAgent::create(MainThreadDebugger::instance( )->debugger(), m_overlay.get())); 478 m_agents.append(InspectorProfilerAgent::create(MainThreadDebugger::instance( )->debugger(), m_overlay.get()));
479 m_agents.append(InspectorHeapProfilerAgent::create(isolate, m_pageRuntimeAge nt->v8Agent())); 479 m_agents.append(InspectorHeapProfilerAgent::create(isolate, m_pageRuntimeAge nt->v8Agent()));
480 480
481 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent)) ; 481 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent)) ;
482 m_pageAgent = pageAgentPtr.get(); 482 m_pageAgent = pageAgentPtr.get();
483 m_agents.append(pageAgentPtr.release()); 483 m_agents.append(pageAgentPtr.release());
484 484
485 m_pageConsoleAgent->setDebuggerAgent(debuggerAgent->v8Agent()); 485 m_pageConsoleAgent->setDebuggerAgent(debuggerAgent->v8Agent());
486 486
487 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons oleAgent::clearAllMessages, m_pageConsoleAgent.get())); 487 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons oleAgent::clearAllMessages, m_pageConsoleAgent.get()));
488 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassOwnPtr<prot ocol::Runtime::RemoteObject>, PassRefPtr<JSONObject>>(&InspectorInspectorAgent:: inspect, m_inspectorAgent.get())); 488 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassOwnPtr<prot ocol::Runtime::RemoteObject>, PassRefPtr<protocol::DictionaryValue>>(&InspectorI nspectorAgent::inspect, m_inspectorAgent.get()));
489 489
490 if (m_overlay) 490 if (m_overlay)
491 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get()); 491 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get());
492 } 492 }
493 493
494 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent> agent) 494 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent> agent)
495 { 495 {
496 m_agents.append(agent); 496 m_agents.append(agent);
497 } 497 }
498 498
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 if (!node && m_webLocalFrameImpl->frame()->document()) 635 if (!node && m_webLocalFrameImpl->frame()->document())
636 node = m_webLocalFrameImpl->frame()->document()->documentElement(); 636 node = m_webLocalFrameImpl->frame()->document()->documentElement();
637 m_domAgent->inspect(node); 637 m_domAgent->inspect(node);
638 } 638 }
639 639
640 void WebDevToolsAgentImpl::failedToRequestDevTools() 640 void WebDevToolsAgentImpl::failedToRequestDevTools()
641 { 641 {
642 ClientMessageLoopAdapter::resumeForCreateWindow(); 642 ClientMessageLoopAdapter::resumeForCreateWindow();
643 } 643 }
644 644
645 void WebDevToolsAgentImpl::sendProtocolResponse(int sessionId, int callId, PassR efPtr<JSONObject> message) 645 void WebDevToolsAgentImpl::sendProtocolResponse(int sessionId, int callId, PassR efPtr<protocol::DictionaryValue> message)
646 { 646 {
647 if (!m_attached) 647 if (!m_attached)
648 return; 648 return;
649 flushPendingProtocolNotifications(); 649 flushPendingProtocolNotifications();
650 String stateToSend; 650 String stateToSend;
651 if (!m_stateMuted) { 651 if (!m_stateMuted) {
652 stateToSend = m_agents.state(); 652 stateToSend = m_agents.state();
653 if (stateToSend == m_stateCookie) 653 if (stateToSend == m_stateCookie)
654 stateToSend = String(); 654 stateToSend = String();
655 else 655 else
656 m_stateCookie = stateToSend; 656 m_stateCookie = stateToSend;
657 } 657 }
658 658
659 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st ateToSend); 659 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st ateToSend);
660 } 660 }
661 661
662 void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<JSONObject> messa ge) 662 void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<protocol::Diction aryValue> message)
663 { 663 {
664 if (!m_attached) 664 if (!m_attached)
665 return; 665 return;
666 m_notificationQueue.append(std::make_pair(m_sessionId, message)); 666 m_notificationQueue.append(std::make_pair(m_sessionId, message));
667 } 667 }
668 668
669 void WebDevToolsAgentImpl::flush() 669 void WebDevToolsAgentImpl::flush()
670 { 670 {
671 flushPendingProtocolNotifications(); 671 flushPendingProtocolNotifications();
672 } 672 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 if (!protocol::Dispatcher::getCommandName(message, &commandName)) 754 if (!protocol::Dispatcher::getCommandName(message, &commandName))
755 return false; 755 return false;
756 return commandName == "Debugger.pause" 756 return commandName == "Debugger.pause"
757 || commandName == "Debugger.setBreakpoint" 757 || commandName == "Debugger.setBreakpoint"
758 || commandName == "Debugger.setBreakpointByUrl" 758 || commandName == "Debugger.setBreakpointByUrl"
759 || commandName == "Debugger.removeBreakpoint" 759 || commandName == "Debugger.removeBreakpoint"
760 || commandName == "Debugger.setBreakpointsActive"; 760 || commandName == "Debugger.setBreakpointsActive";
761 } 761 }
762 762
763 } // namespace blink 763 } // 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