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

Side by Side Diff: net/cookies/parsed_cookie.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | « net/cookies/cookie_store_unittest.h ('k') | net/cookies/parsed_cookie_unittest.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 // Portions of this code based on Mozilla: 5 // Portions of this code based on Mozilla:
6 // (netwerk/cookie/src/nsCookieService.cpp) 6 // (netwerk/cookie/src/nsCookieService.cpp)
7 /* ***** BEGIN LICENSE BLOCK ***** 7 /* ***** BEGIN LICENSE BLOCK *****
8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
9 * 9 *
10 * The contents of this file are subject to the Mozilla Public License Version 10 * The contents of this file are subject to the Mozilla Public License Version
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 417 }
418 } 418 }
419 419
420 bool ParsedCookie::SetBool(size_t* index, 420 bool ParsedCookie::SetBool(size_t* index,
421 const std::string& key, 421 const std::string& key,
422 bool value) { 422 bool value) {
423 if (!value) { 423 if (!value) {
424 ClearAttributePair(*index); 424 ClearAttributePair(*index);
425 return true; 425 return true;
426 } else { 426 } else {
427 return SetAttributePair(index, key, ""); 427 return SetAttributePair(index, key, std::string());
428 } 428 }
429 } 429 }
430 430
431 bool ParsedCookie::SetAttributePair(size_t* index, 431 bool ParsedCookie::SetAttributePair(size_t* index,
432 const std::string& key, 432 const std::string& key,
433 const std::string& value) { 433 const std::string& value) {
434 if (!IsValidToken(key) || !IsValidCookieAttributeValue(value)) 434 if (!IsValidToken(key) || !IsValidCookieAttributeValue(value))
435 return false; 435 return false;
436 if (!IsValid()) 436 if (!IsValid())
437 return false; 437 return false;
(...skipping 18 matching lines...) Expand all
456 for (size_t i = 0; i < arraysize(indexes); ++i) { 456 for (size_t i = 0; i < arraysize(indexes); ++i) {
457 if (*indexes[i] == index) 457 if (*indexes[i] == index)
458 *indexes[i] = 0; 458 *indexes[i] = 0;
459 else if (*indexes[i] > index) 459 else if (*indexes[i] > index)
460 --*indexes[i]; 460 --*indexes[i];
461 } 461 }
462 pairs_.erase(pairs_.begin() + index); 462 pairs_.erase(pairs_.begin() + index);
463 } 463 }
464 464
465 } // namespace 465 } // namespace
OLDNEW
« no previous file with comments | « net/cookies/cookie_store_unittest.h ('k') | net/cookies/parsed_cookie_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698