diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 08:58:19 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 08:58:19 +0000 |
commit | 7d5c3acd124fae8816416374f629752138ec08e1 (patch) | |
tree | e7c0eb48729c056ed4bbafbd3816fafd269a8f15 /chrome/browser | |
parent | 13a9e86809ec0b88304afe5d2126d24b6750a327 (diff) | |
download | chromium_src-7d5c3acd124fae8816416374f629752138ec08e1.zip chromium_src-7d5c3acd124fae8816416374f629752138ec08e1.tar.gz chromium_src-7d5c3acd124fae8816416374f629752138ec08e1.tar.bz2 |
Revert my change to get the tree green. Not sure why the tests became flaky. I'll try to check them in again but in smaller chunks tomorrow.
TBR=mpcomplete
Review URL: http://codereview.chromium.org/21039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
23 files changed, 88 insertions, 73 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index f3154a4..a613f78 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1071,9 +1071,7 @@ void AutomationProvider::GetRedirectsFrom(const IPC::Message& message, IPC::Message* msg = new IPC::Message( message.routing_id(), AutomationMsg_RedirectsFromResponse::ID, IPC::Message::PRIORITY_NORMAL); - msg->WriteBool(false); - std::vector<GURL> empty; - ParamTraits<std::vector<GURL>>::Write(msg, empty); + msg->WriteInt(-1); // Negative string count indicates an error. Send(msg); } @@ -1556,17 +1554,14 @@ void AutomationProvider::OnRedirectQueryComplete( IPC::Message* msg = new IPC::Message(redirect_query_routing_id_, AutomationMsg_RedirectsFromResponse::ID, IPC::Message::PRIORITY_NORMAL); - std::vector<GURL> redirects_gurl; if (success) { - msg->WriteBool(true); + msg->WriteInt(static_cast<int>(redirects->size())); for (size_t i = 0; i < redirects->size(); i++) - redirects_gurl.push_back(redirects->at(i)); + IPC::ParamTraits<GURL>::Write(msg, redirects->at(i)); } else { msg->WriteInt(-1); // Negative count indicates failure. } - ParamTraits<std::vector<GURL>>::Write(msg, redirects_gurl); - Send(msg); redirect_query_ = NULL; } diff --git a/chrome/browser/browser_accessibility.cc b/chrome/browser/browser_accessibility.cc index 8dc85b4..fea5bf2 100644 --- a/chrome/browser/browser_accessibility.cc +++ b/chrome/browser/browser_accessibility.cc @@ -6,7 +6,6 @@ #include "chrome/browser/browser_accessibility_manager.h" #include "chrome/browser/iaccessible_function_ids.h" -#include "chrome/common/render_messages.h" BrowserAccessibility::BrowserAccessibility() : iaccessible_id_(-1), @@ -547,7 +546,7 @@ bool BrowserAccessibility::RequestAccessibilityInfo(int iaccessible_func_id, input2); } -const ViewHostMsg_Accessibility_Out_Params& BrowserAccessibility::response() { +ViewHostMsg_Accessibility_Out_Params BrowserAccessibility::response() { return BrowserAccessibilityManager::GetInstance()->response(); } diff --git a/chrome/browser/browser_accessibility.h b/chrome/browser/browser_accessibility.h index 5f2b40d..5032183 100644 --- a/chrome/browser/browser_accessibility.h +++ b/chrome/browser/browser_accessibility.h @@ -10,9 +10,7 @@ #include <oleacc.h> -#include "base/basictypes.h" - -struct ViewHostMsg_Accessibility_Out_Params; +#include "chrome/common/render_messages.h" //////////////////////////////////////////////////////////////////////////////// // @@ -146,7 +144,7 @@ class ATL_NO_VTABLE BrowserAccessibility LONG input1, LONG input2); // Accessors. - const ViewHostMsg_Accessibility_Out_Params& response(); + ViewHostMsg_Accessibility_Out_Params response(); HWND parent_hwnd(); // Id to uniquely distinguish this instance in the render-side caching, diff --git a/chrome/browser/browser_accessibility_manager.cc b/chrome/browser/browser_accessibility_manager.cc index 69255be..b71ecda 100644 --- a/chrome/browser/browser_accessibility_manager.cc +++ b/chrome/browser/browser_accessibility_manager.cc @@ -116,8 +116,7 @@ bool BrowserAccessibilityManager::RequestAccessibilityInfo( return success; } -const ViewHostMsg_Accessibility_Out_Params& -BrowserAccessibilityManager::response() { +ViewHostMsg_Accessibility_Out_Params BrowserAccessibilityManager::response() { return out_params_; } diff --git a/chrome/browser/browser_accessibility_manager.h b/chrome/browser/browser_accessibility_manager.h index dcda60c..c9c5ad5 100644 --- a/chrome/browser/browser_accessibility_manager.h +++ b/chrome/browser/browser_accessibility_manager.h @@ -15,7 +15,6 @@ class BrowserAccessibility; class RenderProcessHost; class RenderWidgetHost; -struct ViewHostMsg_Accessibility_Out_Params; //////////////////////////////////////////////////////////////////////////////// // @@ -53,7 +52,7 @@ class BrowserAccessibilityManager : public NotificationObserver { LONG input2); // Wrapper function, for cleaner code. - const ViewHostMsg_Accessibility_Out_Params& response(); + ViewHostMsg_Accessibility_Out_Params response(); // Retrieves the parent HWND connected to the provided id. HWND parent_hwnd(int id); diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index 4e017e8..bdc9da3 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -27,6 +27,7 @@ PrintViewManager::PrintViewManager(WebContents& owner) waiting_to_print_(false), inside_inner_message_loop_(false), waiting_to_show_print_dialog_(false) { + memset(&print_params_, 0, sizeof(print_params_)); } PrintViewManager::~PrintViewManager() { @@ -239,6 +240,25 @@ void PrintViewManager::OnNotifyPrintJobEvent( void PrintViewManager::OnNotifyPrintJobInitEvent( const JobEventDetails& event_details) { + ViewMsg_Print_Params old_print_params(print_params_); + + // Backup the print settings relevant to the renderer. + DCHECK_EQ(print_job_->document(), event_details.document()); + event_details.document()->settings().RenderParams(&print_params_); + print_params_.document_cookie = event_details.document()->cookie(); + DCHECK_GT(print_params_.document_cookie, 0); + + // If settings changed + DCHECK(owner_.render_view_host()); + // Equals() doesn't compare the cookie value. + if (owner_.render_view_host() && + owner_.render_view_host()->IsRenderViewLive() && + (!old_print_params.Equals(print_params_) || + !event_details.document()->page_count())) { + // TODO(maruel): Will never happen, this code is about to be deleted. + NOTREACHED(); + } + // Continue even if owner_.render_view_host() is dead because we may already // have buffered all the necessary pages. switch (event_details.type()) { @@ -440,6 +460,7 @@ void PrintViewManager::ReleasePrintJob() { print_job_->DisconnectSource(); // Don't close the worker thread. print_job_ = NULL; + memset(&print_params_, 0, sizeof(print_params_)); } void PrintViewManager::PrintNowInternal() { diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h index 3cd0272..405b180 100644 --- a/chrome/browser/printing/print_view_manager.h +++ b/chrome/browser/printing/print_view_manager.h @@ -5,13 +5,12 @@ #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ -#include "base/ref_counted.h" #include "chrome/browser/printing/printed_pages_source.h" #include "chrome/common/notification_observer.h" +#include "chrome/common/render_messages.h" class RenderViewHost; class WebContents; -struct ViewHostMsg_DidPrintPage_Params; namespace printing { @@ -119,6 +118,9 @@ class PrintViewManager : public NotificationObserver, // print_job_ is initialized. bool OpportunisticallyCreatePrintJob(int cookie); + // Cache the last print settings requested to the renderer. + ViewMsg_Print_Params print_params_; + // Manages the low-level talk to the printer. scoped_refptr<PrintJob> print_job_; diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 1bd7c7f..b6629e9 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -664,7 +664,7 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTitle, OnMsgUpdateTitle) IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateEncoding, OnMsgUpdateEncoding) IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnMsgUpdateTargetURL) - IPC_MESSAGE_HANDLER(ViewHostMsg_Thumbnail, OnMsgThumbnail) + IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_Thumbnail, OnMsgThumbnail(msg)) IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnMsgClose) IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnMsgRequestMove) IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartLoading, OnMsgDidStartLoading) @@ -834,7 +834,7 @@ void RenderViewHost::OnMsgNavigate(const IPC::Message& msg) { // copy when we filter the URLs. void* iter = NULL; ViewHostMsg_FrameNavigate_Params validated_params; - if (!ParamTraits<ViewHostMsg_FrameNavigate_Params>:: + if (!IPC::ParamTraits<ViewHostMsg_FrameNavigate_Params>:: Read(&msg, &iter, &validated_params)) return; @@ -885,9 +885,22 @@ void RenderViewHost::OnMsgUpdateTargetURL(int32 page_id, Send(new ViewMsg_UpdateTargetURL_ACK(routing_id())); } -void RenderViewHost::OnMsgThumbnail(const GURL& url, - const ThumbnailScore& score, - const SkBitmap& bitmap) { +void RenderViewHost::OnMsgThumbnail(const IPC::Message& msg) { + // crack the message + void* iter = NULL; + GURL url; + if (!IPC::ParamTraits<GURL>::Read(&msg, &iter, &url)) + return; + + ThumbnailScore score; + if (!IPC::ParamTraits<ThumbnailScore>::Read(&msg, &iter, &score)) + return; + + // thumbnail data + SkBitmap bitmap; + if (!IPC::ParamTraits<SkBitmap>::Read(&msg, &iter, &bitmap)) + return; + delegate_->UpdateThumbnail(url, bitmap, score); } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 49d1949..19bb424 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -436,9 +436,7 @@ class RenderViewHost : public RenderWidgetHost { void OnMsgUpdateTitle(int32 page_id, const std::wstring& title); void OnMsgUpdateEncoding(const std::wstring& encoding); void OnMsgUpdateTargetURL(int32 page_id, const GURL& url); - void OnMsgThumbnail(const GURL& url, - const ThumbnailScore& score, - const SkBitmap& bitmap); + void OnMsgThumbnail(const IPC::Message& msg); void OnMsgClose(); void OnMsgRequestMove(const gfx::Rect& pos); void OnMsgDidRedirectProvisionalLoad(int32 page_id, diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 709fde5..5a39b91 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -10,9 +10,9 @@ #include "base/basictypes.h" #include "chrome/browser/autofill_manager.h" +#include "chrome/common/render_messages.h" #include "net/base/load_states.h" #include "webkit/glue/webpreferences.h" -#include "webkit/glue/window_open_disposition.h" class NavigationEntry; class Profile; @@ -20,12 +20,8 @@ class RenderProcessHost; class RenderViewHost; class SkBitmap; class WebContents; -class WebKeyboardEvent; -struct ThumbnailScore; -struct ViewHostMsg_ContextMenu_Params; -struct ViewHostMsg_DidPrintPage_Params; -struct ViewHostMsg_FrameNavigate_Params; struct WebDropData; +enum WindowOpenDisposition; namespace base { class WaitableEvent; @@ -39,10 +35,6 @@ namespace gfx { class Rect; } -namespace webkit_glue { -struct WebApplicationInfo; -} - // // RenderViewHostDelegate // diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index a6d289b..50a6ef3 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -11,7 +11,6 @@ #include "chrome/browser/renderer_host/render_widget_helper.h" #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/common/notification_service.h" -#include "chrome/common/render_messages.h" #include "chrome/views/view.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webinputevent.h" @@ -550,7 +549,7 @@ void RenderWidgetHost::OnMsgSetCursor(const WebCursor& cursor) { view_->UpdateCursor(cursor); } -void RenderWidgetHost::OnMsgImeUpdateStatus(int control, +void RenderWidgetHost::OnMsgImeUpdateStatus(ViewHostMsg_ImeControl control, const gfx::Rect& caret_rect) { if (view_) { view_->IMEUpdateStatus(control, caret_rect); diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 06b9fb0..08f20f0 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -11,6 +11,7 @@ #include "base/timer.h" #include "chrome/common/bitmap_wire_data.h" #include "chrome/common/ipc_channel.h" +#include "chrome/common/render_messages.h" #include "testing/gtest/include/gtest/gtest_prod.h" namespace gfx { @@ -254,9 +255,8 @@ class RenderWidgetHost : public IPC::Channel::Listener { void OnMsgFocus(); void OnMsgBlur(); void OnMsgSetCursor(const WebCursor& cursor); - // Using int instead of ViewHostMsg_ImeControl for control's type to avoid - // having to bring in render_messages.h in a header file. - void OnMsgImeUpdateStatus(int control, const gfx::Rect& caret_rect); + void OnMsgImeUpdateStatus(ViewHostMsg_ImeControl control, + const gfx::Rect& caret_rect); // Paints the given bitmap to the current backing store at the given location. void PaintBackingStoreRect(BitmapWireData bitmap, diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h index b2edf58..76316b4 100644 --- a/chrome/browser/renderer_host/render_widget_host_view.h +++ b/chrome/browser/renderer_host/render_widget_host_view.h @@ -7,7 +7,7 @@ #include "base/gfx/native_widget_types.h" #include "base/shared_memory.h" -#include "webkit/glue/webplugin.h" +#include "chrome/common/render_messages.h" namespace gfx { class Rect; @@ -20,6 +20,7 @@ class Message; class RenderProcessHost; class RenderWidgetHost; class WebCursor; + // RenderWidgetHostView is an interface implemented by an object that acts as // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its // associated RenderProcessHost own the "Model" in this case which is the @@ -84,7 +85,8 @@ class RenderWidgetHostView { virtual void SetIsLoading(bool is_loading) = 0; // Enable or disable IME for the view. - virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect) = 0; + virtual void IMEUpdateStatus(ViewHostMsg_ImeControl control, + const gfx::Rect& caret_rect) = 0; // Informs the view that a portion of the widget's backing store was painted. // The view should copy the given rect from the backing store of the render diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index 1d86045..2c19e7e 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -271,7 +271,7 @@ void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) { UpdateCursorIfOverSelf(); } -void RenderWidgetHostViewWin::IMEUpdateStatus(int control, +void RenderWidgetHostViewWin::IMEUpdateStatus(ViewHostMsg_ImeControl control, const gfx::Rect& caret_rect) { if (control == IME_DISABLE) { ime_input_.DisableIME(m_hWnd); diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h index c4d08d3..0c8e6c3 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.h +++ b/chrome/browser/renderer_host/render_widget_host_view_win.h @@ -136,7 +136,8 @@ class RenderWidgetHostViewWin : virtual void UpdateCursor(const WebCursor& cursor); virtual void UpdateCursorIfOverSelf(); virtual void SetIsLoading(bool is_loading); - virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect); + virtual void IMEUpdateStatus(ViewHostMsg_ImeControl control, + const gfx::Rect& caret_rect); virtual void DidPaintRect(const gfx::Rect& rect); virtual void DidScrollRect(const gfx::Rect& rect, int dx, int dy); virtual void RendererGone(); diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc index f09a5af..ae8ae7d 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc @@ -173,11 +173,11 @@ void CheckSuccessfulRequest(const std::vector<IPC::Message>& messages, void* iter = NULL; int request_id; - ASSERT_TRUE(ReadParam(&messages[1], &iter, &request_id)); + ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &request_id)); base::SharedMemoryHandle shm_handle; - ASSERT_TRUE(ReadParam(&messages[1], &iter, &shm_handle)); + ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &shm_handle)); int data_len; - ASSERT_TRUE(ReadParam(&messages[1], &iter, &data_len)); + ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &data_len)); ASSERT_EQ(reference_data.size(), data_len); base::SharedMemory shared_mem(shm_handle, true); // read only diff --git a/chrome/browser/renderer_host/test_render_view_host.h b/chrome/browser/renderer_host/test_render_view_host.h index b74a56f..8618ea9 100644 --- a/chrome/browser/renderer_host/test_render_view_host.h +++ b/chrome/browser/renderer_host/test_render_view_host.h @@ -54,7 +54,8 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { virtual void SetIsLoading(bool is_loading) {} virtual void UpdateCursor(const WebCursor& cursor) {} virtual void UpdateCursorIfOverSelf() {} - virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect) {} + virtual void IMEUpdateStatus(ViewHostMsg_ImeControl control, + const gfx::Rect& caret_rect) {} virtual void DidPaintRect(const gfx::Rect& rect) {} virtual void DidScrollRect(const gfx::Rect& rect, int dx, int dy) {} virtual void RendererGone() {} diff --git a/chrome/browser/resource_message_filter.cc b/chrome/browser/resource_message_filter.cc index 89c2bf8..02e6230 100644 --- a/chrome/browser/resource_message_filter.cc +++ b/chrome/browser/resource_message_filter.cc @@ -24,6 +24,7 @@ #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" +#include "chrome/common/ipc_message_macros.h" #include "chrome/common/render_messages.h" #include "net/base/cookie_monster.h" #include "net/base/mime_util.h" @@ -232,7 +233,7 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& message) { void ResourceMessageFilter::OnReceiveContextMenuMsg(const IPC::Message& msg) { void* iter = NULL; ViewHostMsg_ContextMenu_Params params; - if (!ParamTraits<ViewHostMsg_ContextMenu_Params>:: + if (!IPC::ParamTraits<ViewHostMsg_ContextMenu_Params>:: Read(&msg, &iter, ¶ms)) return; diff --git a/chrome/browser/resource_message_filter.h b/chrome/browser/resource_message_filter.h index af9d604..43034b6 100644 --- a/chrome/browser/resource_message_filter.h +++ b/chrome/browser/resource_message_filter.h @@ -28,7 +28,6 @@ class ClipboardService; class Profile; class RenderWidgetHelper; class SpellChecker; -struct ViewHostMsg_Resource_Request; struct WebPluginInfo; namespace printing { diff --git a/chrome/browser/ssl/ssl_uitest.cc b/chrome/browser/ssl/ssl_uitest.cc index f31d8f2..1819010 100644 --- a/chrome/browser/ssl/ssl_uitest.cc +++ b/chrome/browser/ssl/ssl_uitest.cc @@ -7,7 +7,6 @@ #include <string> -#include "chrome/common/filter_policy.h" #include "chrome/common/pref_names.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h index 5d39546..eb18b60 100644 --- a/chrome/browser/tab_contents/interstitial_page.h +++ b/chrome/browser/tab_contents/interstitial_page.h @@ -7,7 +7,6 @@ #include <string> -#include "base/gfx/size.h" #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/tab_contents/ipc_status_view.cc b/chrome/browser/tab_contents/ipc_status_view.cc index a317aac..cd85ee0 100644 --- a/chrome/browser/tab_contents/ipc_status_view.cc +++ b/chrome/browser/tab_contents/ipc_status_view.cc @@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Need to include this before any other file because it defines -// IPC_MESSAGE_LOG_ENABLED. -#include "chrome/common/ipc_message.h" - -#ifdef IPC_MESSAGE_LOG_ENABLED -#define IPC_MESSAGE_MACROS_LOG_ENABLED - #include "chrome/browser/tab_contents/ipc_status_view.h" #include <stdio.h> @@ -24,6 +17,8 @@ #include "chrome/common/pref_service.h" #include "chrome/common/render_messages.h" +#ifdef IPC_MESSAGE_LOG_ENABLED + using base::Time; namespace { @@ -44,6 +39,19 @@ enum { kParamsColumn, }; +// This class ensures that we have a link dependency on render_messages.cc and +// plugin_messages.cc, and at the same time sets up the message logger function +// mappings. +class RegisterLoggerFuncs { + public: + RegisterLoggerFuncs() { + RenderMessagesInit(); + PluginMessagesInit(); + } +}; + +RegisterLoggerFuncs g_register_logger_funcs; + } // namespace IPCStatusView* IPCStatusView::current_; @@ -62,16 +70,7 @@ IPCStatusView::IPCStatusView() plugin_process_ = NULL; plugin_process_host_ = NULL; - IPC::Logging* log = IPC::Logging::current(); - log->RegisterMessageLogger(ViewStart, ViewMsgLog); - log->RegisterMessageLogger(ViewHostStart, ViewHostMsgLog); - log->RegisterMessageLogger(PluginProcessStart, PluginProcessMsgLog); - log->RegisterMessageLogger(PluginProcessHostStart, PluginProcessHostMsgLog); - log->RegisterMessageLogger(PluginStart, PluginMsgLog); - log->RegisterMessageLogger(PluginHostStart, PluginHostMsgLog); - log->RegisterMessageLogger(NPObjectStart, NPObjectMsgLog); - - log->SetConsumer(this); + IPC::Logging::current()->SetConsumer(this); } IPCStatusView::~IPCStatusView() { diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index f6a8666..849ba2a 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -24,7 +24,6 @@ #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" -#include "chrome/common/render_messages.h" #include "net/base/mime_util.h" #include "net/base/net_errors.h" #include "net/base/registry_controlled_domain.h" |