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

Unified Diff: Source/devtools/front_end/ScriptFormatterWorker.js

Issue 208593002: DevTools: fix CSS parser to properly report last parsed chunk (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/devtools/front_end/CSSParser.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ScriptFormatterWorker.js
diff --git a/Source/devtools/front_end/ScriptFormatterWorker.js b/Source/devtools/front_end/ScriptFormatterWorker.js
index 3d15c7ef331fc1246380a63a918276e116c24c39..a0ba85452ffea78860c5866c7246f69293877059 100644
--- a/Source/devtools/front_end/ScriptFormatterWorker.js
+++ b/Source/devtools/front_end/ScriptFormatterWorker.js
@@ -212,12 +212,9 @@ FormatterWorker.CSSParserStates = {
FormatterWorker.parseCSS = function(params)
{
var chunkSize = 100000; // characters per data chunk
- var totalLength = params.content.length;
var lines = params.content.split("\n");
- var chunkCount = FormatterWorker._chunkCount(totalLength, chunkSize);
var rules = [];
var processedChunkCharacters = 0;
- var currentChunk = 0;
var state = FormatterWorker.CSSParserStates.Initial;
var rule;
@@ -308,7 +305,7 @@ FormatterWorker.parseCSS = function(params)
}
processedChunkCharacters += newColumn - column;
if (processedChunkCharacters > chunkSize) {
- postMessage({ chunk: rules, total: chunkCount, index: currentChunk++ });
+ postMessage({ chunk: rules, isLastChunk: false });
rules = [];
processedChunkCharacters = 0;
}
@@ -319,7 +316,7 @@ FormatterWorker.parseCSS = function(params)
var line = lines[lineNumber];
tokenizer(line, processToken);
}
- postMessage({ chunk: rules, total: chunkCount, index: currentChunk++ });
+ postMessage({ chunk: rules, isLastChunk: true });
}
/**
« no previous file with comments | « Source/devtools/front_end/CSSParser.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698