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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js

Issue 2739323003: DevTools protocol interception, blocking & modification of requests (Closed)
Patch Set: Address remaining TODOs Created 3 years, 6 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 * @param {string} data 578 * @param {string} data
579 */ 579 */
580 eventSourceMessageReceived(requestId, time, eventName, eventId, data) { 580 eventSourceMessageReceived(requestId, time, eventName, eventId, data) {
581 var networkRequest = this._inflightRequestsById[requestId]; 581 var networkRequest = this._inflightRequestsById[requestId];
582 if (!networkRequest) 582 if (!networkRequest)
583 return; 583 return;
584 networkRequest.addEventSourceMessage(time, eventName, eventId, data); 584 networkRequest.addEventSourceMessage(time, eventName, eventId, data);
585 } 585 }
586 586
587 /** 587 /**
588 * @override
589 * @param {!Protocol.Network.RequestId} requestId
590 * @param {!Protocol.Network.Request} request
591 * @param {!Protocol.Network.Headers=} redirectHeaders
592 * @param {number=} redirectStatusCode
593 * @param {string=} redirectUrl
594 */
595 requestIntercepted(requestId, request, redirectHeaders, redirectStatusCode, re directUrl) {
596 // Stub implementation. Event not currently used by the frontend.
597 }
598
599 /**
588 * @param {!Protocol.Network.RequestId} requestId 600 * @param {!Protocol.Network.RequestId} requestId
589 * @param {!Protocol.Network.Timestamp} time 601 * @param {!Protocol.Network.Timestamp} time
590 * @param {string} redirectURL 602 * @param {string} redirectURL
591 * @return {!SDK.NetworkRequest} 603 * @return {!SDK.NetworkRequest}
592 */ 604 */
593 _appendRedirect(requestId, time, redirectURL) { 605 _appendRedirect(requestId, time, redirectURL) {
594 var originalNetworkRequest = this._inflightRequestsById[requestId]; 606 var originalNetworkRequest = this._inflightRequestsById[requestId];
595 var previousRedirects = originalNetworkRequest.redirects || []; 607 var previousRedirects = originalNetworkRequest.redirects || [];
596 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length); 608 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length);
597 delete originalNetworkRequest.redirects; 609 delete originalNetworkRequest.redirects;
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 SDK.MultitargetNetworkManager.Events = { 933 SDK.MultitargetNetworkManager.Events = {
922 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), 934 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'),
923 ConditionsChanged: Symbol('ConditionsChanged'), 935 ConditionsChanged: Symbol('ConditionsChanged'),
924 UserAgentChanged: Symbol('UserAgentChanged') 936 UserAgentChanged: Symbol('UserAgentChanged')
925 }; 937 };
926 938
927 /** 939 /**
928 * @type {!SDK.MultitargetNetworkManager} 940 * @type {!SDK.MultitargetNetworkManager}
929 */ 941 */
930 SDK.multitargetNetworkManager; 942 SDK.multitargetNetworkManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698