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

Unified Diff: Source/devtools/front_end/bindings/SASSSourceMapping.js

Issue 658123002: DevTools: [SASS] poll CSS for 30 seconds instead of 5 seconds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/bindings/SASSSourceMapping.js
diff --git a/Source/devtools/front_end/bindings/SASSSourceMapping.js b/Source/devtools/front_end/bindings/SASSSourceMapping.js
index 592d3e07b4041e0c718dca4fe96d7d86af369024..31edd7c434d87243aab1429d103399a0850aa9be 100644
--- a/Source/devtools/front_end/bindings/SASSSourceMapping.js
+++ b/Source/devtools/front_end/bindings/SASSSourceMapping.js
@@ -37,7 +37,7 @@
*/
WebInspector.SASSSourceMapping = function(cssModel, workspace, networkWorkspaceBinding)
{
- this.pollPeriodMs = 5000;
+ this.pollPeriodMs = 30 * 1000;
this.pollIntervalMs = 200;
this._cssModel = cssModel;
@@ -221,10 +221,14 @@ WebInspector.SASSSourceMapping.prototype = {
if (!pollData)
return;
- if (stopPolling || (now = new Date().getTime()) > pollData.deadlineMs) {
- delete pollData.dataByURL[cssURL];
- if (!Object.keys(pollData.dataByURL).length)
- delete this._pollDataForSASSURL[sassURL];
+ if (stopPolling) {
+ this._stopPolling(cssURL, sassURL);
+ return;
+ }
+
+ if ((now = new Date().getTime()) > pollData.deadlineMs) {
+ WebInspector.console.warn(WebInspector.UIString("%s hasn't been updated in %d seconds.", cssURL, this.pollPeriodMs / 1000));
+ this._stopPolling(cssURL, sassURL);
return;
}
var nextPoll = this.pollIntervalMs + pollData.dataByURL[cssURL].previousPoll;
@@ -236,6 +240,18 @@ WebInspector.SASSSourceMapping.prototype = {
/**
* @param {string} cssURL
* @param {string} sassURL
+ */
+ _stopPolling: function(cssURL, sassURL)
+ {
+ var pollData = this._pollDataForSASSURL[sassURL];
+ delete pollData.dataByURL[cssURL];
+ if (!Object.keys(pollData.dataByURL).length)
+ delete this._pollDataForSASSURL[sassURL];
+ },
+
+ /**
+ * @param {string} cssURL
+ * @param {string} sassURL
* @param {function(string, string, boolean)} callback
*/
_reloadCSS: function(cssURL, sassURL, callback)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698