OLD | NEW |
---|---|
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 30 matching lines...) Expand all Loading... | |
41 #include <v8.h> | 41 #include <v8.h> |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 using protocol::Maybe; | 45 using protocol::Maybe; |
46 | 46 |
47 struct ScriptBreakpoint; | 47 struct ScriptBreakpoint; |
48 class InspectedContext; | 48 class InspectedContext; |
49 class V8DebuggerAgentImpl; | 49 class V8DebuggerAgentImpl; |
50 class V8InspectorSessionImpl; | 50 class V8InspectorSessionImpl; |
51 class V8ProfilerAgentImpl; | |
51 class V8RuntimeAgentImpl; | 52 class V8RuntimeAgentImpl; |
52 | 53 |
53 class V8DebuggerImpl : public V8Debugger { | 54 class V8DebuggerImpl : public V8Debugger { |
54 PROTOCOL_DISALLOW_COPY(V8DebuggerImpl); | 55 PROTOCOL_DISALLOW_COPY(V8DebuggerImpl); |
55 public: | 56 public: |
56 V8DebuggerImpl(v8::Isolate*, V8DebuggerClient*); | 57 V8DebuggerImpl(v8::Isolate*, V8DebuggerClient*); |
57 ~V8DebuggerImpl() override; | 58 ~V8DebuggerImpl() override; |
58 | 59 |
59 bool enabled() const; | 60 bool enabled() const; |
60 | 61 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 void contextDestroyed(v8::Local<v8::Context>) override; | 113 void contextDestroyed(v8::Local<v8::Context>) override; |
113 void resetContextGroup(int contextGroupId) override; | 114 void resetContextGroup(int contextGroupId) override; |
114 PassOwnPtr<V8StackTrace> createStackTrace(v8::Local<v8::StackTrace>, size_t maxStackSize) override; | 115 PassOwnPtr<V8StackTrace> createStackTrace(v8::Local<v8::StackTrace>, size_t maxStackSize) override; |
115 PassOwnPtr<V8StackTrace> captureStackTrace(size_t maxStackSize) override; | 116 PassOwnPtr<V8StackTrace> captureStackTrace(size_t maxStackSize) override; |
116 | 117 |
117 using ContextByIdMap = protocol::HashMap<int, OwnPtr<InspectedContext>>; | 118 using ContextByIdMap = protocol::HashMap<int, OwnPtr<InspectedContext>>; |
118 void discardInspectedContext(int contextGroupId, int contextId); | 119 void discardInspectedContext(int contextGroupId, int contextId); |
119 const ContextByIdMap* contextGroup(int contextGroupId); | 120 const ContextByIdMap* contextGroup(int contextGroupId); |
120 void disconnect(V8InspectorSessionImpl*); | 121 void disconnect(V8InspectorSessionImpl*); |
121 | 122 |
123 V8ProfilerAgentImpl* findEnabledProfilerAgent(v8::Local<v8::Context>); | |
dgozman
2016/04/12 03:32:16
Let's move this method to call site.
kozy
2016/04/12 21:58:32
Done.
| |
122 private: | 124 private: |
123 void enable(); | 125 void enable(); |
124 void disable(); | 126 void disable(); |
125 V8DebuggerAgentImpl* findEnabledDebuggerAgent(int contextGroupId); | 127 V8DebuggerAgentImpl* findEnabledDebuggerAgent(int contextGroupId); |
126 V8DebuggerAgentImpl* findEnabledDebuggerAgent(v8::Local<v8::Context>); | 128 V8DebuggerAgentImpl* findEnabledDebuggerAgent(v8::Local<v8::Context>); |
127 | 129 |
128 void compileDebuggerScript(); | 130 void compileDebuggerScript(); |
129 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a rgc, v8::Local<v8::Value> argv[]); | 131 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a rgc, v8::Local<v8::Value> argv[]); |
130 v8::Local<v8::Context> debuggerContext() const; | 132 v8::Local<v8::Context> debuggerContext() const; |
131 void clearBreakpoints(); | 133 void clearBreakpoints(); |
132 | 134 |
133 V8DebuggerParsedScript createParsedScript(v8::Local<v8::Object> sourceObject , bool success); | 135 V8DebuggerParsedScript createParsedScript(v8::Local<v8::Object> sourceObject , bool success); |
134 | 136 |
135 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; | 137 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; |
136 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); | 138 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); |
137 static void v8DebugEventCallback(const v8::Debug::EventDetails&); | 139 static void v8DebugEventCallback(const v8::Debug::EventDetails&); |
138 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const char* functionName); | 140 v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>, const char* functionName); |
139 void handleV8DebugEvent(const v8::Debug::EventDetails&); | 141 void handleV8DebugEvent(const v8::Debug::EventDetails&); |
140 | 142 |
141 v8::Local<v8::String> v8InternalizedString(const char*) const; | 143 v8::Local<v8::String> v8InternalizedString(const char*) const; |
142 | 144 |
143 void handleV8AsyncTaskEvent(V8DebuggerAgentImpl*, v8::Local<v8::Context>, v8 ::Local<v8::Object> executionState, v8::Local<v8::Object> eventData); | 145 void handleV8AsyncTaskEvent(V8DebuggerAgentImpl*, v8::Local<v8::Context>, v8 ::Local<v8::Object> executionState, v8::Local<v8::Object> eventData); |
146 bool installConsole(v8::Local<v8::Context>, bool hasMemoryAttribute); | |
144 | 147 |
145 v8::Isolate* m_isolate; | 148 v8::Isolate* m_isolate; |
146 V8DebuggerClient* m_client; | 149 V8DebuggerClient* m_client; |
147 using ContextsByGroupMap = protocol::HashMap<int, OwnPtr<ContextByIdMap>>; | 150 using ContextsByGroupMap = protocol::HashMap<int, OwnPtr<ContextByIdMap>>; |
148 ContextsByGroupMap m_contexts; | 151 ContextsByGroupMap m_contexts; |
149 using SessionMap = protocol::HashMap<int, V8InspectorSessionImpl*>; | 152 using SessionMap = protocol::HashMap<int, V8InspectorSessionImpl*>; |
150 SessionMap m_sessions; | 153 SessionMap m_sessions; |
151 int m_enabledAgentsCount; | 154 int m_enabledAgentsCount; |
152 bool m_breakpointsActivated; | 155 bool m_breakpointsActivated; |
153 v8::Global<v8::FunctionTemplate> m_breakProgramCallbackTemplate; | 156 v8::Global<v8::FunctionTemplate> m_breakProgramCallbackTemplate; |
154 v8::Global<v8::Object> m_debuggerScript; | 157 v8::Global<v8::Object> m_debuggerScript; |
155 v8::Global<v8::Context> m_debuggerContext; | 158 v8::Global<v8::Context> m_debuggerContext; |
156 v8::Local<v8::Object> m_executionState; | 159 v8::Local<v8::Object> m_executionState; |
157 v8::Local<v8::Context> m_pausedContext; | 160 v8::Local<v8::Context> m_pausedContext; |
158 bool m_runningNestedMessageLoop; | 161 bool m_runningNestedMessageLoop; |
159 v8::Global<v8::Context> m_regexContext; | 162 v8::Global<v8::Context> m_regexContext; |
160 }; | 163 }; |
161 | 164 |
162 } // namespace blink | 165 } // namespace blink |
163 | 166 |
164 | 167 |
165 #endif // V8DebuggerImpl_h | 168 #endif // V8DebuggerImpl_h |
OLD | NEW |