diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 22:37:12 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 22:37:12 +0000 |
commit | 7ec296b6669d76014ba369285bcfa6abda607faf (patch) | |
tree | bb2310f2f72ea6b397408ec9a79a11091105506f /chrome | |
parent | 0b9d3d2ff9872e2971eb0479bd16efe74ee3d44f (diff) | |
download | chromium_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')
-rw-r--r-- | chrome/browser/sessions/base_session_service.cc | 15 | ||||
-rw-r--r-- | chrome/browser/sessions/session_service.cc | 6 | ||||
-rw-r--r-- | chrome/chrome.gyp | 4 |
3 files changed, 7 insertions, 18 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. diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index c0b8158..9e13654 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -28,12 +28,6 @@ #include "chrome/common/notification_service.h" #include "chrome/common/scoped_vector.h" -// TODO(port): Get rid of this section and finish porting. -#if defined(OS_WIN) -#include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/common/win_util.h" -#endif - using base::Time; // Identifier for commands written to file. diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 4a91257..18bd705 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -2205,7 +2205,6 @@ 'browser/crash_recovery_uitest.cc', 'browser/login_prompt_uitest.cc', 'browser/metrics/metrics_service_uitest.cc', - 'browser/sessions/session_restore_uitest.cc', 'test/reliability/page_load_test.cc', 'test/ui/layout_plugin_uitest.cc', 'test/ui/omnibox_uitest.cc', @@ -2257,7 +2256,6 @@ 'test/accessibility/registry_util.cc', 'test/accessibility/tab_impl.cc', 'test/perf/mem_usage.cc', - 'test/ui/inspector_controller_uitest.cc', 'test/ui/npapi_uitest.cc', 'test/ui/sandbox_uitests.cc', ], @@ -2506,7 +2504,6 @@ 'browser/gtk/go_button_gtk_unittest.cc', 'browser/gtk/tabs/tab_renderer_gtk_unittest.cc', 'browser/navigation_controller_unittest.cc', - 'browser/sessions/session_service_test_helper.cc', 'renderer/render_view_unittest.cc', 'test/test_notification_tracker.cc', 'test/test_notification_tracker.h', @@ -2550,7 +2547,6 @@ 'browser/printing/page_overlays_unittest.cc', 'browser/printing/print_job_unittest.cc', 'browser/rlz/rlz_unittest.cc', - 'browser/sessions/session_service_unittest.cc', 'browser/tabs/tab_strip_model_unittest.cc', 'browser/task_manager_unittest.cc', 'browser/views/bookmark_editor_view_unittest.cc', |