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

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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 public: 53 public:
54 ~InjectedScript(); 54 ~InjectedScript();
55 55
56 void evaluate( 56 void evaluate(
57 ErrorString*, 57 ErrorString*,
58 const String& expression, 58 const String& expression,
59 const String& objectGroup, 59 const String& objectGroup,
60 bool includeCommandLineAPI, 60 bool includeCommandLineAPI,
61 bool returnByValue, 61 bool returnByValue,
62 bool generatePreview, 62 bool generatePreview,
63 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result, 63 OwnPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result,
64 protocol::TypeBuilder::OptOutput<bool>* wasThrown, 64 protocol::TypeBuilder::OptionalValue<bool>* wasThrown,
65 RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 65 OwnPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*);
66 void callFunctionOn( 66 void callFunctionOn(
67 ErrorString*, 67 ErrorString*,
68 const String& objectId, 68 const String& objectId,
69 const String& expression, 69 const String& expression,
70 const String& arguments, 70 const String& arguments,
71 bool returnByValue, 71 bool returnByValue,
72 bool generatePreview, 72 bool generatePreview,
73 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result, 73 OwnPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result,
74 protocol::TypeBuilder::OptOutput<bool>* wasThrown); 74 protocol::TypeBuilder::OptionalValue<bool>* wasThrown);
75 void evaluateOnCallFrame( 75 void evaluateOnCallFrame(
76 ErrorString*, 76 ErrorString*,
77 v8::Local<v8::Object> callFrames, 77 v8::Local<v8::Object> callFrames,
78 bool isAsyncCallStack, 78 bool isAsyncCallStack,
79 const String& callFrameId, 79 const String& callFrameId,
80 const String& expression, 80 const String& expression,
81 const String& objectGroup, 81 const String& objectGroup,
82 bool includeCommandLineAPI, 82 bool includeCommandLineAPI,
83 bool returnByValue, 83 bool returnByValue,
84 bool generatePreview, 84 bool generatePreview,
85 RefPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result, 85 OwnPtr<protocol::TypeBuilder::Runtime::RemoteObject>* result,
86 protocol::TypeBuilder::OptOutput<bool>* wasThrown, 86 protocol::TypeBuilder::OptionalValue<bool>* wasThrown,
87 RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 87 OwnPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*);
88 void restartFrame(ErrorString*, v8::Local<v8::Object> callFrames, const Stri ng& callFrameId); 88 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); 89 void getStepInPositions(ErrorString*, v8::Local<v8::Object> callFrames, cons t String& callFrameId, OwnPtr<protocol::TypeBuilder::Array<protocol::TypeBuilder ::Debugger::Location>>* positions);
90 void setVariableValue(ErrorString*, v8::Local<v8::Object> callFrames, const String* callFrameIdOpt, const String* functionObjectIdOpt, int scopeNumber, cons t String& variableName, const String& newValueStr); 90 void setVariableValue(ErrorString*, v8::Local<v8::Object> callFrames, const protocol::TypeBuilder::OptionalValue<String>& callFrameIdOpt, const protocol::Ty peBuilder::OptionalValue<String>& functionObjectIdOpt, int scopeNumber, const St ring& variableName, const String& newValueStr);
91 void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<proto col::TypeBuilder::Debugger::FunctionDetails>* result); 91 void getFunctionDetails(ErrorString*, const String& functionId, OwnPtr<proto col::TypeBuilder::Debugger::FunctionDetails>* result);
92 void getGeneratorObjectDetails(ErrorString*, const String& functionId, RefPt r<protocol::TypeBuilder::Debugger::GeneratorObjectDetails>* result); 92 void getGeneratorObjectDetails(ErrorString*, const String& functionId, OwnPt r<protocol::TypeBuilder::Debugger::GeneratorObjectDetails>* result);
93 void getCollectionEntries(ErrorString*, const String& objectId, RefPtr<proto col::TypeBuilder::Array<protocol::TypeBuilder::Debugger::CollectionEntry>>* resu lt); 93 void getCollectionEntries(ErrorString*, const String& objectId, OwnPtr<proto col::TypeBuilder::Array<protocol::TypeBuilder::Debugger::CollectionEntry>>* resu lt);
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>*); 94 void getProperties(ErrorString*, const String& objectId, bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, OwnPtr<protocol::TypeBuilder ::Array<protocol::TypeBuilder::Runtime::PropertyDescriptor>>* result, OwnPtr<pro tocol::TypeBuilder::Runtime::ExceptionDetails>*);
95 void getInternalProperties(ErrorString*, const String& objectId, RefPtr<prot ocol::TypeBuilder::Array<protocol::TypeBuilder::Runtime::InternalPropertyDescrip tor>>* result, RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 95 void getInternalProperties(ErrorString*, const String& objectId, OwnPtr<prot ocol::TypeBuilder::Array<protocol::TypeBuilder::Runtime::InternalPropertyDescrip tor>>* result, OwnPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*);
96 void releaseObject(const String& objectId); 96 void releaseObject(const String& objectId);
97 v8::MaybeLocal<v8::Value> runCompiledScript(v8::Local<v8::Script>, bool incl udeCommandLineAPI); 97 v8::MaybeLocal<v8::Value> runCompiledScript(v8::Local<v8::Script>, bool incl udeCommandLineAPI);
98 98
99 PassRefPtr<protocol::TypeBuilder::Array<protocol::TypeBuilder::Debugger::Cal lFrame>> wrapCallFrames(v8::Local<v8::Object>, int asyncOrdinal); 99 PassOwnPtr<protocol::TypeBuilder::Array<protocol::TypeBuilder::Debugger::Cal lFrame>> wrapCallFrames(v8::Local<v8::Object>, int asyncOrdinal);
100 100
101 PassRefPtr<protocol::TypeBuilder::Runtime::RemoteObject> wrapObject(v8::Loca l<v8::Value>, const String& groupName, bool generatePreview = false) const; 101 PassOwnPtr<protocol::TypeBuilder::Runtime::RemoteObject> wrapObject(v8::Loca l<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; 102 PassOwnPtr<protocol::TypeBuilder::Runtime::RemoteObject> wrapTable(v8::Local <v8::Value> table, v8::Local<v8::Value> columns) const;
103 v8::Local<v8::Value> findObject(const RemoteObjectId&) const; 103 v8::Local<v8::Value> findObject(const RemoteObjectId&) const;
104 String objectGroupName(const RemoteObjectId&) const; 104 String objectGroupName(const RemoteObjectId&) const;
105 void releaseObjectGroup(const String&); 105 void releaseObjectGroup(const String&);
106 106
107 void setCustomObjectFormatterEnabled(bool); 107 void setCustomObjectFormatterEnabled(bool);
108 int contextId() { return m_contextId; } 108 int contextId() { return m_contextId; }
109 String origin() const { return m_origin; } 109 String origin() const { return m_origin; }
110 void setOrigin(const String& origin) { m_origin = origin; } 110 void setOrigin(const String& origin) { m_origin = origin; }
111 111
112 v8::Isolate* isolate() { return m_isolate; } 112 v8::Isolate* isolate() { return m_isolate; }
113 v8::Local<v8::Context> context() const; 113 v8::Local<v8::Context> context() const;
114 void dispose(); 114 void dispose();
115 115
116 private: 116 private:
117 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8 ::Context>); 117 friend InjectedScript* InjectedScriptManager::injectedScriptFor(v8::Local<v8 ::Context>);
118 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8: :Object>, V8DebuggerClient*, PassRefPtr<InjectedScriptNative>, int contextId); 118 InjectedScript(InjectedScriptManager*, v8::Local<v8::Context>, v8::Local<v8: :Object>, V8DebuggerClient*, PassRefPtr<InjectedScriptNative>, int contextId);
119 119
120 bool canAccessInspectedWindow() const; 120 bool canAccessInspectedWindow() const;
121 v8::Local<v8::Value> v8Value() const; 121 v8::Local<v8::Value> v8Value() const;
122 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE xception) const; 122 v8::Local<v8::Value> callFunctionWithEvalEnabled(V8FunctionCall&, bool& hadE xception) const;
123 void makeCall(V8FunctionCall&, RefPtr<JSONValue>* result); 123 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); 124 void makeEvalCall(ErrorString*, V8FunctionCall&, OwnPtr<protocol::TypeBuilde r::Runtime::RemoteObject>* result, protocol::TypeBuilder::OptionalValue<bool>* w asThrown, OwnPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>* = 0);
125 void makeCallWithExceptionDetails(V8FunctionCall&, RefPtr<JSONValue>* result , RefPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*); 125 void makeCallWithExceptionDetails(V8FunctionCall&, RefPtr<JSONValue>* result , OwnPtr<protocol::TypeBuilder::Runtime::ExceptionDetails>*);
126 126
127 InjectedScriptManager* m_manager; 127 InjectedScriptManager* m_manager;
128 v8::Isolate* m_isolate; 128 v8::Isolate* m_isolate;
129 v8::Global<v8::Context> m_context; 129 v8::Global<v8::Context> m_context;
130 v8::Global<v8::Value> m_value; 130 v8::Global<v8::Value> m_value;
131 V8DebuggerClient* m_client; 131 V8DebuggerClient* m_client;
132 RefPtr<InjectedScriptNative> m_native; 132 RefPtr<InjectedScriptNative> m_native;
133 int m_contextId; 133 int m_contextId;
134 String m_origin; 134 String m_origin;
135 }; 135 };
136 136
137 } // namespace blink 137 } // namespace blink
138 138
139 #endif 139 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698