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

Side by Side Diff: components/crash/core/browser/resources/crashes.js

Issue 2612993003: Display both capture and upload times in chrome://crashes. (Closed)
Patch Set: Handle Breakpad reports (with no capture_time) correctly. Created 3 years, 11 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
« no previous file with comments | « components/crash/core/browser/crashes_ui_util.cc ('k') | components/crash_strings.grdp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /* Id for tracking automatic refresh of crash list. */ 5 /* Id for tracking automatic refresh of crash list. */
6 var refreshCrashListId = undefined; 6 var refreshCrashListId = undefined;
7 7
8 /** 8 /**
9 * Requests the list of crashes from the backend. 9 * Requests the list of crashes from the backend.
10 */ 10 */
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 var productName = loadTimeData.getString('shortProductName'); 42 var productName = loadTimeData.getString('shortProductName');
43 43
44 for (var i = 0; i < crashes.length; i++) { 44 for (var i = 0; i < crashes.length; i++) {
45 var crash = crashes[i]; 45 var crash = crashes[i];
46 if (crash.local_id == '') 46 if (crash.local_id == '')
47 crash.local_id = productName; 47 crash.local_id = productName;
48 48
49 var crashBlock = document.createElement('div'); 49 var crashBlock = document.createElement('div');
50 if (crash.state != 'uploaded') 50 if (crash.state != 'uploaded')
51 crashBlock.className = 'notUploaded'; 51 crashBlock.className = 'notUploaded';
52
52 var title = document.createElement('h3'); 53 var title = document.createElement('h3');
53 var uploaded = crash.state == 'uploaded'; 54 var uploaded = crash.state == 'uploaded';
54 if (uploaded) { 55 if (uploaded) {
55 title.textContent = loadTimeData.getStringF('crashHeaderFormat', 56 title.textContent = loadTimeData.getStringF('crashHeaderFormat',
56 crash.id, 57 crash.id,
57 crash.local_id); 58 crash.local_id);
58 } else { 59 } else {
59 title.textContent = loadTimeData.getStringF('crashHeaderFormatLocalOnly', 60 title.textContent = loadTimeData.getStringF('crashHeaderFormatLocalOnly',
60 crash.local_id); 61 crash.local_id);
61 } 62 }
62 crashBlock.appendChild(title); 63 crashBlock.appendChild(title);
64
63 if (uploaded) { 65 if (uploaded) {
64 var date = document.createElement('p'); 66 var date = document.createElement('p');
65 date.textContent = loadTimeData.getStringF('crashTimeFormat', 67 date.textContent = ""
66 crash.time); 68 if (crash.capture_time) {
69 date.textContent += loadTimeData.getStringF(
70 'crashCaptureAndUploadTimeFormat', crash.capture_time,
71 crash.upload_time);
72 } else {
73 date.textContent += loadTimeData.getStringF('crashUploadTimeFormat',
74 crash.upload_time);
75 }
67 crashBlock.appendChild(date); 76 crashBlock.appendChild(date);
77
68 var linkBlock = document.createElement('p'); 78 var linkBlock = document.createElement('p');
69 var link = document.createElement('a'); 79 var link = document.createElement('a');
70 var commentLines = [ 80 var commentLines = [
71 'IMPORTANT: Your crash has already been automatically reported ' + 81 'IMPORTANT: Your crash has already been automatically reported ' +
72 'to our crash system. Please file this bug only if you can provide ' + 82 'to our crash system. Please file this bug only if you can provide ' +
73 'more information about it.', 83 'more information about it.',
74 '', 84 '',
75 '', 85 '',
76 'Chrome Version: ' + version, 86 'Chrome Version: ' + version,
77 'Operating System: ' + os, 87 'Operating System: ' + os,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 var textContentKey = 'crashUserRequested'; 119 var textContentKey = 'crashUserRequested';
110 else if (crash.state == 'pending') 120 else if (crash.state == 'pending')
111 var textContentKey = 'crashPending'; 121 var textContentKey = 'crashPending';
112 else if (crash.state == 'not_uploaded') 122 else if (crash.state == 'not_uploaded')
113 var textContentKey = 'crashNotUploaded'; 123 var textContentKey = 'crashNotUploaded';
114 else 124 else
115 continue; 125 continue;
116 126
117 var crashText = document.createElement('p'); 127 var crashText = document.createElement('p');
118 crashText.textContent = loadTimeData.getStringF(textContentKey, 128 crashText.textContent = loadTimeData.getStringF(textContentKey,
119 crash.time); 129 crash.capture_time);
120 crashBlock.appendChild(crashText); 130 crashBlock.appendChild(crashText);
121 131
122 if (crash.file_size != '') { 132 if (crash.file_size != '') {
123 var crashSizeText = document.createElement('p'); 133 var crashSizeText = document.createElement('p');
124 crashSizeText.textContent = loadTimeData.getStringF('crashSizeMessage', 134 crashSizeText.textContent = loadTimeData.getStringF('crashSizeMessage',
125 crash.file_size); 135 crash.file_size);
126 crashBlock.appendChild(crashSizeText); 136 crashBlock.appendChild(crashSizeText);
127 } 137 }
128 138
129 // Do not show "Send now" link for already requested crashes. 139 // Do not show "Send now" link for already requested crashes.
(...skipping 28 matching lines...) Expand all
158 168
159 // Trigger a refresh in 5 seconds. Clear any previous requests. 169 // Trigger a refresh in 5 seconds. Clear any previous requests.
160 clearTimeout(refreshCrashListId); 170 clearTimeout(refreshCrashListId);
161 refreshCrashListId = setTimeout(requestCrashes, 5000); 171 refreshCrashListId = setTimeout(requestCrashes, 5000);
162 } 172 }
163 173
164 document.addEventListener('DOMContentLoaded', function() { 174 document.addEventListener('DOMContentLoaded', function() {
165 $('uploadCrashes').onclick = requestCrashUpload; 175 $('uploadCrashes').onclick = requestCrashUpload;
166 requestCrashes(); 176 requestCrashes();
167 }); 177 });
OLDNEW
« no previous file with comments | « components/crash/core/browser/crashes_ui_util.cc ('k') | components/crash_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698