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

Side by Side Diff: Source/devtools/front_end/sources/ScriptFormatter.js

Issue 458753003: Revert of DevTools: Introduce module initializers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 var sourceMapping = new WebInspector.FormatterSourceMappingImpl(original Content.lineEndings(), formattedContent.lineEndings(), mapping); 117 var sourceMapping = new WebInspector.FormatterSourceMappingImpl(original Content.lineEndings(), formattedContent.lineEndings(), mapping);
118 task.callback(formattedContent, sourceMapping); 118 task.callback(formattedContent, sourceMapping);
119 }, 119 },
120 120
121 /** 121 /**
122 * @return {!Worker} 122 * @return {!Worker}
123 */ 123 */
124 get _worker() 124 get _worker()
125 { 125 {
126 if (!this._cachedWorker) { 126 if (!this._cachedWorker) {
127 this._cachedWorker = Runtime.startWorker("script_formatter_worker"); 127 this._cachedWorker = new Worker("script_formatter_worker/ScriptForma tterWorker.js");
128 this._cachedWorker.onmessage = /** @type {function(this:Worker)} */ (this._didFormatContent.bind(this)); 128 this._cachedWorker.onmessage = /** @type {function(this:Worker)} */ (this._didFormatContent.bind(this));
129 } 129 }
130 return this._cachedWorker; 130 return this._cachedWorker;
131 } 131 }
132 } 132 }
133 133
134 /** 134 /**
135 * @constructor 135 * @constructor
136 * @implements {WebInspector.Formatter} 136 * @implements {WebInspector.Formatter}
137 */ 137 */
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 */ 261 */
262 _convertPosition: function(positions1, positions2, position) 262 _convertPosition: function(positions1, positions2, position)
263 { 263 {
264 var index = positions1.upperBound(position) - 1; 264 var index = positions1.upperBound(position) - 1;
265 var convertedPosition = positions2[index] + position - positions1[index] ; 265 var convertedPosition = positions2[index] + position - positions1[index] ;
266 if (index < positions2.length - 1 && convertedPosition > positions2[inde x + 1]) 266 if (index < positions2.length - 1 && convertedPosition > positions2[inde x + 1])
267 convertedPosition = positions2[index + 1]; 267 convertedPosition = positions2[index + 1];
268 return convertedPosition; 268 return convertedPosition;
269 } 269 }
270 } 270 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sources/FilteredItemSelectionDialog.js ('k') | Source/devtools/front_end/sources/SourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698