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

Side by Side Diff: chrome/test/functional/perf/endure_graphs/js/common.js

Issue 11293043: Merge chrome perf graphing change into Chrome Endure fork of graphing code. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « no previous file | 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) 2012 The Chromium Authors. All rights reserved. 2 Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * @fileoverview Common methods for performance-plotting Javascript. 8 * @fileoverview Common methods for performance-plotting Javascript.
9 */ 9 */
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return result; 70 return result;
71 } 71 }
72 72
73 /** 73 /**
74 * Creates the URL constructed from the current pathname and the given params. 74 * Creates the URL constructed from the current pathname and the given params.
75 * 75 *
76 * @param {Object} An object containing parameters for a URL query string. 76 * @param {Object} An object containing parameters for a URL query string.
77 * @return {string} The URL constructed from the given params. 77 * @return {string} The URL constructed from the given params.
78 */ 78 */
79 function MakeURL(params) { 79 function MakeURL(params) {
80 var url = window.location.pathname; 80 var arr = [];
81 var sep = '?'; 81 for (var p in params) {
82 for (p in params) { 82 if (typeof params[p] == 'object') {
83 if (!p) 83 // Repeated params, stored as hash like {valueA: 1, valueB: 1}
84 continue; 84 for (var r in params[p]) {
85 url += sep + p + '=' + params[p]; 85 arr.push(p + '=' + r);
alias of yukishiino 2012/11/02 04:19:19 I'm not sure if it's necessary to check the value
alias of yukishiino 2012/11/02 04:19:19 You should call encodeURIComponent for each value.
86 sep = '&'; 86 }
87 } else {
88 arr.push(p + '=' + params[p]);
89 }
87 } 90 }
88 return url; 91 return window.location.pathname + '?' + arr.join('&');
89 } 92 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698