summaryrefslogtreecommitdiffstats
path: root/base/version.cc
Commit message (Collapse)AuthorAgeFilesLines
* Write new Starts/EndsWith and convert FilePath functions to StringPiece.brettw2015-06-161-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | When I moved StartsWith and EndsWith to the base namespace it became apparent that the bool parameter was frequently a source of confusion, and that the second argument is almost always a constant that we then convert to a string. This adds new versions of StartsWith/EndsWith that takes an enum for case sensitivity and string pieces for the string inputs. The existing functions used a locale-dependent case insensitive comparison that is marked with an old bug number that such comparisons are probably wrong. With this change, I moved the case insensitive comparisons to ASCII ones. Only callers in base are updated. The rest of the calls go through a compatibility layer. The compatibility layer keeps the local-dependent compares for the 16-bit string comparisons to avoid breaking things subtly. There are relatively few calls to the 16-bit version, and most use constants for the prefix/suffix (which wouldn't be affected by the locale), so there should be few callers to audit in a later pass to go to pure ASCII comparisons. The 8-bit versions now always use the ASCII case-insensitive comparisons. This should be the only change in this patch that can affect the behavior of the program. Code doing locale-dependent 8-bit tolower() calls (what the old code ended up doing) is almost certainly wrong. UTF-8 strings will be mangled. The only 8-bit non-UTF-8 strings we have are typically Posix file paths and Posix file paths are case-sensitive. I'm not very concerned about regressions from this change. Use StringPiece in FilePath for input arguments. This wasn't done before because we had no StringPiece16 until more recently. Constants are frequently passed as input to some of the functions, especially Append, so this will save some string allocations. Unfortunately, this is more likely to affect unit tests that the real browser. This is combined with the StartsWith/EndsWith changes because I started changing FilePath when updating its use of StartsWith. The FilePath changes should have no observable effect on the product. BUG=24917 Review URL: https://codereview.chromium.org/1182453004 Cr-Commit-Position: refs/heads/master@{#334555}
* Support 32-bit subversion fields in base::Version.wfh2015-03-101-16/+12
| | | | | | | | | BUG=464610 TEST=base_unittests Review URL: https://codereview.chromium.org/985573003 Cr-Commit-Position: refs/heads/master@{#319806}
* Support plugin version mid-portions with leading zeros.wfh2015-02-221-2/+4
| | | | | | | | | | | Now supported: 1.02.3.4 Remains unsupported: 01.2.3.4 BUG=460642 Review URL: https://codereview.chromium.org/949573002 Cr-Commit-Position: refs/heads/master@{#317524}
* test IWYU fixups for basemostynb@opera.com2013-09-031-0/+2
| | | | | | | | | | | | | These are some of the suggestions from running include-what-you-use[1] on the base target. [1] https://code.google.com/p/include-what-you-use/ BUG=259043 Review URL: https://chromiumcodereview.appspot.com/23540009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221067 0039d316-1c4b-4281-b951-d872f2087c98
* Small comment correction.waffles@chromium.org2013-06-211-2/+2
| | | | | | | | | | Fixes a comment in version.cc. BUG= Review URL: https://chromiumcodereview.appspot.com/17351015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207706 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers in base/.avi@chromium.org2013-06-101-1/+1
| | | | | | | | | | BUG=247723 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/16320009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205284 0039d316-1c4b-4281-b951-d872f2087c98
* Move Version to base namespace.xhwang@chromium.org2013-04-221-5/+9
| | | | | | | | | | Adds "using base::Version" to the header to avoid having to update everything at once. All forward declares and the locations where the forward declares are used are updated. Review URL: https://chromiumcodereview.appspot.com/14099010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195456 0039d316-1c4b-4281-b951-d872f2087c98
* Move string_split to base/strings.tfarina@chromium.org2013-02-071-1/+1
| | | | | | | | | R=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/12218059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181380 0039d316-1c4b-4281-b951-d872f2087c98
* Move string_number_conversions to base/strings.brettw@chromium.org2013-02-071-1/+1
| | | | | | | | | | This only updates includes in base and keeps a forwarding header for now to keep the change under control. BUG= Review URL: https://codereview.chromium.org/12092078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181161 0039d316-1c4b-4281-b951-d872f2087c98
* Remove two deprecated methods from base::Versionisherman@chromium.org2012-07-111-16/+0
| | | | | | | | | | BUG=none TEST=none TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/10683005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146157 0039d316-1c4b-4281-b951-d872f2087c98
* Supporting wildcards in max/min version specifications in VariationsService.mathp@google.com2012-07-041-35/+114
| | | | | | | | | | | | | | | | Adds a method CompareToWildcardString that will return -1/0/1, similar to CompareTo, when a version is smaller, equal to or greater than a wildcard string such as "1.2.*". Added a method IsValidWildcardString that validates the format of a wildcard string, and slightly refactored the Version class to avoid code duplication. For example, CompareToWildcardString and CompareTo share the new method CompareVersionComponents. BUG=127077 TEST=See tests for VariationsService, Version Review URL: https://chromiumcodereview.appspot.com/10576003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145468 0039d316-1c4b-4281-b951-d872f2087c98
* Add a convenience function to Versioncpu@chromium.org2011-08-011-0/+7
| | | | | | | | | | Came up as in item in a component updater review. It is a common pattern used in extension updater and component updater. TEST=included BUG=none Review URL: http://codereview.chromium.org/7541015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94928 0039d316-1c4b-4281-b951-d872f2087c98
* Clang needs dtor in the cc file (build fix)cpu@chromium.org2011-06-071-1/+4
| | | | | | | | | | BUG=none TEST=one TBR=shess Review URL: http://codereview.chromium.org/7131008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88145 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up base/Versioncpu@chromium.org2011-06-071-44/+41
| | | | | | | | | | | | | | | | | It turns out base/Version is really a value object but probably because of some serious accident or by the machinations of a super villain, forgot his identity and now it thinks is a reference object, only creatable in the heap and that could only spawn offsprings via cloning. But fear not 'cause I've seen Version true nature; At its core is just a good 'ol vector<uint16>, which has very respectable value semantics. Also I have removed the is_valid_ parasite as much as I could. The old interface (GetVersionFromString and Clone) is kept so existing callers would not need to be modified. BUG=none TEST=included Review URL: http://codereview.chromium.org/7105008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88143 0039d316-1c4b-4281-b951-d872f2087c98
* Make the order of methods in the cc files match the headers in base/.erg@google.com2011-01-071-4/+4
| | | | | | | | | BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6189001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70771 0039d316-1c4b-4281-b951-d872f2087c98
* base/version: remove wstring versionevan@chromium.org2010-12-231-7/+0
| | | | | | | | | | | And fix callers. BUG=23581 TEST=trybots Review URL: http://codereview.chromium.org/5848005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70098 0039d316-1c4b-4281-b951-d872f2087c98
* Bugfixes for recent PluginGroup refactoring.jkummerow@chromium.org2010-12-211-0/+10
| | | | | | | | | BUG=66505 TEST=test_shell_tests: PluginGroupTest.*; manual: check that issues reported and screenshotted in bug 66505 no longer occur Review URL: http://codereview.chromium.org/5918003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69813 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 69490 - base/version: remove wstring versionsanjeevr@chromium.org2010-12-171-0/+7
| | | | | | | | | | | | | | And fix callers. BUG=23581 TEST=trybots Review URL: http://codereview.chromium.org/5848005 TBR=evan@chromium.org Review URL: http://codereview.chromium.org/5905006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69491 0039d316-1c4b-4281-b951-d872f2087c98
* base/version: remove wstring versionevan@chromium.org2010-12-171-7/+0
| | | | | | | | | | | And fix callers. BUG=23581 TEST=trybots Review URL: http://codereview.chromium.org/5848005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69490 0039d316-1c4b-4281-b951-d872f2087c98
* Include the Version class in the 64 bit version of base. This is needed so ↵robertshield@chromium.org2010-11-101-2/+2
| | | | | | | | | | | | that it can be used from client_utils.cc which is included in both the chrome target and the chrome_nacl_win64 target. BUG=61609 TEST=None Review URL: http://codereview.chromium.org/4676002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65674 0039d316-1c4b-4281-b951-d872f2087c98
* base: Move SplitString functions into the base namespace and update the callers.tfarina@chromium.org2010-10-141-1/+1
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3750001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62483 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Continue fixing nits found by my automated source scanner.erg@google.com2010-10-051-0/+2
| | | | | | | | | | | (~1.3 megs off Debug linux .a files) BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3556013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61587 0039d316-1c4b-4281-b951-d872f2087c98
* base: Finish moving the SplitString functions from string_util.h to ↵tfarina@chromium.org2010-09-241-1/+2
| | | | | | | | | | | string_split.h BUG=None TEST=trybos Review URL: http://codereview.chromium.org/3447008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60422 0039d316-1c4b-4281-b951-d872f2087c98
* Move the number conversions from string_util to a new file.brettw@chromium.org2010-07-301-5/+7
| | | | | | | | | | | | | Use the base namespace in the new file. Update callers. I removed all wstring variants and also the string->number ones that ignore the return value. That encourages people to write code and forget about error handling. TEST=included unit tests BUG=none Review URL: http://codereview.chromium.org/3056029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54355 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed bug where an empty version string is considered valid.akalin@chromium.org2010-03-251-11/+23
| | | | | | | | | | | | Made default constructor public, but DCHECK() on any use of a default-constructed object. BUG=none TEST=unittests Review URL: http://codereview.chromium.org/1364002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42681 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-1/+1
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Add a Version class and matching unit tests, roughly based on ↵erikkay@google.com2009-01-291-0/+83
chrome/installer/util/version.*. This version has more flexible parsing rules and is more robust to detecting bogus versions, supporting arbitrary numbers of version components rather than just dotted quads. It's possible that we should switch chrome installer to use this version. Review URL: http://codereview.chromium.org/19667 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8901 0039d316-1c4b-4281-b951-d872f2087c98