summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/base_session_service.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-01 22:37:12 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-01 22:37:12 +0000
commit7ec296b6669d76014ba369285bcfa6abda607faf (patch)
treebb2310f2f72ea6b397408ec9a79a11091105506f /chrome/browser/sessions/base_session_service.cc
parent0b9d3d2ff9872e2971eb0479bd16efe74ee3d44f (diff)
downloadchromium_src-7ec296b6669d76014ba369285bcfa6abda607faf.zip
chromium_src-7ec296b6669d76014ba369285bcfa6abda607faf.tar.gz
chromium_src-7ec296b6669d76014ba369285bcfa6abda607faf.tar.bz2
Fix a bug in session restore on linux/mac. We were pickling the
page title as a wstring, but reading it back as a string16. This allows the SessionRestoreUITests to pass. Also enable the inspector ui test which is currently disabled, but the code compiles fine on linux/mac. BUG=10516 Review URL: http://codereview.chromium.org/99297 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/base_session_service.cc')
-rw-r--r--chrome/browser/sessions/base_session_service.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc
index 37be66d..694742f 100644
--- a/chrome/browser/sessions/base_session_service.cc
+++ b/chrome/browser/sessions/base_session_service.cc
@@ -38,15 +38,15 @@ void WriteStringToPickle(Pickle& pickle, int* bytes_written, int max_bytes,
}
}
-// Wide version of WriteStringToPickle.
-void WriteWStringToPickle(Pickle& pickle, int* bytes_written, int max_bytes,
- const std::wstring& str) {
- int num_bytes = str.size() * sizeof(wchar_t);
+// string16 version of WriteStringToPickle.
+void WriteString16ToPickle(Pickle& pickle, int* bytes_written, int max_bytes,
+ const string16& str) {
+ int num_bytes = str.size() * sizeof(char16);
if (*bytes_written + num_bytes < max_bytes) {
*bytes_written += num_bytes;
- pickle.WriteWString(str);
+ pickle.WriteString16(str);
} else {
- pickle.WriteWString(std::wstring());
+ pickle.WriteString16(string16());
}
}
@@ -158,8 +158,7 @@ SessionCommand* BaseSessionService::CreateUpdateTabNavigationCommand(
WriteStringToPickle(pickle, &bytes_written, max_state_size,
entry.display_url().spec());
- WriteWStringToPickle(pickle, &bytes_written, max_state_size,
- UTF16ToWideHack(entry.title()));
+ WriteString16ToPickle(pickle, &bytes_written, max_state_size, entry.title());
if (entry.has_post_data()) {
// Remove the form data, it may contain sensitive information.