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

Unified Diff: chrome/browser/page_state.cc

Issue 3149: Porting changes in chrome/{browser,common}, also enabling more unit tests.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/page_state.cc
===================================================================
--- chrome/browser/page_state.cc (revision 2402)
+++ chrome/browser/page_state.cc (working copy)
@@ -77,31 +77,25 @@
}
void PageState::SetInt64Property(const std::wstring& key, int64 value) {
- wchar_t buff[64];
- _i64tow_s(value, buff, arraysize(buff), 10);
- SetProperty(key, buff);
+ SetProperty(key, Int64ToWString(value));
}
bool PageState::GetInt64Property(const std::wstring& key, int64* value) const {
std::wstring v;
if (GetProperty(key, &v)) {
- *value = _wtoi64(v.c_str());
- return true;
+ return StringToInt64(v, value);
}
return false;
}
void PageState::SetIntProperty(const std::wstring& key, int value) {
- wchar_t buff[64];
- _itow_s(value, buff, arraysize(buff), 10);
- SetProperty(key, buff);
+ SetProperty(key, IntToWString(value));
}
bool PageState::GetIntProperty(const std::wstring& key, int* value) const {
std::wstring v;
if (GetProperty(key, &v)) {
- *value = _wtoi(v.c_str());
- return true;
+ return StringToInt(v, value);
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698