| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 WebInspector.TimelineUIUtils.buildTraceEventDetails = function(event, model, lin
kifier, detailed, callback) | 633 WebInspector.TimelineUIUtils.buildTraceEventDetails = function(event, model, lin
kifier, detailed, callback) |
| 634 { | 634 { |
| 635 var target = model.target(); | 635 var target = model.target(); |
| 636 if (!target) { | 636 if (!target) { |
| 637 callbackWrapper(); | 637 callbackWrapper(); |
| 638 return; | 638 return; |
| 639 } | 639 } |
| 640 var relatedNodes = null; | 640 var relatedNodes = null; |
| 641 var barrier = new CallbackBarrier(); | 641 var barrier = new CallbackBarrier(); |
| 642 if (!event.previewElement) { | 642 if (!event.previewElement) { |
| 643 if (event.url) | 643 if (event.url) { |
| 644 WebInspector.DOMPresentationUtils.buildImagePreviewContents(target,
event.url, false, barrier.createCallback(saveImage)); | 644 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(ta
rget); |
| 645 else if (event.picture) | 645 if (resourceTreeModel) |
| 646 WebInspector.DOMPresentationUtils.buildImagePreviewContents(reso
urceTreeModel, event.url, false, barrier.createCallback(saveImage)); |
| 647 } else if (event.picture) |
| 646 WebInspector.TimelineUIUtils.buildPicturePreviewContent(event, targe
t, barrier.createCallback(saveImage)); | 648 WebInspector.TimelineUIUtils.buildPicturePreviewContent(event, targe
t, barrier.createCallback(saveImage)); |
| 647 } | 649 } |
| 648 var nodeIdsToResolve = new Set(); | 650 var nodeIdsToResolve = new Set(); |
| 649 if (event.backendNodeId) | 651 if (event.backendNodeId) |
| 650 nodeIdsToResolve.add(event.backendNodeId); | 652 nodeIdsToResolve.add(event.backendNodeId); |
| 651 if (event.invalidationTrackingEvents) | 653 if (event.invalidationTrackingEvents) |
| 652 WebInspector.TimelineUIUtils._collectInvalidationNodeIds(nodeIdsToResolv
e, event.invalidationTrackingEvents); | 654 WebInspector.TimelineUIUtils._collectInvalidationNodeIds(nodeIdsToResolv
e, event.invalidationTrackingEvents); |
| 653 if (nodeIdsToResolve.size) { | 655 if (nodeIdsToResolve.size) { |
| 654 var domModel = WebInspector.DOMModel.fromTarget(target); | 656 var domModel = WebInspector.DOMModel.fromTarget(target); |
| 655 if (domModel) | 657 if (domModel) |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 var sendRequest = request.children[0]; | 998 var sendRequest = request.children[0]; |
| 997 var topFrame = WebInspector.TimelineUIUtils.topStackFrame(sendRequest); | 999 var topFrame = WebInspector.TimelineUIUtils.topStackFrame(sendRequest); |
| 998 if (topFrame) { | 1000 if (topFrame) { |
| 999 contentHelper.appendElementRow(title, linkifier.linkifyConsoleCallFrameF
orTimeline(target, topFrame)); | 1001 contentHelper.appendElementRow(title, linkifier.linkifyConsoleCallFrameF
orTimeline(target, topFrame)); |
| 1000 } else if (sendRequest.initiator) { | 1002 } else if (sendRequest.initiator) { |
| 1001 var initiatorURL = WebInspector.TimelineUIUtils.eventURL(sendRequest.ini
tiator); | 1003 var initiatorURL = WebInspector.TimelineUIUtils.eventURL(sendRequest.ini
tiator); |
| 1002 if (initiatorURL) | 1004 if (initiatorURL) |
| 1003 contentHelper.appendElementRow(title, linkifier.linkifyScriptLocatio
n(target, null, initiatorURL, 0)); | 1005 contentHelper.appendElementRow(title, linkifier.linkifyScriptLocatio
n(target, null, initiatorURL, 0)); |
| 1004 } | 1006 } |
| 1005 | 1007 |
| 1008 var resourceTreeModel = target && WebInspector.ResourceTreeModel.fromTarget(
target); |
| 1009 |
| 1006 /** | 1010 /** |
| 1007 * @param {function(?Element)} fulfill | 1011 * @param {function(?Element)} fulfill |
| 1008 */ | 1012 */ |
| 1009 function action(fulfill) | 1013 function action(fulfill) |
| 1010 { | 1014 { |
| 1011 WebInspector.DOMPresentationUtils.buildImagePreviewContents(/** @type {!
WebInspector.Target} */(target), request.url, false, saveImage); | 1015 WebInspector.DOMPresentationUtils.buildImagePreviewContents(/** @type {!
WebInspector.ResourceTreeModel} */(resourceTreeModel), request.url, false, saveI
mage); |
| 1012 /** | 1016 /** |
| 1013 * @param {!Element=} element | 1017 * @param {!Element=} element |
| 1014 */ | 1018 */ |
| 1015 function saveImage(element) | 1019 function saveImage(element) |
| 1016 { | 1020 { |
| 1017 request.previewElement = element || null; | 1021 request.previewElement = element || null; |
| 1018 fulfill(request.previewElement); | 1022 fulfill(request.previewElement); |
| 1019 } | 1023 } |
| 1020 } | 1024 } |
| 1021 var previewPromise; | 1025 var previewPromise; |
| 1022 if (request.previewElement) | 1026 if (request.previewElement) |
| 1023 previewPromise = Promise.resolve(request.previewElement); | 1027 previewPromise = Promise.resolve(request.previewElement); |
| 1024 else | 1028 else |
| 1025 previewPromise = request.url && target ? new Promise(action) : Promise.r
esolve(null); | 1029 previewPromise = request.url && resourceTreeModel ? new Promise(action)
: Promise.resolve(null); |
| 1026 /** | 1030 /** |
| 1027 * @param {?Element} element | 1031 * @param {?Element} element |
| 1028 * @return {!DocumentFragment} | 1032 * @return {!DocumentFragment} |
| 1029 */ | 1033 */ |
| 1030 function appendPreview(element) | 1034 function appendPreview(element) |
| 1031 { | 1035 { |
| 1032 if (element) | 1036 if (element) |
| 1033 contentHelper.appendElementRow(WebInspector.UIString("Preview"), req
uest.previewElement); | 1037 contentHelper.appendElementRow(WebInspector.UIString("Preview"), req
uest.previewElement); |
| 1034 return contentHelper.fragment; | 1038 return contentHelper.fragment; |
| 1035 } | 1039 } |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2138 case warnings.V8Deopt: | 2142 case warnings.V8Deopt: |
| 2139 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl
eChrome/devtools-docs/issues/53", | 2143 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl
eChrome/devtools-docs/issues/53", |
| 2140 WebInspector.UIString("Not optimized"), undefined, true)); | 2144 WebInspector.UIString("Not optimized"), undefined, true)); |
| 2141 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso
n"])); | 2145 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso
n"])); |
| 2142 break; | 2146 break; |
| 2143 default: | 2147 default: |
| 2144 console.assert(false, "Unhandled TimelineModel.WarningType"); | 2148 console.assert(false, "Unhandled TimelineModel.WarningType"); |
| 2145 } | 2149 } |
| 2146 return span; | 2150 return span; |
| 2147 } | 2151 } |
| OLD | NEW |