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

Side by Side Diff: chrome/browser/resources/net_internals/source_entry.js

Issue 432553003: Remove redundant mapping of net errors to strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to comments 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
« no previous file with comments | « chrome/browser/resources/net_internals/main.js ('k') | chrome/common/localized_error.cc » ('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 var SourceEntry = (function() { 5 var SourceEntry = (function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * A SourceEntry gathers all log entries with the same source. 9 * A SourceEntry gathers all log entries with the same source.
10 * 10 *
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 // If we have a net error code, update |this.isError_| if appropriate. 40 // If we have a net error code, update |this.isError_| if appropriate.
41 if (logEntry.params) { 41 if (logEntry.params) {
42 var netErrorCode = logEntry.params.net_error; 42 var netErrorCode = logEntry.params.net_error;
43 // Skip both cases where netErrorCode is undefined, and cases where it 43 // Skip both cases where netErrorCode is undefined, and cases where it
44 // is 0, indicating no actual error occurred. 44 // is 0, indicating no actual error occurred.
45 if (netErrorCode) { 45 if (netErrorCode) {
46 // Ignore error code caused by not finding an entry in the cache. 46 // Ignore error code caused by not finding an entry in the cache.
47 if (logEntry.type != EventType.HTTP_CACHE_OPEN_ENTRY || 47 if (logEntry.type != EventType.HTTP_CACHE_OPEN_ENTRY ||
48 netErrorCode != NetError.FAILED) { 48 netErrorCode != NetError.ERR_FAILED) {
49 this.isError_ = true; 49 this.isError_ = true;
50 } 50 }
51 } 51 }
52 } 52 }
53 53
54 var prevStartEntry = this.getStartEntry_(); 54 var prevStartEntry = this.getStartEntry_();
55 this.entries_.push(logEntry); 55 this.entries_.push(logEntry);
56 var curStartEntry = this.getStartEntry_(); 56 var curStartEntry = this.getStartEntry_();
57 57
58 // If we just got the first entry for this source. 58 // If we just got the first entry for this source.
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 this.entries_, 340 this.entries_,
341 SourceTracker.getInstance().getPrivacyStripping(), 341 SourceTracker.getInstance().getPrivacyStripping(),
342 SourceTracker.getInstance().getUseRelativeTimes() ? 342 SourceTracker.getInstance().getUseRelativeTimes() ?
343 timeutil.getBaseTime() : 0, 343 timeutil.getBaseTime() : 0,
344 Constants.clientInfo.numericDate); 344 Constants.clientInfo.numericDate);
345 }, 345 },
346 }; 346 };
347 347
348 return SourceEntry; 348 return SourceEntry;
349 })(); 349 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/main.js ('k') | chrome/common/localized_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698