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

Unified Diff: chrome/browser/component_updater/component_updater_service.cc

Issue 8921006: Standardize StringToInt{,64} interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update formatting and convert HexStringToInt() calls. Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/component_updater_service.cc
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index 6e2d98d195fe1790910da9bacdc1611cfa981486..01836ff610a5f5dfbf468271d2988dd93b809823 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -15,6 +15,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
+#include "base/string_piece.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/timer.h"
@@ -74,7 +75,9 @@ static std::string HexStringToID(const std::string& hexstr) {
std::string id;
for (size_t i = 0; i < hexstr.size(); ++i) {
int val;
- if (base::HexStringToInt(hexstr.begin() + i, hexstr.begin() + i + 1, &val))
+ if (base::HexStringToInt(base::StringPiece(hexstr.begin() + i,
+ hexstr.begin() + i + 1),
+ &val))
erikwright (departed) 2011/12/14 04:24:08 need {} around if and else blocks when condition w
id.append(1, val + 'a');
else
id.append(1, 'a');

Powered by Google App Engine
This is Rietveld 408576698