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

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

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (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
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 flushPendingProtocolNotifications(); 625 flushPendingProtocolNotifications();
626 String stateToSend; 626 String stateToSend;
627 if (!m_stateMuted) { 627 if (!m_stateMuted) {
628 stateToSend = m_agents.state(); 628 stateToSend = m_agents.state();
629 if (stateToSend == m_stateCookie) 629 if (stateToSend == m_stateCookie)
630 stateToSend = String(); 630 stateToSend = String();
631 else 631 else
632 m_stateCookie = stateToSend; 632 m_stateCookie = stateToSend;
633 } 633 }
634 634
635 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st ateToSend); 635 m_client->sendProtocolMessage(sessionId, callId, String(message->toJSONStrin g()), stateToSend);
dgozman 2016/03/08 01:35:12 operator WebString
636 } 636 }
637 637
638 void WebDevToolsAgentImpl::sendProtocolNotification(PassOwnPtr<protocol::Diction aryValue> message) 638 void WebDevToolsAgentImpl::sendProtocolNotification(PassOwnPtr<protocol::Diction aryValue> message)
639 { 639 {
640 if (!m_attached) 640 if (!m_attached)
641 return; 641 return;
642 m_notificationQueue.append(std::make_pair(m_sessionId, message)); 642 m_notificationQueue.append(std::make_pair(m_sessionId, message));
643 } 643 }
644 644
645 void WebDevToolsAgentImpl::flush() 645 void WebDevToolsAgentImpl::flush()
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 return WebString(); 687 return WebString();
688 688
689 return m_overlay->evaluateInOverlayForTest(script); 689 return m_overlay->evaluateInOverlayForTest(script);
690 } 690 }
691 691
692 void WebDevToolsAgentImpl::flushPendingProtocolNotifications() 692 void WebDevToolsAgentImpl::flushPendingProtocolNotifications()
693 { 693 {
694 if (m_attached) { 694 if (m_attached) {
695 m_agents.flushPendingProtocolNotifications(); 695 m_agents.flushPendingProtocolNotifications();
696 for (size_t i = 0; i < m_notificationQueue.size(); ++i) 696 for (size_t i = 0; i < m_notificationQueue.size(); ++i)
697 m_client->sendProtocolMessage(m_notificationQueue[i].first, 0, m_not ificationQueue[i].second->toJSONString(), WebString()); 697 m_client->sendProtocolMessage(m_notificationQueue[i].first, 0, Strin g(m_notificationQueue[i].second->toJSONString()), WebString());
dgozman 2016/03/08 01:35:12 ditto
698 } 698 }
699 m_notificationQueue.clear(); 699 m_notificationQueue.clear();
700 } 700 }
701 701
702 void WebDevToolsAgentImpl::willProcessTask() 702 void WebDevToolsAgentImpl::willProcessTask()
703 { 703 {
704 if (!m_attached) 704 if (!m_attached)
705 return; 705 return;
706 if (InspectorProfilerAgent* profilerAgent = m_instrumentingAgents->inspector ProfilerAgent()) 706 if (InspectorProfilerAgent* profilerAgent = m_instrumentingAgents->inspector ProfilerAgent())
707 profilerAgent->willProcessTask(); 707 profilerAgent->willProcessTask();
(...skipping 20 matching lines...) Expand all
728 } 728 }
729 729
730 void WebDevToolsAgent::interruptAndDispatch(int sessionId, MessageDescriptor* ra wDescriptor) 730 void WebDevToolsAgent::interruptAndDispatch(int sessionId, MessageDescriptor* ra wDescriptor)
731 { 731 {
732 // rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a Web Kit API function. 732 // rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a Web Kit API function.
733 MainThreadDebugger::interruptMainThreadAndRun(threadSafeBind(WebDevToolsAgen tImpl::runDebuggerTask, sessionId, adoptPtr(rawDescriptor))); 733 MainThreadDebugger::interruptMainThreadAndRun(threadSafeBind(WebDevToolsAgen tImpl::runDebuggerTask, sessionId, adoptPtr(rawDescriptor)));
734 } 734 }
735 735
736 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) 736 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message)
737 { 737 {
738 String commandName; 738 String16 commandName;
739 if (!protocol::Dispatcher::getCommandName(message, &commandName)) 739 if (!protocol::Dispatcher::getCommandName(String(message), &commandName))
dgozman 2016/03/08 01:35:12 ditto
740 return false; 740 return false;
741 return commandName == "Debugger.pause" 741 return commandName == "Debugger.pause"
742 || commandName == "Debugger.setBreakpoint" 742 || commandName == "Debugger.setBreakpoint"
743 || commandName == "Debugger.setBreakpointByUrl" 743 || commandName == "Debugger.setBreakpointByUrl"
744 || commandName == "Debugger.removeBreakpoint" 744 || commandName == "Debugger.removeBreakpoint"
745 || commandName == "Debugger.setBreakpointsActive"; 745 || commandName == "Debugger.setBreakpointsActive";
746 } 746 }
747 747
748 } // namespace blink 748 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698