Use base::StringToInt() instead of std::stringstream

This commit is contained in:
Tan Wang Leng 2017-02-04 09:42:52 +08:00 committed by Kevin Sawicki
parent 42f65c52fb
commit 7ec88d16a6

View file

@ -5,7 +5,6 @@
#include "atom/browser/web_contents_preferences.h" #include "atom/browser/web_contents_preferences.h"
#include <algorithm> #include <algorithm>
#include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -225,11 +224,10 @@ bool WebContentsPreferences::ConvertValueToIntegerFromString(
return true; return true;
} }
std::string stringValue; base::string16 stringValue;
if (pref->web_preferences_.GetString(attributeName, &stringValue)) { if (pref->web_preferences_.GetString(attributeName, &stringValue)) {
std::stringstream(stringValue) >> *intValue; return base::StringToInt(stringValue, intValue);
return true;
} }
return false; return false;