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

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

Issue 1702673002: DevTools: migrate remote debugging protocol generators to jinja2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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
41 namespace blink { 41 namespace blink {
42 42
43 class InjectedScriptManager; 43 class InjectedScriptManager;
44 class JSONValue; 44 class JSONValue;
45 class RemoteObjectId; 45 class RemoteObjectId;
46 class V8FunctionCall; 46 class V8FunctionCall;
47 class V8DebuggerClient; 47 class V8DebuggerClient;
48 48
49 typedef String ErrorString; 49 typedef String ErrorString;
50 50
51 using protocol::OptionalValue;
52
51 class InjectedScript final { 53 class InjectedScript final {
52 USING_FAST_MALLOC(InjectedScript); 54 USING_FAST_MALLOC(InjectedScript);
53 public: 55 public:
54 ~InjectedScript(); 56 ~InjectedScript();
55 57
56 void evaluate( 58 void evaluate(
57 ErrorString*, 59 ErrorString*,
58 const String& expression, 60 const String& expression,
59 const String& objectGroup, 61 const String& objectGroup,
60 bool includeCommandLineAPI, 62 bool includeCommandLineAPI,
61 bool returnByValue, 63 bool returnByValue,
62 bool generatePreview, 64 bool generatePreview,
63 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result, 65 OwnPtr<protocol::Runtime::RemoteObject>* result,
64 protocol::TypeBuilder::OptOutput<bool>* wasThrown, 66 OptionalValue<bool>* wasThrown,
65 RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 67 OwnPtr<protocol::Runtime::ExceptionDetails>*);
66 void callFunctionOn( 68 void callFunctionOn(
67 ErrorString*, 69 ErrorString*,
68 const String& objectId, 70 const String& objectId,
69 const String& expression, 71 const String& expression,
70 const String& arguments, 72 const String& arguments,
71 bool returnByValue, 73 bool returnByValue,
72 bool generatePreview, 74 bool generatePreview,
73 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result, 75 OwnPtr<protocol::Runtime::RemoteObject>* result,
74 protocol::TypeBuilder::OptOutput<bool>* wasThrown); 76 OptionalValue<bool>* wasThrown);
75 void evaluateOnCallFrame( 77 void evaluateOnCallFrame(
76 ErrorString*, 78 ErrorString*,
77 v8::Local<v8::Object> callFrames, 79 v8::Local<v8::Object> callFrames,
78 bool isAsyncCallStack, 80 bool isAsyncCallStack,
79 const String& callFrameId, 81 const String& callFrameId,
80 const String& expression, 82 const String& expression,
81 const String& objectGroup, 83 const String& objectGroup,
82 bool includeCommandLineAPI, 84 bool includeCommandLineAPI,
83 bool returnByValue, 85 bool returnByValue,
84 bool generatePreview, 86 bool generatePreview,
85 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result, 87 OwnPtr<protocol::Runtime::RemoteObject>* result,
86 protocol::TypeBuilder::OptOutput<bool>* wasThrown, 88 OptionalValue<bool>* wasThrown,
87 RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 89 OwnPtr<protocol::Runtime::ExceptionDetails>*);
88 void restartFrame(ErrorString*, v8::Local<v8::Object> callFrames, const Stri ng& callFrameId); 90 void restartFrame(ErrorString*, v8::Local<v8::Object> callFrames, const Stri ng& callFrameId);
89 void getStepInPositions(ErrorString*, v8::Local<v8::Object> callFrames, cons t String& callFrameId, RefPtr<protocol::TypeBuilder::Array<protocol::TypeBuilder ::Debugger::Location>>& positions); 91 void getStepInPositions(ErrorString*, v8::Local<v8::Object> callFrames, cons t String& callFrameId, OwnPtr<protocol::Array<protocol::Debugger::Location>>* po sitions);
90 void setVariableValue(ErrorString*, v8::Local<v8::Object> callFrames, const String* callFrameIdOpt, const String* functionObjectIdOpt, int scopeNumber, cons t String& variableName, const String& newValueStr); 92 void setVariableValue(ErrorString*, v8::Local<v8::Object> callFrames, const OptionalValue<String>& callFrameIdOpt, const OptionalValue<String>& functionObje ctIdOpt, int scopeNumber, const String& variableName, const String& newValueStr) ;
91 void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<proto col::TypeBuilder::Debugger::FunctionDetails>* result); 93 void getFunctionDetails(ErrorString*, const String& functionId, OwnPtr<proto col::Debugger::FunctionDetails>* result);
92 void getGeneratorObjectDetails(ErrorString*, const String& functionId, RefPt r<protocol::TypeBuilder::Debugger::GeneratorObjectDetails>* result); 94 void getGeneratorObjectDetails(ErrorString*, const String& functionId, OwnPt r<protocol::Debugger::GeneratorObjectDetails>* result);
93 void getCollectionEntries(ErrorString*, const String& objectId, RefPtr<proto col::TypeBuilder::Array<protocol::TypeBuilder::Debugger::CollectionEntry>>* resu lt); 95 void getCollectionEntries(ErrorString*, const String& objectId, OwnPtr<proto col::Array<protocol::Debugger::CollectionEntry>>* result);
94 void getProperties(ErrorString*, const String& objectId, bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, RefPtr<protocol::TypeBuilder ::Array<protocol::TypeBuilder::Runtime::PropertyDescriptor>>* result, RefPtr<pro tocol::TypeBuilder::Runtime::ExceptionDetails>*); 96 void getProperties(ErrorString*, const String& objectId, bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, OwnPtr<protocol::Array<proto col::Runtime::PropertyDescriptor>>* result, OwnPtr<protocol::Runtime::ExceptionD etails>*);
95 void getInternalProperties(ErrorString*, const String& objectId, RefPtr<prot ocol::TypeBuilder::Array<protocol::TypeBuilder::Runtime::InternalPropertyDescrip tor>>* result, RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 97 void getInternalProperties(ErrorString*, const String& objectId, OwnPtr<prot ocol::Array<protocol::Runtime::InternalPropertyDescriptor>>* result, OwnPtr<prot ocol::Runtime::ExceptionDetails>*);
96 void releaseObject(const String& objectId); 98 void releaseObject(const String& objectId);
97 v8::MaybeLocal<v8::Value> runCompiledScript(v8::Local<v8::Script>, bool incl udeCommandLineAPI); 99 v8::MaybeLocal<v8::Value> runCompiledScript(v8::Local<v8::Script>, bool incl udeCommandLineAPI);
98 100
99 PassRefPtr<protocol::TypeBuilder::Array<protocol::TypeBuilder::Debugger::Cal lFrame>> wrapCallFrames(v8::Local<v8::Object>, int asyncOrdinal); 101 PassOwnPtr<protocol::Array<protocol::Debugger::CallFrame>> wrapCallFrames(v8 ::Local<v8::Object>, int asyncOrdinal);
100 102
101 PassRefPtr<protocol::TypeBuilder::Runtime::RemoteObject> wrapObject(v8::Loca l<v8::Value>, const String& groupName, bool generatePreview = false) const; 103 PassOwnPtr<protocol::Runtime::RemoteObject> wrapObject(v8::Local<v8::Value>, const String& groupName, bool generatePreview = false) const;
102 PassRefPtr<protocol::TypeBuilder::Runtime::RemoteObject> wrapTable(v8::Local <v8::Value> table, v8::Local<v8::Value> columns) const; 104 PassOwnPtr<protocol::Runtime::RemoteObject> wrapTable(v8::Local<v8::Value> t able, v8::Local<v8::Value> columns) const;
103 v8::Local<v8::Value> findObject(const RemoteObjectId&) const; 105 v8::Local<v8::Value> findObject(const RemoteObjectId&) const;
104 String objectGroupName(const RemoteObjectId&) const; 106 String objectGroupName(const RemoteObjectId&) const;
105 void releaseObjectGroup(const String&); 107 void releaseObjectGroup(const String&);
106 108
107 void setCustomObjectFormatterEnabled(bool); 109 void setCustomObjectFormatterEnabled(bool);
108 int contextId() { return m_contextId; } 110 int contextId() { return m_contextId; }
109 String origin() const { return m_origin; } 111 String origin() const { return m_origin; }
110 void setOrigin(const String& origin) { m_origin = origin; } 112 void setOrigin(const String& origin) { m_origin = origin; }
111 113
112 v8::Isolate* isolate() { return m_isolate; } 114 v8::Isolate* isolate() { return m_isolate; }
113 v8::Local<v8::Context> context() const; 115 v8::Local<v8::Context> context() const;
114 void dispose(); 116 void dispose();
115 117
116 private: 118 private:
117 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8 ::Context>); 119 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8 ::Context>);
118 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8: :Object>, V8DebuggerClient*, PassRefPtr<InjectedScriptNative>, int contextId); 120 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8: :Object>, V8DebuggerClient*, PassRefPtr<InjectedScriptNative>, int contextId);
119 121
120 bool canAccessInspectedWindow() const; 122 bool canAccessInspectedWindow() const;
121 v8::Local<v8::Value> v8Value() const; 123 v8::Local<v8::Value> v8Value() const;
122 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE xception) const; 124 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE xception) const;
123 void makeCall(V8FunctionCall&, RefPtr<JSONValue>* result); 125 void makeCall(V8FunctionCall&, RefPtr<JSONValue>* result);
124 void makeEvalCall(ErrorString*, V8FunctionCall&, RefPtr<protocol::TypeBuilde r::Runtime::RemoteObject>* result, protocol::TypeBuilder::OptOutput<bool>* wasTh rown, RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>* = 0); 126 void makeEvalCall(ErrorString*, V8FunctionCall&, OwnPtr<protocol::Runtime::R emoteObject>* result, OptionalValue<bool>* wasThrown, OwnPtr<protocol::Runtime:: ExceptionDetails>* = 0);
125 void makeCallWithExceptionDetails(V8FunctionCall&, RefPtr<JSONValue>* result , RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 127 void makeCallWithExceptionDetails(V8FunctionCall&, RefPtr<JSONValue>* result , OwnPtr<protocol::Runtime::ExceptionDetails>*);
126 128
127 InjectedScriptManager* m_manager; 129 InjectedScriptManager* m_manager;
128 v8::Isolate* m_isolate; 130 v8::Isolate* m_isolate;
129 v8::Global<v8::Context> m_context; 131 v8::Global<v8::Context> m_context;
130 v8::Global<v8::Value> m_value; 132 v8::Global<v8::Value> m_value;
131 V8DebuggerClient* m_client; 133 V8DebuggerClient* m_client;
132 RefPtr<InjectedScriptNative> m_native; 134 RefPtr<InjectedScriptNative> m_native;
133 int m_contextId; 135 int m_contextId;
134 String m_origin; 136 String m_origin;
135 }; 137 };
136 138
137 } // namespace blink 139 } // namespace blink
138 140
139 #endif 141 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698