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

Side by Side Diff: chrome/browser/net/url_info.cc

Issue 6676015: Coverity: Pass values by reference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win/Mac fix. Created 9 years, 9 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/net/url_info.h ('k') | chrome/browser/password_manager/password_store.h » ('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) 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 #include "chrome/browser/net/url_info.h" 5 #include "chrome/browser/net/url_info.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 int print_hours = minutes/60; 252 int print_hours = minutes/60;
253 if (print_hours) 253 if (print_hours)
254 base::StringAppendF(&result, "%.2d:", print_hours); 254 base::StringAppendF(&result, "%.2d:", print_hours);
255 if (print_hours || print_minutes) 255 if (print_hours || print_minutes)
256 base::StringAppendF(&result, "%2.2d:", print_minutes); 256 base::StringAppendF(&result, "%2.2d:", print_minutes);
257 base::StringAppendF(&result, "%2.2d", print_seconds); 257 base::StringAppendF(&result, "%2.2d", print_seconds);
258 return result; 258 return result;
259 } 259 }
260 260
261 // static 261 // static
262 void UrlInfo::GetHtmlTable(const UrlInfoTable host_infos, 262 void UrlInfo::GetHtmlTable(const UrlInfoTable& host_infos,
263 const char* description, 263 const char* description,
264 const bool brief, 264 bool brief,
265 std::string* output) { 265 std::string* output) {
266 if (0 == host_infos.size()) 266 if (0 == host_infos.size())
267 return; 267 return;
268 output->append(description); 268 output->append(description);
269 base::StringAppendF(output, "%" PRIuS " %s", host_infos.size(), 269 base::StringAppendF(output, "%" PRIuS " %s", host_infos.size(),
270 (1 == host_infos.size()) ? "hostname" : "hostnames"); 270 (1 == host_infos.size()) ? "hostname" : "hostnames");
271 271
272 if (brief) { 272 if (brief) {
273 output->append("<br><br>"); 273 output->append("<br><br>");
274 return; 274 return;
275 } 275 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 case LEARNED_REFERAL_MOTIVATED: 340 case LEARNED_REFERAL_MOTIVATED:
341 return RemoveJs(referring_url_.spec()); 341 return RemoveJs(referring_url_.spec());
342 342
343 default: 343 default:
344 return ""; 344 return "";
345 } 345 }
346 } 346 }
347 347
348 } // namespace chrome_browser_net 348 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/url_info.h ('k') | chrome/browser/password_manager/password_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698