diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 18:33:57 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 18:33:57 +0000 |
commit | 252cad6dec04039d456e716273153951d0090b5f (patch) | |
tree | 68437c27571fe3e88317f1f2848573fe647fdbb5 /chrome/browser | |
parent | 371390a71a7e4530b39e46f1f52c5a6d5a3acd43 (diff) | |
download | chromium_src-252cad6dec04039d456e716273153951d0090b5f.zip chromium_src-252cad6dec04039d456e716273153951d0090b5f.tar.gz chromium_src-252cad6dec04039d456e716273153951d0090b5f.tar.bz2 |
Remove all wstrings from the IPC logging subsystem.
Changes all IPC Log methods from wstring to string. All static logging debug
data changed from wchar[] to char[].
Various string conversion/numeric headers no longer need to be included in
ipc_message_utils.h and have been removed (and added in all implementation
files that require them).
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3159013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56563 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
18 files changed, 70 insertions, 50 deletions
diff --git a/chrome/browser/automation/automation_provider_gtk.cc b/chrome/browser/automation/automation_provider_gtk.cc index 8b391ee..06abc4f 100644 --- a/chrome/browser/automation/automation_provider_gtk.cc +++ b/chrome/browser/automation/automation_provider_gtk.cc @@ -6,6 +6,7 @@ #include <gtk/gtk.h> +#include "base/utf_string_conversions.h" #include "chrome/browser/automation/ui_controls.h" #include "chrome/browser/automation/automation_browser_tracker.h" #include "chrome/browser/automation/automation_window_tracker.h" diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 0bb238b..9a227cd 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -7,6 +7,7 @@ #include "base/json/json_reader.h" #include "base/keyboard_codes.h" #include "base/trace_event.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/automation/automation_browser_tracker.h" #include "chrome/browser/automation/automation_extension_function.h" #include "chrome/browser/automation/automation_tab_tracker.h" diff --git a/chrome/browser/cocoa/about_ipc_controller.mm b/chrome/browser/cocoa/about_ipc_controller.mm index 32a9933..ccccf8b 100644 --- a/chrome/browser/cocoa/about_ipc_controller.mm +++ b/chrome/browser/cocoa/about_ipc_controller.mm @@ -38,19 +38,19 @@ } - (NSString*)message { - if (data_.message_name == L"") { + if (data_.message_name == "") { int high = data_.type >> 12; int low = data_.type - (high<<12); return [NSString stringWithFormat:@"type=(%d,%d) 0x%x,0x%x", high, low, high, low]; } else { - return base::SysWideToNSString(data_.message_name); + return base::SysUTF8ToNSString(data_.message_name); } } - (NSString*)flags { - return base::SysWideToNSString(data_.flags); + return base::SysUTF8ToNSString(data_.flags); } - (NSString*)dispatch { @@ -68,7 +68,7 @@ } - (NSString*)parameters { - return base::SysWideToNSString(data_.params); + return base::SysUTF8ToNSString(data_.params); } @end diff --git a/chrome/browser/cocoa/about_ipc_controller_unittest.mm b/chrome/browser/cocoa/about_ipc_controller_unittest.mm index efe1a56..b36100a 100644 --- a/chrome/browser/cocoa/about_ipc_controller_unittest.mm +++ b/chrome/browser/cocoa/about_ipc_controller_unittest.mm @@ -24,9 +24,9 @@ TEST_F(AboutIPCControllerTest, TestFilter) { IPC::LogData data; // Make sure generic names do NOT get filtered. - std::wstring names[] = { L"PluginProcessingIsMyLife", - L"ViewMsgFoo", - L"NPObjectHell" }; + std::string names[] = { "PluginProcessingIsMyLife", + "ViewMsgFoo", + "NPObjectHell" }; for (size_t i = 0; i < arraysize(names); i++) { data.message_name = names[i]; scoped_nsobject<CocoaLogData> cdata([[CocoaLogData alloc] @@ -35,7 +35,7 @@ TEST_F(AboutIPCControllerTest, TestFilter) { } // Flip a checkbox, see it filtered, flip back, all is fine. - data.message_name = L"ViewMsgFoo"; + data.message_name = "ViewMsgFoo"; scoped_nsobject<CocoaLogData> cdata([[CocoaLogData alloc] initWithLogData:data]); [controller setDisplayViewMessages:NO]; diff --git a/chrome/browser/debugger/debugger_remote_service.cc b/chrome/browser/debugger/debugger_remote_service.cc index d66896b..ba77fb9 100644 --- a/chrome/browser/debugger/debugger_remote_service.cc +++ b/chrome/browser/debugger/debugger_remote_service.cc @@ -10,6 +10,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/debugger/devtools_manager.h" diff --git a/chrome/browser/debugger/devtools_http_protocol_handler.cc b/chrome/browser/debugger/devtools_http_protocol_handler.cc index 6efa6b7..817c3d7 100644 --- a/chrome/browser/debugger/devtools_http_protocol_handler.cc +++ b/chrome/browser/debugger/devtools_http_protocol_handler.cc @@ -9,6 +9,7 @@ #include "base/message_loop_proxy.h" #include "base/string_number_conversions.h" #include "base/thread.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/chrome_thread.h" diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index a2334e7..d0d4e80 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -5,6 +5,7 @@ #include "base/command_line.h" #include "base/json/json_writer.h" #include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index f1e648e..c89b1ae 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -3,7 +3,9 @@ // found in the LICENSE file. #include "base/compiler_specific.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/app_modal_dialog.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc index e16a0f6..52689e486 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.cc +++ b/chrome/browser/geolocation/geolocation_permission_context.cc @@ -6,6 +6,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/extensions/extensions_service.h" diff --git a/chrome/browser/importer/importer_bridge.cc b/chrome/browser/importer/importer_bridge.cc index 9034305..5ab94da 100644 --- a/chrome/browser/importer/importer_bridge.cc +++ b/chrome/browser/importer/importer_bridge.cc @@ -6,6 +6,7 @@ #include "app/l10n_util.h" #include "base/scoped_ptr.h" +#include "base/string_number_conversions.h" #include "base/string16.h" #include "base/utf_string_conversions.h" #include "base/values.h" diff --git a/chrome/browser/importer/importer_messages.h b/chrome/browser/importer/importer_messages.h index ca52e85..fd7b1dc 100644 --- a/chrome/browser/importer/importer_messages.h +++ b/chrome/browser/importer/importer_messages.h @@ -50,18 +50,18 @@ struct ParamTraits<importer::ProfileInfo> { return true; } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); + static void Log(const param_type& p, std::string* l) { + l->append("("); LogParam(p.description, l); - l->append(L", "); + l->append(", "); LogParam(static_cast<int>(p.browser_type), l); - l->append(L", "); + l->append(", "); LogParam(p.source_path, l); - l->append(L", "); + l->append(", "); LogParam(p.app_path, l); - l->append(L", "); + l->append(", "); LogParam(static_cast<int>(p.services_supported), l); - l->append(L")"); + l->append(")"); } }; // ParamTraits<importer::ProfileInfo> @@ -105,24 +105,24 @@ struct ParamTraits<history::URLRow> { p->set_favicon_id(favicon_id); return true; } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); + static void Log(const param_type& p, std::string* l) { + l->append("("); LogParam(p.id(), l); - l->append(L", "); + l->append(", "); LogParam(p.url(), l); - l->append(L", "); + l->append(", "); LogParam(p.title(), l); - l->append(L", "); + l->append(", "); LogParam(p.visit_count(), l); - l->append(L", "); + l->append(", "); LogParam(p.typed_count(), l); - l->append(L", "); + l->append(", "); LogParam(p.last_visit(), l); - l->append(L", "); + l->append(", "); LogParam(p.hidden(), l); - l->append(L", "); + l->append(", "); LogParam(p.favicon_id(), l); - l->append(L")"); + l->append(")"); } }; // ParamTraits<history::URLRow> @@ -145,18 +145,18 @@ struct ParamTraits<ProfileWriter::BookmarkEntry> { (ReadParam(m, iter, &p->title)) && (ReadParam(m, iter, &p->creation_time)); } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); + static void Log(const param_type& p, std::string* l) { + l->append("("); LogParam(p.in_toolbar, l); - l->append(L", "); + l->append(", "); LogParam(p.url, l); - l->append(L", "); + l->append(", "); LogParam(p.path, l); - l->append(L", "); + l->append(", "); LogParam(p.title, l); - l->append(L", "); + l->append(", "); LogParam(p.creation_time, l); - l->append(L")"); + l->append(")"); } }; // ParamTraits<ProfileWriter::BookmarkEntry> @@ -175,14 +175,14 @@ struct ParamTraits<history::ImportedFavIconUsage> { ReadParam(m, iter, &p->png_data) && ReadParam(m, iter, &p->urls); } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); + static void Log(const param_type& p, std::string* l) { + l->append("("); LogParam(p.favicon_url, l); - l->append(L", "); + l->append(", "); LogParam(p.png_data, l); - l->append(L", "); + l->append(", "); LogParam(p.urls, l); - l->append(L")"); + l->append(")"); } }; // ParamTraits<history::ImportedFavIconUsage @@ -206,8 +206,8 @@ struct ParamTraits<TemplateURLRef> { *p = TemplateURLRef(url, index_offset, page_offset); return true; } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<TemplateURLRef>"); + static void Log(const param_type& p, std::string* l) { + l->append("<TemplateURLRef>"); } }; @@ -234,8 +234,8 @@ struct ParamTraits<TemplateURL::ImageRef> { *p = TemplateURL::ImageRef(type, width, height, url); // here in return true; } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<TemplateURL::ImageRef>"); + static void Log(const param_type& p, std::string* l) { + l->append("<TemplateURL::ImageRef>"); } }; @@ -356,8 +356,8 @@ struct ParamTraits<TemplateURL> { p->set_prepopulate_id(prepopulate_id); return true; } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<TemplateURL>"); + static void Log(const param_type& p, std::string* l) { + l->append("<TemplateURL>"); } }; diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index 1daecfb..a3bd281 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -6,6 +6,7 @@ #include "app/l10n_util.h" #include "base/scoped_ptr.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_job.h" #include "chrome/browser/printing/print_job_manager.h" diff --git a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc index e83345b..7fd40ec 100644 --- a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc +++ b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc @@ -14,6 +14,7 @@ #include "base/logging.h" #include "base/string_util.h" #include "base/third_party/icu/icu_utf.h" +#include "base/utf_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/gtk/gtk_util.h" #if !defined(TOOLKIT_VIEWS) diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 5b9de43..2b4b6d5 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -27,6 +27,7 @@ #include "base/string_number_conversions.h" #include "base/task.h" #include "base/time.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/gtk/gtk_util.h" #include "chrome/browser/renderer_host/backing_store_x.h" #include "chrome/browser/renderer_host/gpu_view_host.h" diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc index cbced31..0d64385 100644 --- a/chrome/browser/sync/sync_setup_wizard_unittest.cc +++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc @@ -7,6 +7,7 @@ #include "base/json/json_writer.h" #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/google_service_auth_error.h" diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 1b2f117..1d63c3b 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/string_util.h" #include "base/time.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser_about_handler.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_url_handler.h" diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 88afe90..6ce87f1 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -9,7 +9,9 @@ #include "base/scoped_ptr.h" #include "base/string_util.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/defaults.h" #include "chrome/browser/dom_ui/new_tab_ui.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/views/about_ipc_dialog.cc b/chrome/browser/views/about_ipc_dialog.cc index 9b83e7d..a23b122 100644 --- a/chrome/browser/views/about_ipc_dialog.cc +++ b/chrome/browser/views/about_ipc_dialog.cc @@ -100,13 +100,14 @@ void CreateColumn(uint32 start, uint32 end, HWND hwnd, control_ptr->InsertColumn(0, L"id", LVCFMT_LEFT, 230); for (uint32 i = start; i < end; i++) { - std::wstring name; + std::string name; IPC::Logging::GetMessageText(i, &name, NULL, NULL); + std::wstring wname = UTF8ToWide(name); int index = control_ptr->InsertItem( - LVIF_TEXT | LVIF_PARAM, 0, name.c_str(), 0, 0, 0, i); + LVIF_TEXT | LVIF_PARAM, 0, wname.c_str(), 0, 0, 0, i); - control_ptr->SetItemText(index, 0, name.c_str()); + control_ptr->SetItemText(index, 0, wname.c_str()); if (disabled_messages.find(i) == disabled_messages.end()) control_ptr->SetCheckState(index, TRUE); @@ -406,10 +407,12 @@ void AboutIPCDialog::Log(const IPC::LogData& data) { message_list_.SetItemText(index, kChannelColumn, ASCIIToWide(data.channel).c_str()); - std::wstring message_name; + std::string message_name; IPC::Logging::GetMessageText(data.type, &message_name, NULL, NULL); - message_list_.SetItemText(index, kMessageColumn, message_name.c_str()); - message_list_.SetItemText(index, kFlagsColumn, data.flags.c_str()); + message_list_.SetItemText(index, kMessageColumn, + UTF8ToWide(message_name).c_str()); + message_list_.SetItemText(index, kFlagsColumn, + UTF8ToWide(data.flags).c_str()); int64 time_to_send = (base::Time::FromInternalValue(data.receive) - sent).InMilliseconds(); @@ -424,7 +427,8 @@ void AboutIPCDialog::Log(const IPC::LogData& data) { temp = StringPrintf(L"%d", time_to_process); message_list_.SetItemText(index, kProcessColumn, temp.c_str()); - message_list_.SetItemText(index, kParamsColumn, data.params.c_str()); + message_list_.SetItemText(index, kParamsColumn, + UTF8ToWide(data.params).c_str()); message_list_.EnsureVisible(index, FALSE); } |