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

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

Issue 2735133004: DevTools coverage: get script/stylesheet size directly, do not request content (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 * @param {!Protocol.Runtime.ScriptId} scriptId 451 * @param {!Protocol.Runtime.ScriptId} scriptId
452 * @param {string} sourceURL 452 * @param {string} sourceURL
453 * @param {number} startLine 453 * @param {number} startLine
454 * @param {number} startColumn 454 * @param {number} startColumn
455 * @param {number} endLine 455 * @param {number} endLine
456 * @param {number} endColumn 456 * @param {number} endColumn
457 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId 457 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId
458 * @param {string} hash 458 * @param {string} hash
459 * @param {*|undefined} executionContextAuxData 459 * @param {*|undefined} executionContextAuxData
460 * @param {boolean} isLiveEdit 460 * @param {boolean} isLiveEdit
461 * @param {string=} sourceMapURL 461 * @param {string|undefined} sourceMapURL
462 * @param {boolean=} hasSourceURL 462 * @param {boolean} hasSourceURL
463 * @param {boolean=} hasSyntaxError 463 * @param {boolean} hasSyntaxError
464 * @param {number} length
464 * @return {!SDK.Script} 465 * @return {!SDK.Script}
465 */ 466 */
466 _parsedScriptSource( 467 _parsedScriptSource(
467 scriptId, 468 scriptId, sourceURL, startLine, startColumn, endLine, endColumn, execution ContextId, hash,
468 sourceURL, 469 executionContextAuxData, isLiveEdit, sourceMapURL, hasSourceURL, hasSyntax Error, length) {
469 startLine,
470 startColumn,
471 endLine,
472 endColumn,
473 executionContextId,
474 hash,
475 executionContextAuxData,
476 isLiveEdit,
477 sourceMapURL,
478 hasSourceURL,
479 hasSyntaxError) {
480 var isContentScript = false; 470 var isContentScript = false;
481 if (executionContextAuxData && ('isDefault' in executionContextAuxData)) 471 if (executionContextAuxData && ('isDefault' in executionContextAuxData))
482 isContentScript = !executionContextAuxData['isDefault']; 472 isContentScript = !executionContextAuxData['isDefault'];
483 // Support file URL for node.js. 473 // Support file URL for node.js.
484 if (this.target().isNodeJS() && sourceURL && sourceURL.startsWith('/')) { 474 if (this.target().isNodeJS() && sourceURL && sourceURL.startsWith('/')) {
485 var nodeJSPath = sourceURL; 475 var nodeJSPath = sourceURL;
486 sourceURL = Common.ParsedURL.platformPathToURL(nodeJSPath); 476 sourceURL = Common.ParsedURL.platformPathToURL(nodeJSPath);
487 sourceURL = this._internString(sourceURL); 477 sourceURL = this._internString(sourceURL);
488 this._fileURLToNodeJSPath.set(sourceURL, nodeJSPath); 478 this._fileURLToNodeJSPath.set(sourceURL, nodeJSPath);
489 } else { 479 } else {
490 sourceURL = this._internString(sourceURL); 480 sourceURL = this._internString(sourceURL);
491 } 481 }
492 var script = new SDK.Script( 482 var script = new SDK.Script(
493 this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, e xecutionContextId, 483 this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, e xecutionContextId,
494 this._internString(hash), isContentScript, isLiveEdit, sourceMapURL, has SourceURL); 484 this._internString(hash), isContentScript, isLiveEdit, sourceMapURL, has SourceURL, length);
495 this._registerScript(script); 485 this._registerScript(script);
496 if (!hasSyntaxError) 486 if (!hasSyntaxError)
497 this.dispatchEventToListeners(SDK.DebuggerModel.Events.ParsedScriptSource, script); 487 this.dispatchEventToListeners(SDK.DebuggerModel.Events.ParsedScriptSource, script);
498 else 488 else
499 this.dispatchEventToListeners(SDK.DebuggerModel.Events.FailedToParseScript Source, script); 489 this.dispatchEventToListeners(SDK.DebuggerModel.Events.FailedToParseScript Source, script);
500 var isDiscardable = hasSyntaxError && script.isAnonymousScript(); 490 var isDiscardable = hasSyntaxError && script.isAnonymousScript();
501 if (isDiscardable) { 491 if (isDiscardable) {
502 this._discardableScripts.push(script); 492 this._discardableScripts.push(script);
503 this._collectDiscardedScripts(); 493 this._collectDiscardedScripts();
504 } 494 }
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 * @param {number} startLine 916 * @param {number} startLine
927 * @param {number} startColumn 917 * @param {number} startColumn
928 * @param {number} endLine 918 * @param {number} endLine
929 * @param {number} endColumn 919 * @param {number} endColumn
930 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId 920 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId
931 * @param {string} hash 921 * @param {string} hash
932 * @param {*=} executionContextAuxData 922 * @param {*=} executionContextAuxData
933 * @param {boolean=} isLiveEdit 923 * @param {boolean=} isLiveEdit
934 * @param {string=} sourceMapURL 924 * @param {string=} sourceMapURL
935 * @param {boolean=} hasSourceURL 925 * @param {boolean=} hasSourceURL
926 * @param {boolean=} isModule
927 * @param {number=} length
936 */ 928 */
937 scriptParsed( 929 scriptParsed(
938 scriptId, 930 scriptId, sourceURL, startLine, startColumn, endLine, endColumn, execution ContextId, hash,
939 sourceURL, 931 executionContextAuxData, isLiveEdit, sourceMapURL, hasSourceURL, isModule, length) {
940 startLine,
941 startColumn,
942 endLine,
943 endColumn,
944 executionContextId,
945 hash,
946 executionContextAuxData,
947 isLiveEdit,
948 sourceMapURL,
949 hasSourceURL) {
950 this._debuggerModel._parsedScriptSource( 932 this._debuggerModel._parsedScriptSource(
951 scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executi onContextId, hash, 933 scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executi onContextId, hash,
952 executionContextAuxData, !!isLiveEdit, sourceMapURL, hasSourceURL, false ); 934 executionContextAuxData, !!isLiveEdit, sourceMapURL, !!hasSourceURL, fal se, length || 0);
953 } 935 }
954 936
955 /** 937 /**
956 * @override 938 * @override
957 * @param {!Protocol.Runtime.ScriptId} scriptId 939 * @param {!Protocol.Runtime.ScriptId} scriptId
958 * @param {string} sourceURL 940 * @param {string} sourceURL
959 * @param {number} startLine 941 * @param {number} startLine
960 * @param {number} startColumn 942 * @param {number} startColumn
961 * @param {number} endLine 943 * @param {number} endLine
962 * @param {number} endColumn 944 * @param {number} endColumn
963 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId 945 * @param {!Protocol.Runtime.ExecutionContextId} executionContextId
964 * @param {string} hash 946 * @param {string} hash
965 * @param {*=} executionContextAuxData 947 * @param {*=} executionContextAuxData
966 * @param {string=} sourceMapURL 948 * @param {string=} sourceMapURL
967 * @param {boolean=} hasSourceURL 949 * @param {boolean=} hasSourceURL
950 * @param {boolean=} isModule
951 * @param {number=} length
968 */ 952 */
969 scriptFailedToParse( 953 scriptFailedToParse(
970 scriptId, 954 scriptId, sourceURL, startLine, startColumn, endLine, endColumn, execution ContextId, hash,
971 sourceURL, 955 executionContextAuxData, sourceMapURL, hasSourceURL, isModule, length) {
972 startLine,
973 startColumn,
974 endLine,
975 endColumn,
976 executionContextId,
977 hash,
978 executionContextAuxData,
979 sourceMapURL,
980 hasSourceURL) {
981 this._debuggerModel._parsedScriptSource( 956 this._debuggerModel._parsedScriptSource(
982 scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executi onContextId, hash, 957 scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executi onContextId, hash,
983 executionContextAuxData, false, sourceMapURL, hasSourceURL, true); 958 executionContextAuxData, false, sourceMapURL, !!hasSourceURL, true, leng th || 0);
984 } 959 }
985 960
986 /** 961 /**
987 * @override 962 * @override
988 * @param {!Protocol.Debugger.BreakpointId} breakpointId 963 * @param {!Protocol.Debugger.BreakpointId} breakpointId
989 * @param {!Protocol.Debugger.Location} location 964 * @param {!Protocol.Debugger.Location} location
990 */ 965 */
991 breakpointResolved(breakpointId, location) { 966 breakpointResolved(breakpointId, location) {
992 this._debuggerModel._breakpointResolved(breakpointId, location); 967 this._debuggerModel._breakpointResolved(breakpointId, location);
993 } 968 }
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 stack.callFrames.shift(); 1362 stack.callFrames.shift();
1388 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) 1363 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame))
1389 previous.parent = stack.parent; 1364 previous.parent = stack.parent;
1390 else 1365 else
1391 previous = stack; 1366 previous = stack;
1392 stack = stack.parent; 1367 stack = stack.parent;
1393 } 1368 }
1394 return asyncStackTrace; 1369 return asyncStackTrace;
1395 } 1370 }
1396 }; 1371 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698