diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 21:18:27 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 21:18:27 +0000 |
commit | d45f7515b8c037da645291deef1dd31cdaaa08c0 (patch) | |
tree | 6384fd7ab2c81ae7035511e0f74feb13cbdce1f0 | |
parent | ecd6d900c8f72f70863cda9f5a3a2626179bf61c (diff) | |
download | chromium_src-d45f7515b8c037da645291deef1dd31cdaaa08c0.zip chromium_src-d45f7515b8c037da645291deef1dd31cdaaa08c0.tar.gz chromium_src-d45f7515b8c037da645291deef1dd31cdaaa08c0.tar.bz2 |
Coverity: Initialize member variables.
CID=6462,16139,16144,16145,16233,16322,16402,16421,16422,16423,16660,16663,
16942,17035,17118,17120,17144,17243,17266,17267,17268
BUG=none
TEST=none
R=kmadhusu@chromium.org
Review URL: http://codereview.chromium.org/7206047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89894 0039d316-1c4b-4281-b951-d872f2087c98
21 files changed, 72 insertions, 21 deletions
diff --git a/chrome/browser/browsing_data_file_system_helper.cc b/chrome/browser/browsing_data_file_system_helper.cc index a93f142..766452a 100644 --- a/chrome/browser/browsing_data_file_system_helper.cc +++ b/chrome/browser/browsing_data_file_system_helper.cc @@ -192,7 +192,9 @@ BrowsingDataFileSystemHelper* BrowsingDataFileSystemHelper::Create( } CannedBrowsingDataFileSystemHelper:: - PendingFileSystemInfo::PendingFileSystemInfo() { + PendingFileSystemInfo::PendingFileSystemInfo() + : type(fileapi::kFileSystemTypeUnknown), + size(0) { } CannedBrowsingDataFileSystemHelper:: diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc index 985b669..2480501 100644 --- a/chrome/browser/file_select_helper.cc +++ b/chrome/browser/file_select_helper.cc @@ -35,7 +35,7 @@ static const int kFileSelectEnumerationId = -1; } struct FileSelectHelper::ActiveDirectoryEnumeration { - ActiveDirectoryEnumeration() {} + ActiveDirectoryEnumeration() : rvh_(NULL) {} scoped_ptr<DirectoryListerDispatchDelegate> delegate_; scoped_ptr<net::DirectoryLister> lister_; diff --git a/chrome/browser/policy/cloud_policy_subsystem.cc b/chrome/browser/policy/cloud_policy_subsystem.cc index ec99a19..b85b7c9 100644 --- a/chrome/browser/policy/cloud_policy_subsystem.cc +++ b/chrome/browser/policy/cloud_policy_subsystem.cc @@ -209,7 +209,9 @@ void CloudPolicySubsystem::CreateCloudPolicyController() { notifier_.get())); } -CloudPolicySubsystem::CloudPolicySubsystem() { +CloudPolicySubsystem::CloudPolicySubsystem() + : refresh_pref_name_(NULL), + identity_strategy_(NULL) { } } // namespace policy diff --git a/chrome/browser/safe_browsing/malware_details_cache.cc b/chrome/browser/safe_browsing/malware_details_cache.cc index 44e91e8..72ba461 100644 --- a/chrome/browser/safe_browsing/malware_details_cache.cc +++ b/chrome/browser/safe_browsing/malware_details_cache.cc @@ -28,7 +28,10 @@ using safe_browsing::ClientMalwareReportRequest; static const uint32 kMaxBodySizeBytes = 1024; MalwareDetailsCacheCollector::MalwareDetailsCacheCollector() - : has_started_(false), + : resources_(NULL), + result_(NULL), + callback_(NULL), + has_started_(false), current_fetch_(NULL) { } diff --git a/chrome/browser/safe_browsing/malware_details_history.cc b/chrome/browser/safe_browsing/malware_details_history.cc index 63017c0..28d0a378 100644 --- a/chrome/browser/safe_browsing/malware_details_history.cc +++ b/chrome/browser/safe_browsing/malware_details_history.cc @@ -20,6 +20,7 @@ MalwareDetailsRedirectsCollector::MalwareDetailsRedirectsCollector( Profile* profile) : profile_(profile), + callback_(NULL), has_started_(false) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (profile) { diff --git a/chrome/browser/safe_browsing/prefix_set.cc b/chrome/browser/safe_browsing/prefix_set.cc index 7aa19a0..c61cdad 100644 --- a/chrome/browser/safe_browsing/prefix_set.cc +++ b/chrome/browser/safe_browsing/prefix_set.cc @@ -39,7 +39,8 @@ bool PrefixLess(const std::pair<SBPrefix,size_t>& a, namespace safe_browsing { -PrefixSet::PrefixSet(const std::vector<SBPrefix>& sorted_prefixes) { +PrefixSet::PrefixSet(const std::vector<SBPrefix>& sorted_prefixes) + : checksum_(0) { if (sorted_prefixes.size()) { // Lead with the first prefix. SBPrefix prev_prefix = sorted_prefixes[0]; @@ -97,7 +98,8 @@ PrefixSet::PrefixSet(const std::vector<SBPrefix>& sorted_prefixes) { } PrefixSet::PrefixSet(std::vector<std::pair<SBPrefix,size_t> > *index, - std::vector<uint16> *deltas) { + std::vector<uint16> *deltas) + : checksum_(0) { DCHECK(index && deltas); index_.swap(*index); deltas_.swap(*deltas); diff --git a/chrome/browser/sync/engine/sync_scheduler.cc b/chrome/browser/sync/engine/sync_scheduler.cc index 20968c6..10a2d79 100644 --- a/chrome/browser/sync/engine/sync_scheduler.cc +++ b/chrome/browser/sync/engine/sync_scheduler.cc @@ -31,13 +31,18 @@ using sync_pb::GetUpdatesCallerInfo; SyncScheduler::DelayProvider::DelayProvider() {} SyncScheduler::DelayProvider::~DelayProvider() {} -SyncScheduler::WaitInterval::WaitInterval() {} +SyncScheduler::WaitInterval::WaitInterval() + : mode(UNKNOWN), + had_nudge(false) { +} + SyncScheduler::WaitInterval::~WaitInterval() {} #define ENUM_CASE(x) case x: return #x; break; const char* SyncScheduler::WaitInterval::GetModeString(Mode mode) { switch (mode) { + ENUM_CASE(UNKNOWN); ENUM_CASE(EXPONENTIAL_BACKOFF); ENUM_CASE(THROTTLED); } @@ -45,7 +50,11 @@ const char* SyncScheduler::WaitInterval::GetModeString(Mode mode) { return ""; } -SyncScheduler::SyncSessionJob::SyncSessionJob() {} +SyncScheduler::SyncSessionJob::SyncSessionJob() + : purpose(UNKNOWN), + is_canary_job(false) { +} + SyncScheduler::SyncSessionJob::~SyncSessionJob() {} SyncScheduler::SyncSessionJob::SyncSessionJob(SyncSessionJobPurpose purpose, @@ -61,6 +70,7 @@ SyncScheduler::SyncSessionJob::SyncSessionJob(SyncSessionJobPurpose purpose, const char* SyncScheduler::SyncSessionJob::GetPurposeString( SyncScheduler::SyncSessionJob::SyncSessionJobPurpose purpose) { switch (purpose) { + ENUM_CASE(UNKNOWN); ENUM_CASE(POLL); ENUM_CASE(NUDGE); ENUM_CASE(CLEAR_USER_DATA); diff --git a/chrome/browser/sync/engine/sync_scheduler.h b/chrome/browser/sync/engine/sync_scheduler.h index a18a0e3..94769ae 100644 --- a/chrome/browser/sync/engine/sync_scheduler.h +++ b/chrome/browser/sync/engine/sync_scheduler.h @@ -128,6 +128,8 @@ class SyncScheduler : public sessions::SyncSession::Delegate, struct SyncSessionJob { // An enum used to describe jobs for scheduling purposes. enum SyncSessionJobPurpose { + // Uninitialized state, should never be hit in practice. + UNKNOWN = -1, // Our poll timer schedules POLL jobs periodically based on a server // assigned poll interval. POLL, @@ -193,6 +195,8 @@ class SyncScheduler : public sessions::SyncSession::Delegate, struct WaitInterval { enum Mode { + // Uninitialized state, should not be set in practice. + UNKNOWN = -1, // A wait interval whose duration has been affected by exponential // backoff. // EXPONENTIAL_BACKOFF intervals are nudge-rate limited to 1 per interval. diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.cc b/chrome/browser/sync/glue/frontend_data_type_controller.cc index ca1ed73..9a22cb8 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller.cc +++ b/chrome/browser/sync/glue/frontend_data_type_controller.cc @@ -18,7 +18,9 @@ namespace browser_sync { FrontendDataTypeController::FrontendDataTypeController() : profile_sync_factory_(NULL), profile_(NULL), - sync_service_(NULL) {} + sync_service_(NULL), + state_(NOT_RUNNING) { +} FrontendDataTypeController::FrontendDataTypeController( ProfileSyncFactory* profile_sync_factory, diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc index 661583b..5200f5d 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc @@ -19,6 +19,7 @@ NonFrontendDataTypeController::NonFrontendDataTypeController() : profile_sync_factory_(NULL), profile_(NULL), profile_sync_service_(NULL), + state_(NOT_RUNNING), abort_association_(false), abort_association_complete_(false, false), datatype_stopped_(false, false) {} diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index 0a1fbe0..a23cc33 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -66,7 +66,8 @@ SyncSetupWizard::State GetStepForNonFatalError(ProfileSyncService* service) { } // namespace SyncConfiguration::SyncConfiguration() - : sync_everything(false), + : encrypt_all(false), + sync_everything(false), use_secondary_passphrase(false) { } diff --git a/chrome/browser/ui/gtk/global_history_menu.cc b/chrome/browser/ui/gtk/global_history_menu.cc index 23e0179..349d6ea 100644 --- a/chrome/browser/ui/gtk/global_history_menu.cc +++ b/chrome/browser/ui/gtk/global_history_menu.cc @@ -58,6 +58,7 @@ class GlobalHistoryMenu::HistoryItem { public: HistoryItem() : icon_requested(false), + icon_handle(0), menu_item(NULL), session_id(0) {} diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc index bbbc46b..d814aab 100644 --- a/chrome/browser/ui/webui/gpu_internals_ui.cc +++ b/chrome/browser/ui/webui/gpu_internals_ui.cc @@ -194,8 +194,9 @@ std::string GpuHTMLSource::GetMimeType(const std::string&) const { //////////////////////////////////////////////////////////////////////////////// GpuMessageHandler::GpuMessageHandler() - : gpu_info_update_callback_(NULL) - , trace_enabled_(false) { + : gpu_info_update_callback_(NULL), + select_trace_file_dialog_type_(SelectFileDialog::SELECT_NONE), + trace_enabled_(false) { gpu_data_manager_ = GpuDataManager::GetInstance(); DCHECK(gpu_data_manager_); } diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index ecd638d..df9449c 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -354,7 +354,13 @@ const int Extension::kValidWebExtentSchemes = const int Extension::kValidHostPermissionSchemes = UserScript::kValidUserScriptSchemes | URLPattern::SCHEME_CHROMEUI; -Extension::InputComponentInfo::InputComponentInfo() {} +Extension::InputComponentInfo::InputComponentInfo() + : type(INPUT_COMPONENT_TYPE_NONE), + shortcut_alt(false), + shortcut_ctrl(false), + shortcut_shift(false) { +} + Extension::InputComponentInfo::~InputComponentInfo() {} // diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 8f443d1..f2e4b2a 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -113,7 +113,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> { }; enum InputComponentType { - INPUT_COMPONENT_TYPE_IME = 0, + INPUT_COMPONENT_TYPE_NONE = -1, + INPUT_COMPONENT_TYPE_IME, INPUT_COMPONENT_TYPE_VIRTUAL_KEYBOARD, INPUT_COMPONENT_TYPE_COUNT }; diff --git a/chrome/renderer/prerender/prerender_helper.cc b/chrome/renderer/prerender/prerender_helper.cc index 9353f38..053f4ef 100644 --- a/chrome/renderer/prerender/prerender_helper.cc +++ b/chrome/renderer/prerender/prerender_helper.cc @@ -27,7 +27,8 @@ namespace prerender { PrerenderHelper::PrerenderHelper(RenderView* render_view) : RenderViewObserver(render_view), RenderViewObserverTracker<PrerenderHelper>(render_view), - is_prerendering_(true) { + is_prerendering_(true), + has_unrecorded_data_(false) { } PrerenderHelper::~PrerenderHelper() { diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc index f3ecc70..8eb4ca5 100644 --- a/content/browser/renderer_host/media/video_capture_controller.cc +++ b/content/browser/renderer_host/media/video_capture_controller.cc @@ -19,7 +19,9 @@ VideoCaptureController::VideoCaptureController( : render_handle_(render_process), report_ready_to_delete_(false), event_handler_(event_handler), - id_(id) {} + id_(id) { + memset(¶ms_, 0, sizeof(params_)); +} VideoCaptureController::~VideoCaptureController() { // Delete all TransportDIBs. diff --git a/content/browser/resource_context.cc b/content/browser/resource_context.cc index 4e1b977..96f2c26 100644 --- a/content/browser/resource_context.cc +++ b/content/browser/resource_context.cc @@ -16,7 +16,9 @@ ResourceContext::ResourceContext() appcache_service_(NULL), database_tracker_(NULL), file_system_context_(NULL), - blob_storage_context_(NULL) { + blob_storage_context_(NULL), + quota_manager_(NULL), + host_zoom_map_(NULL) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } diff --git a/content/common/content_client.cc b/content/common/content_client.cc index c34765f..559b4b4 100644 --- a/content/common/content_client.cc +++ b/content/common/content_client.cc @@ -16,8 +16,8 @@ ContentClient* GetContentClient() { return g_client; } -ContentClient::ContentClient() : - browser_(NULL), plugin_(NULL), renderer_(NULL) { +ContentClient::ContentClient() + : browser_(NULL), plugin_(NULL), renderer_(NULL), utility_(NULL) { } ContentClient::~ContentClient() { diff --git a/content/common/gpu/transport_texture.cc b/content/common/gpu/transport_texture.cc index f61f2f91..656c619 100644 --- a/content/common/gpu/transport_texture.cc +++ b/content/common/gpu/transport_texture.cc @@ -15,7 +15,8 @@ TransportTexture::TransportTexture(GpuChannel* channel, sender_(sender), decoder_(decoder), host_id_(host_id), - route_id_(route_id) { + route_id_(route_id), + output_textures_(NULL) { } TransportTexture::~TransportTexture() { diff --git a/webkit/glue/context_menu.cc b/webkit/glue/context_menu.cc index ad0d70a..c94ab37 100644 --- a/webkit/glue/context_menu.cc +++ b/webkit/glue/context_menu.cc @@ -17,7 +17,15 @@ CustomContextMenuContext::CustomContextMenuContext() } // namespace webkit_glue -ContextMenuParams::ContextMenuParams() { +ContextMenuParams::ContextMenuParams() + : media_type(WebKit::WebContextMenuData::MediaTypeNone), + x(0), + y(0), + is_image_blocked(false), + media_flags(0), + spellcheck_enabled(false), + is_editable(false), + edit_flags(0) { } ContextMenuParams::ContextMenuParams(const WebKit::WebContextMenuData& data) |