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

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

Issue 3416015: Adds Winsock service providers to log dumps... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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/serviceprovidersview.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 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 /** 5 /**
6 * Inherit the prototype methods from one constructor into another. 6 * Inherit the prototype methods from one constructor into another.
7 */ 7 */
8 function inherits(childCtor, parentCtor) { 8 function inherits(childCtor, parentCtor) {
9 function tempCtor() {}; 9 function tempCtor() {};
10 tempCtor.prototype = parentCtor.prototype; 10 tempCtor.prototype = parentCtor.prototype;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 function getKeyWithValue(map, value) { 99 function getKeyWithValue(map, value) {
100 for (key in map) { 100 for (key in map) {
101 if (map[key] == value) 101 if (map[key] == value)
102 return key; 102 return key;
103 } 103 }
104 return '?'; 104 return '?';
105 } 105 }
106 106
107 /** 107 /**
108 * Looks up |key| in |map|, and returns the resulting entry, if there is one.
109 * Otherwise, returns |key|. Intended primarily for use with incomplete
110 * tables, and for reasonable behavior with system enumerations that may be
111 * extended in the future.
112 */
113 function tryGetValueWithKey(map, key) {
114 if (key in map)
115 return map[key];
116 return key;
117 }
118
119 /**
108 * Builds a string by repeating |str| |count| times. 120 * Builds a string by repeating |str| |count| times.
109 */ 121 */
110 function makeRepeatedString(str, count) { 122 function makeRepeatedString(str, count) {
111 var out = []; 123 var out = [];
112 for (var i = 0; i < count; ++i) 124 for (var i = 0; i < count; ++i)
113 out.push(str); 125 out.push(str);
114 return out.join(''); 126 return out.join('');
115 } 127 }
116 128
117 /** 129 /**
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 out.push(paddingStr); 225 out.push(paddingStr);
214 } 226 }
215 } 227 }
216 } 228 }
217 out.push('\n'); 229 out.push('\n');
218 } 230 }
219 231
220 return out.join(''); 232 return out.join('');
221 }; 233 };
222 234
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/serviceprovidersview.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698