diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-15 08:05:53 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-15 08:05:53 +0000 |
commit | 13c70b80c24bea374bd921d2b3c885d32026c985 (patch) | |
tree | 6695b3b29195c6916ce1f576b5fb4ea687332e3d | |
parent | ebeefff3de6b22ea1447f768399f5fba14820ca8 (diff) | |
download | chromium_src-13c70b80c24bea374bd921d2b3c885d32026c985.zip chromium_src-13c70b80c24bea374bd921d2b3c885d32026c985.tar.gz chromium_src-13c70b80c24bea374bd921d2b3c885d32026c985.tar.bz2 |
Adds default constructors and destructors to ViewHostMsgs.
This change adds default constructors to ViewHostMsgs defined in 'chrome/common/render_messages_params.h' to prevent its variables from being used uninitialized, and adds destructors to prevent compilers from synthesizing them when including the header file. This change also removes code that inserts constants to the structs because we do not need it any more.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3252001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59482 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller_unittest.cc | 30 | ||||
-rw-r--r-- | chrome/common/render_messages_params.cc | 292 | ||||
-rw-r--r-- | chrome/common/render_messages_params.h | 97 | ||||
-rw-r--r-- | chrome/renderer/audio_message_filter_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/media/audio_renderer_impl_unittest.cc | 12 | ||||
-rw-r--r-- | chrome/renderer/render_view_browsertest.cc | 2 |
6 files changed, 413 insertions, 24 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller_unittest.cc b/chrome/browser/tab_contents/navigation_controller_unittest.cc index da94be0..67d1bc6 100644 --- a/chrome/browser/tab_contents/navigation_controller_unittest.cc +++ b/chrome/browser/tab_contents/navigation_controller_unittest.cc @@ -741,7 +741,7 @@ TEST_F(NavigationControllerTest, Redirect) { EXPECT_EQ(controller().pending_entry_index(), -1); EXPECT_EQ(url1, controller().GetActiveEntry()->url()); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; params.url = url2; params.transition = PageTransition::SERVER_REDIRECT; @@ -796,7 +796,7 @@ TEST_F(NavigationControllerTest, PostThenRedirect) { EXPECT_EQ(controller().pending_entry_index(), -1); EXPECT_EQ(url1, controller().GetActiveEntry()->url()); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; params.url = url2; params.transition = PageTransition::SERVER_REDIRECT; @@ -841,7 +841,7 @@ TEST_F(NavigationControllerTest, ImmediateRedirect) { EXPECT_EQ(controller().pending_entry_index(), -1); EXPECT_EQ(url1, controller().GetActiveEntry()->url()); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; params.url = url2; params.transition = PageTransition::SERVER_REDIRECT; @@ -882,7 +882,7 @@ TEST_F(NavigationControllerTest, NewSubframe) { NotificationType::NAV_ENTRY_COMMITTED)); const GURL url2("http://foo2"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 1; params.url = url2; params.transition = PageTransition::MANUAL_SUBFRAME; @@ -917,7 +917,7 @@ TEST_F(NavigationControllerTest, SubframeOnEmptyPage) { // Navigation controller currently has no entries. const GURL url("http://foo2"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 1; params.url = url; params.transition = PageTransition::AUTO_SUBFRAME; @@ -942,7 +942,7 @@ TEST_F(NavigationControllerTest, AutoSubframe) { NotificationType::NAV_ENTRY_COMMITTED)); const GURL url2("http://foo2"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; params.url = url2; params.transition = PageTransition::AUTO_SUBFRAME; @@ -972,7 +972,7 @@ TEST_F(NavigationControllerTest, BackSubframe) { // First manual subframe navigation. const GURL url2("http://foo2"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 1; params.url = url2; params.transition = PageTransition::MANUAL_SUBFRAME; @@ -1055,7 +1055,7 @@ TEST_F(NavigationControllerTest, InPage) { // First navigation. const GURL url2("http://foo#a"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 1; params.url = url2; params.transition = PageTransition::LINK; @@ -1135,7 +1135,7 @@ TEST_F(NavigationControllerTest, InPage_Replace) { // First navigation. const GURL url2("http://foo#a"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; // Same page_id params.url = url2; params.transition = PageTransition::LINK; @@ -1184,7 +1184,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { // Navigate within the page. { const GURL url("http://foo2/#a"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 1; // Same page_id params.url = url; params.transition = PageTransition::LINK; @@ -1207,7 +1207,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { // Perform a client redirect to a new page. { const GURL url("http://foo3/"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 2; // New page_id params.url = url; params.transition = PageTransition::CLIENT_REDIRECT; @@ -1342,7 +1342,7 @@ TEST_F(NavigationControllerTest, RestoreNavigate) { our_controller.GetEntryAtIndex(0)->restore_type()); // Say we navigated to that entry. - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; params.url = url; params.transition = PageTransition::LINK; @@ -1608,7 +1608,7 @@ TEST_F(NavigationControllerTest, SameSubframe) { // Navigate a subframe that would normally count as in-page. const GURL subframe("http://www.google.com/#"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; params.url = subframe; params.transition = PageTransition::AUTO_SUBFRAME; @@ -1633,7 +1633,7 @@ TEST_F(NavigationControllerTest, ViewSourceRedirect) { controller().LoadURL(url, GURL(), PageTransition::TYPED); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = 0; params.url = result_url; params.transition = PageTransition::SERVER_REDIRECT; @@ -1696,7 +1696,7 @@ TEST_F(NavigationControllerTest, SubframeWhilePending) { // Send a subframe update from the first page, as if one had just // automatically loaded. Auto subframes don't increment the page ID. const GURL url1_sub("http://foo/subframe"); - ViewHostMsg_FrameNavigate_Params params = {0}; + ViewHostMsg_FrameNavigate_Params params; params.page_id = controller().GetLastCommittedEntry()->page_id(); params.url = url1_sub; params.transition = PageTransition::AUTO_SUBFRAME; diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index 6c9591f..f193c5e 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -10,6 +10,80 @@ #include "chrome/common/render_messages.h" #include "net/base/upload_data.h" +ViewMsg_Navigate_Params::ViewMsg_Navigate_Params() + : page_id(-1), + pending_history_list_offset(-1), + current_history_list_offset(-1), + current_history_list_length(0), + transition(PageTransition::LINK), + navigation_type(NORMAL) { +} + +ViewMsg_Navigate_Params::~ViewMsg_Navigate_Params() { +} + +ViewHostMsg_FrameNavigate_Params::ViewHostMsg_FrameNavigate_Params() + : page_id(0), + transition(PageTransition::TYPED), + should_update_history(false), + gesture(NavigationGestureUser), + is_post(false), + is_content_filtered(false), + was_within_same_page(false), + http_status_code(0) { +} + +ViewHostMsg_FrameNavigate_Params::~ViewHostMsg_FrameNavigate_Params() { +} + +ViewHostMsg_UpdateRect_Params::ViewHostMsg_UpdateRect_Params() + : dx(0), + dy(0), + flags(0) { +} + +ViewHostMsg_UpdateRect_Params::~ViewHostMsg_UpdateRect_Params() { +} + +ViewMsg_ClosePage_Params::ViewMsg_ClosePage_Params() + : closing_process_id(0), + closing_route_id(0), + for_cross_site_transition(false), + new_render_process_host_id(0), + new_request_id(0) { +} + +ViewMsg_ClosePage_Params::~ViewMsg_ClosePage_Params() { +} + +ViewHostMsg_Resource_Request::ViewHostMsg_Resource_Request() + : load_flags(0), + origin_child_id(0), + resource_type(ResourceType::MAIN_FRAME), + request_context(0), + appcache_host_id(0), + download_to_file(false), + host_renderer_id(0), + host_render_view_id(0) { +} + +ViewHostMsg_Resource_Request::~ViewHostMsg_Resource_Request() { +} + +ViewMsg_Print_Params::ViewMsg_Print_Params() + : margin_top(0), + margin_left(0), + dpi(0), + min_shrink(0), + max_shrink(0), + desired_dpi(0), + document_cookie(0), + selection_only(false) { +} + +ViewMsg_Print_Params::~ViewMsg_Print_Params() { +} + bool ViewMsg_Print_Params::Equals(const ViewMsg_Print_Params& rhs) const { return page_size == rhs.page_size && printable_size == rhs.printable_size && @@ -28,6 +102,116 @@ bool ViewMsg_Print_Params::IsEmpty() const { page_size.IsEmpty() && !margin_top && !margin_left; } +ViewMsg_PrintPage_Params::ViewMsg_PrintPage_Params() + : page_number(0) { +} + +ViewMsg_PrintPage_Params::~ViewMsg_PrintPage_Params() { +} + +ViewMsg_PrintPages_Params::ViewMsg_PrintPages_Params() { +} + +ViewMsg_PrintPages_Params::~ViewMsg_PrintPages_Params() { +} + +ViewHostMsg_DidPrintPage_Params::ViewHostMsg_DidPrintPage_Params() + : data_size(0), + document_cookie(0), + page_number(0), + actual_shrink(0), + has_visible_overlays(false) { +#if defined(OS_WIN) + // Initialize |metafile_data_handle| only on Windows because it maps + // base::SharedMemoryHandle to HANDLE. We do not need to initialize this + // variable on Posix because it maps base::SharedMemoryHandle to + // FileDescriptior, which has the default constructor. + metafile_data_handle = INVALID_HANDLE_VALUE; +#endif +} + +ViewHostMsg_DidPrintPage_Params::~ViewHostMsg_DidPrintPage_Params() { +} + +ViewHostMsg_Audio_CreateStream_Params::ViewHostMsg_Audio_CreateStream_Params() + : packet_size(0) { +} + +ViewHostMsg_Audio_CreateStream_Params:: + ~ViewHostMsg_Audio_CreateStream_Params() { +} + +ViewHostMsg_ShowPopup_Params::ViewHostMsg_ShowPopup_Params() + : item_height(0), + item_font_size(0), + selected_item(0), + right_aligned(false) { +} + +ViewHostMsg_ShowPopup_Params::~ViewHostMsg_ShowPopup_Params() { +} + +ViewHostMsg_ScriptedPrint_Params::ViewHostMsg_ScriptedPrint_Params() + : routing_id(0), + host_window_id(0), + cookie(0), + expected_pages_count(0), + has_selection(false), + use_overlays(false) { +} + +ViewHostMsg_ScriptedPrint_Params::~ViewHostMsg_ScriptedPrint_Params() { +} + +ViewMsg_DOMStorageEvent_Params::ViewMsg_DOMStorageEvent_Params() + : storage_type_(DOM_STORAGE_LOCAL) { +} + +ViewMsg_DOMStorageEvent_Params::~ViewMsg_DOMStorageEvent_Params() { +} + +ViewHostMsg_IDBFactoryOpen_Params::ViewHostMsg_IDBFactoryOpen_Params() + : routing_id_(0), + response_id_(0) { +} + +ViewHostMsg_IDBFactoryOpen_Params::~ViewHostMsg_IDBFactoryOpen_Params() { +} + +ViewHostMsg_IDBDatabaseCreateObjectStore_Params:: + ViewHostMsg_IDBDatabaseCreateObjectStore_Params() + : response_id_(0), + auto_increment_(false), + idb_database_id_(0) { +} + +ViewHostMsg_IDBDatabaseCreateObjectStore_Params:: + ~ViewHostMsg_IDBDatabaseCreateObjectStore_Params() { +} + +ViewHostMsg_IDBObjectStoreCreateIndex_Params:: + ViewHostMsg_IDBObjectStoreCreateIndex_Params() + : response_id_(0), + unique_(false), + idb_object_store_id_(0) { +} + +ViewHostMsg_IDBObjectStoreCreateIndex_Params:: + ~ViewHostMsg_IDBObjectStoreCreateIndex_Params() { +} + +ViewHostMsg_IDBObjectStoreOpenCursor_Params:: + ViewHostMsg_IDBObjectStoreOpenCursor_Params() + : response_id_(0), + flags_(0), + direction_(0), + idb_object_store_id_(0) { +} + +ViewHostMsg_IDBObjectStoreOpenCursor_Params:: + ~ViewHostMsg_IDBObjectStoreOpenCursor_Params() { +} + ViewMsg_ExecuteCode_Params::ViewMsg_ExecuteCode_Params() { } @@ -43,6 +227,114 @@ ViewMsg_ExecuteCode_Params::ViewMsg_ExecuteCode_Params( code(code), all_frames(all_frames) { } +ViewMsg_ExecuteCode_Params::~ViewMsg_ExecuteCode_Params() { +} + +ViewHostMsg_CreateWorker_Params::ViewHostMsg_CreateWorker_Params() + : is_shared(false), + document_id(0), + render_view_route_id(0), + route_id(0), + parent_appcache_host_id(0), + script_resource_appcache_id(0) { +} + +ViewHostMsg_CreateWorker_Params::~ViewHostMsg_CreateWorker_Params() { +} + +ViewHostMsg_ShowNotification_Params::ViewHostMsg_ShowNotification_Params() + : is_html(false), + direction(WebKit::WebTextDirectionDefault), + notification_id(0) { +} + +ViewHostMsg_ShowNotification_Params::~ViewHostMsg_ShowNotification_Params() { +} + +ViewMsg_New_Params::ViewMsg_New_Params() + : parent_window(0), + view_id(0), + session_storage_namespace_id(0) { +} + +ViewMsg_New_Params::~ViewMsg_New_Params() { +} + +ViewHostMsg_CreateWindow_Params::ViewHostMsg_CreateWindow_Params() + : opener_id(0), + user_gesture(false), + window_container_type(WINDOW_CONTAINER_TYPE_NORMAL), + session_storage_namespace_id(0) { +} + +ViewHostMsg_CreateWindow_Params::~ViewHostMsg_CreateWindow_Params() { +} + +ViewHostMsg_RunFileChooser_Params::ViewHostMsg_RunFileChooser_Params() + : mode(Open) { +} + +ViewHostMsg_RunFileChooser_Params::~ViewHostMsg_RunFileChooser_Params() { +} + +ViewMsg_ExtensionRendererInfo::ViewMsg_ExtensionRendererInfo() + : location(Extension::INVALID) { +} + +ViewMsg_ExtensionRendererInfo::~ViewMsg_ExtensionRendererInfo() { +} + +ViewMsg_ExtensionsUpdated_Params::ViewMsg_ExtensionsUpdated_Params() { +} + +ViewMsg_ExtensionsUpdated_Params::~ViewMsg_ExtensionsUpdated_Params() { +} + +ViewMsg_DeviceOrientationUpdated_Params:: + ViewMsg_DeviceOrientationUpdated_Params() + : can_provide_alpha(false), + alpha(0), + can_provide_beta(false), + beta(0), + can_provide_gamma(false), + gamma(0) { +} + +ViewMsg_DeviceOrientationUpdated_Params:: + ~ViewMsg_DeviceOrientationUpdated_Params() { +} + +ViewHostMsg_DomMessage_Params::ViewHostMsg_DomMessage_Params() + : request_id(0), + has_callback(false), + user_gesture(false) { +} + +ViewHostMsg_DomMessage_Params::~ViewHostMsg_DomMessage_Params() { +} + +ViewHostMsg_OpenFileSystemRequest_Params:: + ViewHostMsg_OpenFileSystemRequest_Params() + : routing_id(0), + request_id(0), + type(WebKit::WebFileSystem::TypeTemporary), + requested_size(0) { +} + +ViewHostMsg_OpenFileSystemRequest_Params:: + ~ViewHostMsg_OpenFileSystemRequest_Params() { +} + +ViewMsg_FileSystem_DidReadDirectory_Params:: + ViewMsg_FileSystem_DidReadDirectory_Params() + : request_id(0), + has_more(false) { +} + +ViewMsg_FileSystem_DidReadDirectory_Params:: + ~ViewMsg_FileSystem_DidReadDirectory_Params() { +} + namespace IPC { // Self contained templates which are only used inside serializing Params diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index c5a38b6..a237063 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -65,6 +65,9 @@ struct ViewMsg_Navigate_Params { NORMAL }; + ViewMsg_Navigate_Params(); + ~ViewMsg_Navigate_Params(); + // The page_id for this navigation, or -1 if it is a new navigation. Back, // Forward, and Reload navigations should have a valid page_id. If the load // succeeds, then this page_id will be reflected in the resultant @@ -111,6 +114,14 @@ struct ViewMsg_AudioStreamState_Params { kError }; + ViewMsg_AudioStreamState_Params() + : state(kPlaying) { + } + + explicit ViewMsg_AudioStreamState_Params(State s) + : state(s) { + } + // Carries the current playback state. State state; }; @@ -124,6 +135,10 @@ struct ViewMsg_StopFinding_Params { kActivateSelection }; + ViewMsg_StopFinding_Params() + : action(kClearSelection) { + } + // The action that should be taken when the find is completed. Action action; }; @@ -180,6 +195,9 @@ struct ViewHostMsg_GetSearchProviderInstallState_Params { // Parameters structure for ViewHostMsg_FrameNavigate, which has too many data // parameters to be reasonably put in a predefined IPC message. struct ViewHostMsg_FrameNavigate_Params { + ViewHostMsg_FrameNavigate_Params(); + ~ViewHostMsg_FrameNavigate_Params(); + // Page ID of this navigation. The renderer creates a new unique page ID // anytime a new session history entry is created. This means you'll get new // page IDs for user actions, and the old page IDs will be reloaded when @@ -259,6 +277,9 @@ struct ViewHostMsg_UpdateRect_Flags { }; struct ViewHostMsg_UpdateRect_Params { + ViewHostMsg_UpdateRect_Params(); + ~ViewHostMsg_UpdateRect_Params(); + // The bitmap to be painted into the view at the locations specified by // update_rects. TransportDIB::Id bitmap; @@ -309,6 +330,9 @@ struct ViewHostMsg_UpdateRect_Params { // Information on closing a tab. This is used both for ViewMsg_ClosePage, and // the corresponding ViewHostMsg_ClosePage_ACK. struct ViewMsg_ClosePage_Params { + ViewMsg_ClosePage_Params(); + ~ViewMsg_ClosePage_Params(); + // The identifier of the RenderProcessHost for the currently closing view. // // These first two parameters are technically redundant since they are @@ -344,6 +368,9 @@ struct ViewMsg_ClosePage_Params { // Parameters for a resource request. struct ViewHostMsg_Resource_Request { + ViewHostMsg_Resource_Request(); + ~ViewHostMsg_Resource_Request(); + // The request method: GET, POST, etc. std::string method; @@ -407,6 +434,9 @@ struct ViewHostMsg_Resource_Request { // Parameters for a render request. struct ViewMsg_Print_Params { + ViewMsg_Print_Params(); + ~ViewMsg_Print_Params(); + // Physical size of the page, including non-printable margins, // in pixels according to dpi. gfx::Size page_size; @@ -446,6 +476,9 @@ struct ViewMsg_Print_Params { }; struct ViewMsg_PrintPage_Params { + ViewMsg_PrintPage_Params(); + ~ViewMsg_PrintPage_Params(); + // Parameters to render the page as a printed page. It must always be the same // value for all the document. ViewMsg_Print_Params params; @@ -456,6 +489,9 @@ struct ViewMsg_PrintPage_Params { }; struct ViewMsg_PrintPages_Params { + ViewMsg_PrintPages_Params(); + ~ViewMsg_PrintPages_Params(); + // Parameters to render the page as a printed page. It must always be the same // value for all the document. ViewMsg_Print_Params params; @@ -466,6 +502,9 @@ struct ViewMsg_PrintPages_Params { // Parameters to describe a rendered page. struct ViewHostMsg_DidPrintPage_Params { + ViewHostMsg_DidPrintPage_Params(); + ~ViewHostMsg_DidPrintPage_Params(); + // A shared memory handle to the EMF data. This data can be quite large so a // memory map needs to be used. base::SharedMemoryHandle metafile_data_handle; @@ -494,6 +533,9 @@ struct ViewHostMsg_DidPrintPage_Params { // Parameters for creating an audio output stream. struct ViewHostMsg_Audio_CreateStream_Params { + ViewHostMsg_Audio_CreateStream_Params(); + ~ViewHostMsg_Audio_CreateStream_Params(); + // Format request for the stream. AudioParameters params; @@ -508,6 +550,9 @@ struct ViewHostMsg_Audio_CreateStream_Params { // Cocoa controls. The renderer sends us this message which we use to populate // the popup menu. struct ViewHostMsg_ShowPopup_Params { + ViewHostMsg_ShowPopup_Params(); + ~ViewHostMsg_ShowPopup_Params(); + // Position on the screen. gfx::Rect bounds; @@ -529,6 +574,9 @@ struct ViewHostMsg_ShowPopup_Params { // Parameters for the IPC message ViewHostMsg_ScriptedPrint struct ViewHostMsg_ScriptedPrint_Params { + ViewHostMsg_ScriptedPrint_Params(); + ~ViewHostMsg_ScriptedPrint_Params(); + int routing_id; gfx::NativeViewId host_window_id; int cookie; @@ -539,6 +587,9 @@ struct ViewHostMsg_ScriptedPrint_Params { // Signals a storage event. struct ViewMsg_DOMStorageEvent_Params { + ViewMsg_DOMStorageEvent_Params(); + ~ViewMsg_DOMStorageEvent_Params(); + // The key that generated the storage event. Null if clear() was called. NullableString16 key_; @@ -560,6 +611,9 @@ struct ViewMsg_DOMStorageEvent_Params { // Used to open an indexed database. struct ViewHostMsg_IDBFactoryOpen_Params { + ViewHostMsg_IDBFactoryOpen_Params(); + ~ViewHostMsg_IDBFactoryOpen_Params(); + // The routing ID of the view initiating the open. int32 routing_id_; @@ -578,6 +632,9 @@ struct ViewHostMsg_IDBFactoryOpen_Params { // Used to create an object store. struct ViewHostMsg_IDBDatabaseCreateObjectStore_Params { + ViewHostMsg_IDBDatabaseCreateObjectStore_Params(); + ~ViewHostMsg_IDBDatabaseCreateObjectStore_Params(); + // The response should have this id. int32 response_id_; @@ -596,6 +653,9 @@ struct ViewHostMsg_IDBDatabaseCreateObjectStore_Params { // Used to create an index. struct ViewHostMsg_IDBObjectStoreCreateIndex_Params { + ViewHostMsg_IDBObjectStoreCreateIndex_Params(); + ~ViewHostMsg_IDBObjectStoreCreateIndex_Params(); + // The response should have this id. int32 response_id_; @@ -614,6 +674,9 @@ struct ViewHostMsg_IDBObjectStoreCreateIndex_Params { // Used to open an IndexedDB cursor. struct ViewHostMsg_IDBObjectStoreOpenCursor_Params { + ViewHostMsg_IDBObjectStoreOpenCursor_Params(); + ~ViewHostMsg_IDBObjectStoreOpenCursor_Params(); + // The response should have this id. int32 response_id_; // The serialized left key. @@ -635,6 +698,7 @@ struct ViewMsg_ExecuteCode_Params { const std::vector<URLPattern>& host_permissions, bool is_javascript, const std::string& code, bool all_frames); + ~ViewMsg_ExecuteCode_Params(); // The extension API request id, for responding. int request_id; @@ -659,6 +723,9 @@ struct ViewMsg_ExecuteCode_Params { // Parameters for the message that creates a worker thread. struct ViewHostMsg_CreateWorker_Params { + ViewHostMsg_CreateWorker_Params(); + ~ViewHostMsg_CreateWorker_Params(); + // URL for the worker script. GURL url; @@ -688,6 +755,9 @@ struct ViewHostMsg_CreateWorker_Params { // Parameters for the message that creates a desktop notification. struct ViewHostMsg_ShowNotification_Params { + ViewHostMsg_ShowNotification_Params(); + ~ViewHostMsg_ShowNotification_Params(); + // URL which is the origin that created this notification. GURL origin; @@ -715,6 +785,9 @@ struct ViewHostMsg_ShowNotification_Params { // Creates a new view via a control message since the view doesn't yet exist. struct ViewMsg_New_Params { + ViewMsg_New_Params(); + ~ViewMsg_New_Params(); + // The parent window's id. gfx::NativeViewId parent_window; @@ -735,6 +808,9 @@ struct ViewMsg_New_Params { }; struct ViewHostMsg_CreateWindow_Params { + ViewHostMsg_CreateWindow_Params(); + ~ViewHostMsg_CreateWindow_Params(); + // Routing ID of the view initiating the open. int opener_id; @@ -768,6 +844,9 @@ struct ViewHostMsg_RunFileChooser_Params { Save, }; + ViewHostMsg_RunFileChooser_Params(); + ~ViewHostMsg_RunFileChooser_Params(); + Mode mode; // Title to be used for the dialog. This may be empty for the default title, @@ -783,6 +862,9 @@ struct ViewHostMsg_RunFileChooser_Params { }; struct ViewMsg_ExtensionRendererInfo { + ViewMsg_ExtensionRendererInfo(); + ~ViewMsg_ExtensionRendererInfo(); + std::string id; ExtensionExtent web_extent; std::string name; @@ -791,11 +873,17 @@ struct ViewMsg_ExtensionRendererInfo { }; struct ViewMsg_ExtensionsUpdated_Params { + ViewMsg_ExtensionsUpdated_Params(); + ~ViewMsg_ExtensionsUpdated_Params(); + // Describes the installed extension apps and the URLs they cover. std::vector<ViewMsg_ExtensionRendererInfo> extensions; }; struct ViewMsg_DeviceOrientationUpdated_Params { + ViewMsg_DeviceOrientationUpdated_Params(); + ~ViewMsg_DeviceOrientationUpdated_Params(); + // These fields have the same meaning as in device_orientation::Orientation. bool can_provide_alpha; double alpha; @@ -807,6 +895,9 @@ struct ViewMsg_DeviceOrientationUpdated_Params { // Parameters structure for ViewHostMsg_ExtensionRequest. struct ViewHostMsg_DomMessage_Params { + ViewHostMsg_DomMessage_Params(); + ~ViewHostMsg_DomMessage_Params(); + // Message name. std::string name; @@ -827,6 +918,9 @@ struct ViewHostMsg_DomMessage_Params { }; struct ViewHostMsg_OpenFileSystemRequest_Params { + ViewHostMsg_OpenFileSystemRequest_Params(); + ~ViewHostMsg_OpenFileSystemRequest_Params(); + // The routing ID of the view initiating the request. int routing_id; @@ -844,6 +938,9 @@ struct ViewHostMsg_OpenFileSystemRequest_Params { }; struct ViewMsg_FileSystem_DidReadDirectory_Params { + ViewMsg_FileSystem_DidReadDirectory_Params(); + ~ViewMsg_FileSystem_DidReadDirectory_Params(); + // The response should have this id. int request_id; diff --git a/chrome/renderer/audio_message_filter_unittest.cc b/chrome/renderer/audio_message_filter_unittest.cc index 6c1e200..c92ff27 100644 --- a/chrome/renderer/audio_message_filter_unittest.cc +++ b/chrome/renderer/audio_message_filter_unittest.cc @@ -117,8 +117,8 @@ TEST(AudioMessageFilterTest, Basic) { delegate.Reset(); // ViewMsg_NotifyAudioStreamStateChanged - const ViewMsg_AudioStreamState_Params kState = - { ViewMsg_AudioStreamState_Params::kPlaying }; + const ViewMsg_AudioStreamState_Params kState( + ViewMsg_AudioStreamState_Params::kPlaying); EXPECT_FALSE(delegate.state_changed_received()); filter->OnMessageReceived( ViewMsg_NotifyAudioStreamStateChanged(kRouteId, stream_id, kState)); diff --git a/chrome/renderer/media/audio_renderer_impl_unittest.cc b/chrome/renderer/media/audio_renderer_impl_unittest.cc index d5785ea..b6c3593 100644 --- a/chrome/renderer/media/audio_renderer_impl_unittest.cc +++ b/chrome/renderer/media/audio_renderer_impl_unittest.cc @@ -105,12 +105,12 @@ TEST_F(AudioRendererImplTest, SetVolume) { TEST_F(AudioRendererImplTest, Stop) { // Declare some state messages. - const ViewMsg_AudioStreamState_Params kError = - { ViewMsg_AudioStreamState_Params::kError }; - const ViewMsg_AudioStreamState_Params kPlaying = - { ViewMsg_AudioStreamState_Params::kPlaying }; - const ViewMsg_AudioStreamState_Params kPaused = - { ViewMsg_AudioStreamState_Params::kPaused }; + const ViewMsg_AudioStreamState_Params kError( + ViewMsg_AudioStreamState_Params::kError); + const ViewMsg_AudioStreamState_Params kPlaying( + ViewMsg_AudioStreamState_Params::kPlaying); + const ViewMsg_AudioStreamState_Params kPaused( + ViewMsg_AudioStreamState_Params::kPaused); // Execute Stop() codepath to create an IPC message. EXPECT_CALL(stop_callback_, OnFilterCallback()); diff --git a/chrome/renderer/render_view_browsertest.cc b/chrome/renderer/render_view_browsertest.cc index 531aae7..ce67a88 100644 --- a/chrome/renderer/render_view_browsertest.cc +++ b/chrome/renderer/render_view_browsertest.cc @@ -912,7 +912,7 @@ TEST_F(RenderViewTest, JSBlockSentAfterPageLoad) { render_thread_.sink().ClearMessages(); // 3. Reload page. - ViewMsg_Navigate_Params params = { 0 }; + ViewMsg_Navigate_Params params; std::string url_str = "data:text/html;charset=utf-8,"; url_str.append(html); GURL url(url_str); |