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

Side by Side Diff: Source/devtools/front_end/ProfilesPanelDescriptor.js

Issue 23609064: Make "three snapshot technique" work on heap snapshots loaded from files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/ProfilesPanel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 WebInspector.ProfilesPanelDescriptor.ShortcutKeys = { 48 WebInspector.ProfilesPanelDescriptor.ShortcutKeys = {
49 StartStopRecording: [ 49 StartStopRecording: [
50 WebInspector.KeyboardShortcut.makeDescriptor("e", WebInspector.KeyboardS hortcut.Modifiers.CtrlOrMeta) 50 WebInspector.KeyboardShortcut.makeDescriptor("e", WebInspector.KeyboardS hortcut.Modifiers.CtrlOrMeta)
51 ] 51 ]
52 } 52 }
53 53
54 WebInspector.ProfilesPanelDescriptor.ProfileURLRegExp = /webkit-profile:\/\/(.+) \/(.+)/; 54 WebInspector.ProfilesPanelDescriptor.ProfileURLRegExp = /webkit-profile:\/\/(.+) \/(.+)/;
55 55
56 WebInspector.ProfilesPanelDescriptor.UserInitiatedProfileName = "org.webkit.prof iles.user-initiated";
57
58 /**
59 * @param {string} title
60 * @return {boolean}
61 */
62 WebInspector.ProfilesPanelDescriptor.isUserInitiatedProfile = function(title)
63 {
64 return title.startsWith(WebInspector.ProfilesPanelDescriptor.UserInitiatedPr ofileName);
65 }
66
67 /**
68 * @param {string} title
69 * @return {number}
70 * @throws {string}
71 */
72 WebInspector.ProfilesPanelDescriptor.userInitiatedProfileIndex = function(title)
73 {
74 if (!WebInspector.ProfilesPanelDescriptor.isUserInitiatedProfile(title))
75 throw "Not user-initiated profile title.";
76 var suffix = title.substring(WebInspector.ProfilesPanelDescriptor.UserInitia tedProfileName.length + 1);
77 return parseInt(suffix, 10);
78 }
79
80 /** 56 /**
81 * @param {string} title 57 * @param {string} title
82 * @return {string} 58 * @return {string}
83 */ 59 */
84 WebInspector.ProfilesPanelDescriptor.resolveProfileTitle = function(title) 60 WebInspector.ProfilesPanelDescriptor.resolveProfileTitle = function(title)
85 { 61 {
86 if (!WebInspector.ProfilesPanelDescriptor.isUserInitiatedProfile(title)) 62 return title;
87 return title;
88 return WebInspector.UIString("Profile %d", WebInspector.ProfilesPanelDescrip tor.userInitiatedProfileIndex(title));
89 } 63 }
90 64
91 /** 65 /**
92 * @param {Event} event 66 * @param {Event} event
93 */ 67 */
94 WebInspector.ProfilesPanelDescriptor._openCPUProfile = function(event) 68 WebInspector.ProfilesPanelDescriptor._openCPUProfile = function(event)
95 { 69 {
96 event.preventDefault(); 70 event.preventDefault();
97 var panel = WebInspector.showPanel("profiles"); 71 var panel = WebInspector.showPanel("profiles");
98 var link = /** @type {!Element} */ (event.target); 72 var link = /** @type {!Element} */ (event.target);
(...skipping 19 matching lines...) Expand all
118 link.href = WebInspector.UIString("show CPU profile"); 92 link.href = WebInspector.UIString("show CPU profile");
119 link.target = "_blank"; 93 link.target = "_blank";
120 if (tooltipText) 94 if (tooltipText)
121 link.title = tooltipText; 95 link.title = tooltipText;
122 link.timeLeft = timeLeft; 96 link.timeLeft = timeLeft;
123 link.timeRight = timeRight; 97 link.timeRight = timeRight;
124 link.profileUID = uid; 98 link.profileUID = uid;
125 link.addEventListener("click", WebInspector.ProfilesPanelDescriptor._openCPU Profile, true); 99 link.addEventListener("click", WebInspector.ProfilesPanelDescriptor._openCPU Profile, true);
126 return link; 100 return link;
127 } 101 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ProfilesPanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698