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

Side by Side Diff: Source/bindings/core/v8/ScriptDebugServer.h

Issue 1129473003: DevTools: respond with error when Debugger command is sent to disabled debugger agent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptDebugServer.cpp » ('j') | 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, Google Inc. All rights reserved. 2 * Copyright (c) 2010, 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 WTF_MAKE_NONCOPYABLE(ScriptDebugServer); 53 WTF_MAKE_NONCOPYABLE(ScriptDebugServer);
54 public: 54 public:
55 virtual ~ScriptDebugServer(); 55 virtual ~ScriptDebugServer();
56 DECLARE_VIRTUAL_TRACE(); 56 DECLARE_VIRTUAL_TRACE();
57 57
58 void enable(); 58 void enable();
59 void disable(); 59 void disable();
60 bool enabled() const; 60 bool enabled() const;
61 61
62 static void setContextDebugData(v8::Local<v8::Context>, const String& contex tDebugData); 62 static void setContextDebugData(v8::Local<v8::Context>, const String& contex tDebugData);
63 static bool isDebugContext(v8::Local<v8::Context>);
sergeyv 2015/05/05 12:41:10 ?
yurys 2015/05/05 13:13:02 This was a leftover from another patch. Removed.
63 // Each script inherits debug data from v8::Context where it has been compil ed. 64 // Each script inherits debug data from v8::Context where it has been compil ed.
64 // Only scripts whose debug data contains |contextDebugDataSubstring| substr ing will be reported. 65 // Only scripts whose debug data contains |contextDebugDataSubstring| substr ing will be reported.
65 // Passing empty string will result in reporting all scripts. 66 // Passing empty string will result in reporting all scripts.
66 void reportCompiledScripts(const String& contextDebugDataSubstring, ScriptDe bugListener*); 67 void reportCompiledScripts(const String& contextDebugDataSubstring, ScriptDe bugListener*);
67 68
68 String setBreakpoint(const String& sourceID, const ScriptBreakpoint&, int* a ctualLineNumber, int* actualColumnNumber, bool interstatementLocation); 69 String setBreakpoint(const String& sourceID, const ScriptBreakpoint&, int* a ctualLineNumber, int* actualColumnNumber, bool interstatementLocation);
69 void removeBreakpoint(const String& breakpointId); 70 void removeBreakpoint(const String& breakpointId);
70 void setBreakpointsActivated(bool activated); 71 void setBreakpointsActivated(bool activated);
71 72
72 enum PauseOnExceptionsState { 73 enum PauseOnExceptionsState {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 protected: 125 protected:
125 explicit ScriptDebugServer(v8::Isolate*); 126 explicit ScriptDebugServer(v8::Isolate*);
126 127
127 virtual void clearCompiledScripts(); 128 virtual void clearCompiledScripts();
128 129
129 virtual ScriptDebugListener* getDebugListenerForContext(v8::Local<v8::Contex t>) = 0; 130 virtual ScriptDebugListener* getDebugListenerForContext(v8::Local<v8::Contex t>) = 0;
130 virtual void runMessageLoopOnPause(v8::Local<v8::Context>) = 0; 131 virtual void runMessageLoopOnPause(v8::Local<v8::Context>) = 0;
131 virtual void quitMessageLoopOnPause() = 0; 132 virtual void quitMessageLoopOnPause() = 0;
132 133
133 private: 134 private:
134 void ensureDebuggerScriptCompiled(); 135 void compileDebuggerScript();
135 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a rgc, v8::Local<v8::Value> argv[]); 136 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a rgc, v8::Local<v8::Value> argv[]);
136 v8::Local<v8::Object> debuggerScriptLocal() const; 137 v8::Local<v8::Object> debuggerScriptLocal() const;
137 void clearBreakpoints(); 138 void clearBreakpoints();
138 139
139 void dispatchDidParseSource(ScriptDebugListener*, v8::Local<v8::Object> sour ceObject, CompileResult); 140 void dispatchDidParseSource(ScriptDebugListener*, v8::Local<v8::Object> sour ceObject, CompileResult);
140 141
141 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; 142 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ;
142 void handleProgramBreak(ScriptState* pausedScriptState, v8::Local<v8::Object > executionState, v8::Local<v8::Value> exception, v8::Local<v8::Array> hitBreakp oints, bool isPromiseRejection = false); 143 void handleProgramBreak(ScriptState* pausedScriptState, v8::Local<v8::Object > executionState, v8::Local<v8::Value> exception, v8::Local<v8::Array> hitBreakp oints, bool isPromiseRejection = false);
143 static void v8InterruptCallback(v8::Isolate*, void*); 144 static void v8InterruptCallback(v8::Isolate*, void*);
144 static void v8DebugEventCallback(const v8::Debug::EventDetails&); 145 static void v8DebugEventCallback(const v8::Debug::EventDetails&);
(...skipping 21 matching lines...) Expand all
166 RefPtr<ScriptState> m_pausedScriptState; 167 RefPtr<ScriptState> m_pausedScriptState;
167 bool m_runningNestedMessageLoop; 168 bool m_runningNestedMessageLoop;
168 class ThreadSafeTaskQueue; 169 class ThreadSafeTaskQueue;
169 OwnPtr<ThreadSafeTaskQueue> m_taskQueue; 170 OwnPtr<ThreadSafeTaskQueue> m_taskQueue;
170 }; 171 };
171 172
172 } // namespace blink 173 } // namespace blink
173 174
174 175
175 #endif // ScriptDebugServer_h 176 #endif // ScriptDebugServer_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptDebugServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698