diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-21 23:49:05 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-21 23:49:05 +0000 |
commit | 35d849dc495e21eaceb75badc6541c1d30bffb79 (patch) | |
tree | 415936b6c7366b79eb17736682a94d610fd45504 /chrome | |
parent | 027fc03bee0791e0895a80cd528cd19b16d3d415 (diff) | |
download | chromium_src-35d849dc495e21eaceb75badc6541c1d30bffb79.zip chromium_src-35d849dc495e21eaceb75badc6541c1d30bffb79.tar.gz chromium_src-35d849dc495e21eaceb75badc6541c1d30bffb79.tar.bz2 |
[Sync] Fix VLOG of session titles
BUG=99657
TEST=syncing sessions with non-ascii titles doesn't dcheck
Review URL: http://codereview.chromium.org/8365005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/sync/glue/synced_session_tracker.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/chrome/browser/sync/glue/synced_session_tracker.cc b/chrome/browser/sync/glue/synced_session_tracker.cc index 07296b3..9f0e8df 100644 --- a/chrome/browser/sync/glue/synced_session_tracker.cc +++ b/chrome/browser/sync/glue/synced_session_tracker.cc @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/string_util.h" +#include "base/logging.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/sync/glue/synced_session_tracker.h" namespace browser_sync { @@ -165,9 +166,9 @@ bool SyncedSessionTracker::DeleteOldSessionTabIfNecessary( if (!tab_wrapper.owned) { if (VLOG_IS_ON(1)) { SessionTab* tab_ptr = tab_wrapper.tab_ptr; - std::string title = ""; + std::string title; if (tab_ptr->navigations.size() > 0) { - title = " (" + UTF16ToASCII( + title = " (" + UTF16ToUTF8( tab_ptr->navigations[tab_ptr->navigations.size()-1].title()) + ")"; } VLOG(1) << "Deleting closed tab " << tab_ptr->tab_id.id() << title @@ -262,15 +263,17 @@ SessionTab* SyncedSessionTracker::GetTab( synced_tab_map_[session_tag].find(tab_id); if (iter != synced_tab_map_[session_tag].end()) { tab_ptr = iter->second.tab_ptr; - std::string title = ""; - if (tab_ptr->navigations.size() > 0) { - title = " (" + UTF16ToASCII( - tab_ptr->navigations[tab_ptr->navigations.size()-1].title()) + ")"; + if (VLOG_IS_ON(1)) { + std::string title; + if (tab_ptr->navigations.size() > 0) { + title = " (" + UTF16ToUTF8( + tab_ptr->navigations[tab_ptr->navigations.size()-1].title()) + ")"; + } + VLOG(1) << "Getting " + << (session_tag == local_session_tag_ ? + "local session" : session_tag) + << "'s seen tab " << tab_id << " at " << tab_ptr << title; } - VLOG(1) << "Getting " - << (session_tag == local_session_tag_ ? - "local session" : session_tag) - << "'s seen tab " << tab_id << " at " << tab_ptr << title; } else { tab_ptr = new SessionTab(); tab_ptr->tab_id.set_id(tab_id); |