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

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

Issue 2906843002: [Devtools] Move to canReplayRequest in NetworkRequest (Closed)
Patch Set: changes 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 this._bypassServiceWorkerSetting = Common.settings.createSetting('bypassServ iceWorker', false); 52 this._bypassServiceWorkerSetting = Common.settings.createSetting('bypassServ iceWorker', false);
53 if (this._bypassServiceWorkerSetting.get()) 53 if (this._bypassServiceWorkerSetting.get())
54 this._bypassServiceWorkerChanged(); 54 this._bypassServiceWorkerChanged();
55 this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorker Changed, this); 55 this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorker Changed, this);
56 56
57 Common.moduleSetting('cacheDisabled').addChangeListener(this._cacheDisabledS ettingChanged, this); 57 Common.moduleSetting('cacheDisabled').addChangeListener(this._cacheDisabledS ettingChanged, this);
58 } 58 }
59 59
60 /** 60 /**
61 * @param {!SDK.NetworkRequest} request
62 * @return {boolean}
63 */
64 static canReplayRequest(request) {
65 return request.resourceType() === Common.resourceTypes.XHR;
66 }
67
68 /**
69 * @param {!SDK.NetworkRequest} request
70 */
71 static replayRequest(request) {
72 // TODO(allada) networkAgent() will be removed from NetworkRequest, but in t he mean time we extract it from request.
73 request.networkManager()._networkAgent.replayXHR(request.requestId());
74 }
75
76 /**
61 * @param {!SDK.NetworkManager.Conditions} conditions 77 * @param {!SDK.NetworkManager.Conditions} conditions
62 * @return {!Protocol.Network.ConnectionType} 78 * @return {!Protocol.Network.ConnectionType}
63 * TODO(allada): this belongs to NetworkConditionsSelector, which should hardc ode/guess it. 79 * TODO(allada): this belongs to NetworkConditionsSelector, which should hardc ode/guess it.
64 */ 80 */
65 static _connectionType(conditions) { 81 static _connectionType(conditions) {
66 if (!conditions.download && !conditions.upload) 82 if (!conditions.download && !conditions.upload)
67 return Protocol.Network.ConnectionType.None; 83 return Protocol.Network.ConnectionType.None;
68 var types = SDK.NetworkManager._connectionTypes; 84 var types = SDK.NetworkManager._connectionTypes;
69 if (!types) { 85 if (!types) {
70 SDK.NetworkManager._connectionTypes = []; 86 SDK.NetworkManager._connectionTypes = [];
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 SDK.MultitargetNetworkManager.Events = { 937 SDK.MultitargetNetworkManager.Events = {
922 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), 938 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'),
923 ConditionsChanged: Symbol('ConditionsChanged'), 939 ConditionsChanged: Symbol('ConditionsChanged'),
924 UserAgentChanged: Symbol('UserAgentChanged') 940 UserAgentChanged: Symbol('UserAgentChanged')
925 }; 941 };
926 942
927 /** 943 /**
928 * @type {!SDK.MultitargetNetworkManager} 944 * @type {!SDK.MultitargetNetworkManager}
929 */ 945 */
930 SDK.multitargetNetworkManager; 946 SDK.multitargetNetworkManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698