| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2010-2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 namespace WebCore { | 56 namespace WebCore { |
| 57 | 57 |
| 58 namespace DebuggerAgentState { | 58 namespace DebuggerAgentState { |
| 59 static const char debuggerEnabled[] = "debuggerEnabled"; | 59 static const char debuggerEnabled[] = "debuggerEnabled"; |
| 60 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; | 60 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; |
| 61 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; | 61 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 const char* InspectorDebuggerAgent::backtraceObjectGroup = "backtrace"; | 64 const char* InspectorDebuggerAgent::backtraceObjectGroup = "backtrace"; |
| 65 | 65 |
| 66 static String breakpointIdSuffix(InspectorDebuggerAgent::BreakpointSource source
) |
| 67 { |
| 68 switch (source) { |
| 69 case InspectorDebuggerAgent::UserBreakpointSource: |
| 70 break; |
| 71 case InspectorDebuggerAgent::DebugCommandBreakpointSource: |
| 72 return ":debug"; |
| 73 case InspectorDebuggerAgent::MonitorCommandBreakpointSource: |
| 74 return ":monitor"; |
| 75 } |
| 76 return String(); |
| 77 } |
| 78 |
| 66 static String generateBreakpointId(const String& scriptId, int lineNumber, int c
olumnNumber, InspectorDebuggerAgent::BreakpointSource source) | 79 static String generateBreakpointId(const String& scriptId, int lineNumber, int c
olumnNumber, InspectorDebuggerAgent::BreakpointSource source) |
| 67 { | 80 { |
| 68 return scriptId + ':' + String::number(lineNumber) + ':' + String::number(co
lumnNumber) + | 81 return scriptId + ':' + String::number(lineNumber) + ':' + String::number(co
lumnNumber) + breakpointIdSuffix(source); |
| 69 (source == InspectorDebuggerAgent::UserBreakpointSource ? String() : Str
ing(":debug")); | |
| 70 } | 82 } |
| 71 | 83 |
| 72 InspectorDebuggerAgent::InspectorDebuggerAgent(InstrumentingAgents* instrumentin
gAgents, InspectorCompositeState* inspectorState, InjectedScriptManager* injecte
dScriptManager) | 84 InspectorDebuggerAgent::InspectorDebuggerAgent(InstrumentingAgents* instrumentin
gAgents, InspectorCompositeState* inspectorState, InjectedScriptManager* injecte
dScriptManager) |
| 73 : InspectorBaseAgent<InspectorDebuggerAgent>("Debugger", instrumentingAgents
, inspectorState) | 85 : InspectorBaseAgent<InspectorDebuggerAgent>("Debugger", instrumentingAgents
, inspectorState) |
| 74 , m_injectedScriptManager(injectedScriptManager) | 86 , m_injectedScriptManager(injectedScriptManager) |
| 75 , m_frontend(0) | 87 , m_frontend(0) |
| 76 , m_pausedScriptState(0) | 88 , m_pausedScriptState(0) |
| 77 , m_javaScriptPauseScheduled(false) | 89 , m_javaScriptPauseScheduled(false) |
| 78 , m_listener(0) | 90 , m_listener(0) |
| 79 { | 91 { |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 } | 833 } |
| 822 | 834 |
| 823 void ScriptDebugListener::Script::reportMemoryUsage(MemoryObjectInfo* memoryObje
ctInfo) const | 835 void ScriptDebugListener::Script::reportMemoryUsage(MemoryObjectInfo* memoryObje
ctInfo) const |
| 824 { | 836 { |
| 825 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDe
buggerAgent); | 837 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDe
buggerAgent); |
| 826 info.addMember(url, "url"); | 838 info.addMember(url, "url"); |
| 827 info.addMember(source, "source"); | 839 info.addMember(source, "source"); |
| 828 info.addMember(sourceMappingURL, "sourceMappingURL"); | 840 info.addMember(sourceMappingURL, "sourceMappingURL"); |
| 829 } | 841 } |
| 830 | 842 |
| 831 void InspectorDebuggerAgent::setBreakpoint(const String& scriptId, int lineNumbe
r, int columnNumber, BreakpointSource source) | 843 void InspectorDebuggerAgent::setBreakpoint(const String& scriptId, int lineNumbe
r, int columnNumber, BreakpointSource source, const String& condition) |
| 832 { | 844 { |
| 833 String breakpointId = generateBreakpointId(scriptId, lineNumber, columnNumbe
r, source); | 845 String breakpointId = generateBreakpointId(scriptId, lineNumber, columnNumbe
r, source); |
| 834 ScriptBreakpoint breakpoint(lineNumber, columnNumber, String()); | 846 ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition); |
| 835 resolveBreakpoint(breakpointId, scriptId, breakpoint, source); | 847 resolveBreakpoint(breakpointId, scriptId, breakpoint, source); |
| 836 } | 848 } |
| 837 | 849 |
| 838 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu
mber, int columnNumber, BreakpointSource source) | 850 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu
mber, int columnNumber, BreakpointSource source) |
| 839 { | 851 { |
| 840 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so
urce)); | 852 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so
urce)); |
| 841 } | 853 } |
| 842 | 854 |
| 843 void InspectorDebuggerAgent::reset() | 855 void InspectorDebuggerAgent::reset() |
| 844 { | 856 { |
| 845 m_scripts.clear(); | 857 m_scripts.clear(); |
| 846 m_breakpointIdToDebugServerBreakpointIds.clear(); | 858 m_breakpointIdToDebugServerBreakpointIds.clear(); |
| 847 if (m_frontend) | 859 if (m_frontend) |
| 848 m_frontend->globalObjectCleared(); | 860 m_frontend->globalObjectCleared(); |
| 849 } | 861 } |
| 850 | 862 |
| 851 } // namespace WebCore | 863 } // namespace WebCore |
| 852 | 864 |
| OLD | NEW |