@@ -17,6 +17,10 @@ namespace NetworkDomainCallbackHandlers {
1717static const char * FrameId = " NSFrameIdentifier" ;
1818static const char * LoaderId = " NSLoaderIdentifier" ;
1919
20+ /*
21+ * Fired when device is about to send HTTP request.
22+ * @param args - JS object : { requestId, timestamp, type, response }
23+ */
2024static void ResponseReceivedCallback (const v8::FunctionCallbackInfo<v8::Value>& args) {
2125 try {
2226 auto networkAgentInstance = V8NetworkAgentImpl::Instance;
@@ -90,6 +94,10 @@ static void ResponseReceivedCallback(const v8::FunctionCallbackInfo<v8::Value>&
9094 }
9195}
9296
97+ /*
98+ * Fired when HTTP response is available.
99+ * @param args - JS object { requestId, url, request, timestamp, type }
100+ */
93101static void RequestWillBeSentCallback (const v8::FunctionCallbackInfo<v8::Value>& args) {
94102 try {
95103 auto networkAgentInstance = V8NetworkAgentImpl::Instance;
@@ -164,6 +172,10 @@ static void RequestWillBeSentCallback(const v8::FunctionCallbackInfo<v8::Value>&
164172 }
165173}
166174
175+ /*
176+ * Called after response is received to save the response data for the provided requestId
177+ * @param args - JS object { requestId, data, hasTextContent }
178+ */
167179static void DataForRequestId (const v8::FunctionCallbackInfo<v8::Value>& args) {
168180 try {
169181 auto networkAgentInstance = V8NetworkAgentImpl::Instance;
@@ -229,6 +241,10 @@ static void DataForRequestId(const v8::FunctionCallbackInfo<v8::Value>& args) {
229241 }
230242}
231243
244+ /*
245+ * Fired when HTTP request has finished loading.
246+ * @param args - JS object { requestId, timestamp }
247+ */
232248static void LoadingFinishedCallback (const v8::FunctionCallbackInfo<v8::Value>& args) {
233249 try {
234250 auto networkAgentInstance = V8NetworkAgentImpl::Instance;
0 commit comments