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

Unified Diff: sync/util/get_session_name.cc

Issue 479703004: Ensure syncer::internal::GetComputerName returns a UTF-8 string. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the returned size instead of wcslen(). Created 6 years, 4 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: sync/util/get_session_name.cc
diff --git a/sync/util/get_session_name.cc b/sync/util/get_session_name.cc
index 3a09c51379d393d168fa0fe1d91bb253b81ed1ca..c669e227727cca63e6c661d58640cbec48208871 100644
--- a/sync/util/get_session_name.cc
+++ b/sync/util/get_session_name.cc
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/location.h"
+#include "base/strings/string_util.h"
#include "base/sys_info.h"
#include "base/task_runner.h"
@@ -53,6 +54,7 @@ std::string GetSessionNameSynchronously() {
if (session_name == "Unknown" || session_name.empty())
session_name = base::SysInfo::OperatingSystemName();
+ DCHECK(base::IsStringUTF8(session_name));
return session_name;
}

Powered by Google App Engine
This is Rietveld 408576698