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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h

Issue 2104063002: [DevTools] Store script source in v8::Global. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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, 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 22 matching lines...) Expand all
33 33
34 #include "platform/inspector_protocol/Maybe.h" 34 #include "platform/inspector_protocol/Maybe.h"
35 #include "platform/inspector_protocol/Platform.h" 35 #include "platform/inspector_protocol/Platform.h"
36 #include "platform/v8_inspector/JavaScriptCallFrame.h" 36 #include "platform/v8_inspector/JavaScriptCallFrame.h"
37 #include "platform/v8_inspector/V8DebuggerScript.h" 37 #include "platform/v8_inspector/V8DebuggerScript.h"
38 #include "platform/v8_inspector/protocol/Debugger.h" 38 #include "platform/v8_inspector/protocol/Debugger.h"
39 #include "platform/v8_inspector/public/V8Debugger.h" 39 #include "platform/v8_inspector/public/V8Debugger.h"
40 40
41 #include <v8-debug.h> 41 #include <v8-debug.h>
42 #include <v8.h> 42 #include <v8.h>
43 #include <vector>
43 44
44 namespace blink { 45 namespace blink {
45 46
46 using protocol::Maybe; 47 using protocol::Maybe;
47 48
48 struct ScriptBreakpoint; 49 struct ScriptBreakpoint;
49 class InspectedContext; 50 class InspectedContext;
50 class V8DebuggerAgentImpl; 51 class V8DebuggerAgentImpl;
51 class V8InspectorSessionImpl; 52 class V8InspectorSessionImpl;
52 class V8RuntimeAgentImpl; 53 class V8RuntimeAgentImpl;
(...skipping 21 matching lines...) Expand all
74 void setPauseOnExceptionsState(PauseOnExceptionsState); 75 void setPauseOnExceptionsState(PauseOnExceptionsState);
75 void setPauseOnNextStatement(bool); 76 void setPauseOnNextStatement(bool);
76 bool canBreakProgram(); 77 bool canBreakProgram();
77 void breakProgram(); 78 void breakProgram();
78 void continueProgram(); 79 void continueProgram();
79 void stepIntoStatement(); 80 void stepIntoStatement();
80 void stepOverStatement(); 81 void stepOverStatement();
81 void stepOutOfFunction(); 82 void stepOutOfFunction();
82 void clearStepping(); 83 void clearStepping();
83 84
84 bool setScriptSource(const String16& sourceID, const String16& newContent, b ool preview, ErrorString*, Maybe<protocol::Debugger::SetScriptSourceError>*, Jav aScriptCallFrames* newCallFrames, Maybe<bool>* stackChanged); 85 bool setScriptSource(const String16& sourceID, v8::Local<v8::String> newSour ce, bool preview, ErrorString*, Maybe<protocol::Debugger::SetScriptSourceError>* , JavaScriptCallFrames* newCallFrames, Maybe<bool>* stackChanged);
85 JavaScriptCallFrames currentCallFrames(int limit = 0); 86 JavaScriptCallFrames currentCallFrames(int limit = 0);
86 87
87 // Each script inherits debug data from v8::Context where it has been compil ed. 88 // Each script inherits debug data from v8::Context where it has been compil ed.
88 // Only scripts whose debug data matches |contextGroupId| will be reported. 89 // Only scripts whose debug data matches |contextGroupId| will be reported.
89 // Passing 0 will result in reporting all scripts. 90 // Passing 0 will result in reporting all scripts.
90 void getCompiledScripts(int contextGroupId, protocol::Vector<V8DebuggerParse dScript>&); 91 void getCompiledScripts(int contextGroupId, std::vector<std::unique_ptr<V8De buggerScript>>&);
91 void debuggerAgentEnabled(); 92 void debuggerAgentEnabled();
92 void debuggerAgentDisabled(); 93 void debuggerAgentDisabled();
93 94
94 bool isPaused() override; 95 bool isPaused() override;
95 v8::Local<v8::Context> pausedContext() { return m_pausedContext; } 96 v8::Local<v8::Context> pausedContext() { return m_pausedContext; }
96 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; } 97 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; }
97 V8StackTraceImpl* currentAsyncCallChain(); 98 V8StackTraceImpl* currentAsyncCallChain();
98 void setAsyncCallStackDepth(V8DebuggerAgentImpl*, int); 99 void setAsyncCallStackDepth(V8DebuggerAgentImpl*, int);
99 100
100 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Function>); 101 v8::MaybeLocal<v8::Value> functionScopes(v8::Local<v8::Function>);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 void enable(); 138 void enable();
138 void disable(); 139 void disable();
139 V8DebuggerAgentImpl* findEnabledDebuggerAgent(int contextGroupId); 140 V8DebuggerAgentImpl* findEnabledDebuggerAgent(int contextGroupId);
140 V8DebuggerAgentImpl* findEnabledDebuggerAgent(v8::Local<v8::Context>); 141 V8DebuggerAgentImpl* findEnabledDebuggerAgent(v8::Local<v8::Context>);
141 142
142 void compileDebuggerScript(); 143 void compileDebuggerScript();
143 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a rgc, v8::Local<v8::Value> argv[]); 144 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a rgc, v8::Local<v8::Value> argv[]);
144 v8::Local<v8::Context> debuggerContext() const; 145 v8::Local<v8::Context> debuggerContext() const;
145 void clearBreakpoints(); 146 void clearBreakpoints();
146 147
147 V8DebuggerParsedScript createParsedScript(v8::Local<v8::Object> sourceObject , bool success); 148 std::unique_ptr<V8DebuggerScript> createScript(v8::Local<v8::Object> sourceO bject);
148 149
149 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; 150 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ;
150 void handleProgramBreak(v8::Local<v8::Context> pausedContext, v8::Local<v8:: Object> executionState, v8::Local<v8::Value> exception, v8::Local<v8::Array> hit Breakpoints, bool isPromiseRejection = false); 151 void handleProgramBreak(v8::Local<v8::Context> pausedContext, v8::Local<v8:: Object> executionState, v8::Local<v8::Value> exception, v8::Local<v8::Array> hit Breakpoints, bool isPromiseRejection = false);
151 static void v8DebugEventCallback(const v8::Debug::EventDetails&); 152 static void v8DebugEventCallback(const v8::Debug::EventDetails&);
152 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const char* functionName); 153 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const char* functionName);
153 void handleV8DebugEvent(const v8::Debug::EventDetails&); 154 void handleV8DebugEvent(const v8::Debug::EventDetails&);
154 155
155 v8::Local<v8::String> v8InternalizedString(const char*) const; 156 v8::Local<v8::String> v8InternalizedString(const char*) const;
156 157
157 void handleV8AsyncTaskEvent(v8::Local<v8::Context>, v8::Local<v8::Object> ex ecutionState, v8::Local<v8::Object> eventData); 158 void handleV8AsyncTaskEvent(v8::Local<v8::Context>, v8::Local<v8::Object> ex ecutionState, v8::Local<v8::Object> eventData);
(...skipping 19 matching lines...) Expand all
177 int m_maxAsyncCallStackDepth; 178 int m_maxAsyncCallStackDepth;
178 protocol::Vector<void*> m_currentTasks; 179 protocol::Vector<void*> m_currentTasks;
179 protocol::Vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks; 180 protocol::Vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks;
180 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; 181 protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap;
181 }; 182 };
182 183
183 } // namespace blink 184 } // namespace blink
184 185
185 186
186 #endif // V8DebuggerImpl_h 187 #endif // V8DebuggerImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698