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

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: Fix Created 3 years, 7 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 */
592 interceptedRequest(requestId, request) {
593 // Stub implementation. Event not currently used by the frontend.
594 }
595
596 /**
597 * @override
598 * @param {!Protocol.Network.RequestId} requestId
599 * @param {!Protocol.Network.Headers} responseHeaders
600 * @param {number} responseStatusCode
601 * @param {string} redirectUrl
602 */
603 interceptedRedirect(requestId, responseHeaders, responseStatusCode, redirectUr l) {
604 // Stub implementation. Event not currently used by the frontend.
605 }
606
607 /**
588 * @param {!Protocol.Network.RequestId} requestId 608 * @param {!Protocol.Network.RequestId} requestId
589 * @param {!Protocol.Network.Timestamp} time 609 * @param {!Protocol.Network.Timestamp} time
590 * @param {string} redirectURL 610 * @param {string} redirectURL
591 * @return {!SDK.NetworkRequest} 611 * @return {!SDK.NetworkRequest}
592 */ 612 */
593 _appendRedirect(requestId, time, redirectURL) { 613 _appendRedirect(requestId, time, redirectURL) {
594 var originalNetworkRequest = this._inflightRequestsById[requestId]; 614 var originalNetworkRequest = this._inflightRequestsById[requestId];
595 var previousRedirects = originalNetworkRequest.redirects || []; 615 var previousRedirects = originalNetworkRequest.redirects || [];
596 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length); 616 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length);
597 delete originalNetworkRequest.redirects; 617 delete originalNetworkRequest.redirects;
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 SDK.MultitargetNetworkManager.Events = { 941 SDK.MultitargetNetworkManager.Events = {
922 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), 942 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'),
923 ConditionsChanged: Symbol('ConditionsChanged'), 943 ConditionsChanged: Symbol('ConditionsChanged'),
924 UserAgentChanged: Symbol('UserAgentChanged') 944 UserAgentChanged: Symbol('UserAgentChanged')
925 }; 945 };
926 946
927 /** 947 /**
928 * @type {!SDK.MultitargetNetworkManager} 948 * @type {!SDK.MultitargetNetworkManager}
929 */ 949 */
930 SDK.multitargetNetworkManager; 950 SDK.multitargetNetworkManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698