diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 10:45:01 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 10:45:01 +0000 |
commit | 0cf986fdacf68aa07f1edbd907d5d1b336950c22 (patch) | |
tree | 2ca577940ce466210e2cfe16270285a54a2f70ef /ppapi | |
parent | ff4968f34d58e12a60cc1cee2ef4d3a9692bf740 (diff) | |
download | chromium_src-0cf986fdacf68aa07f1edbd907d5d1b336950c22.zip chromium_src-0cf986fdacf68aa07f1edbd907d5d1b336950c22.tar.gz chromium_src-0cf986fdacf68aa07f1edbd907d5d1b336950c22.tar.bz2 |
Initialize a few uninitialized member variables and structs in PPAPI.
BUG=None
TEST=None
CID=14043, 14386, 14232, 14230, 14112, 14111, 14110, 14109, 14108, 14231, 14042, 14187, 14664.
Review URL: http://codereview.chromium.org/6676145
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/cpp/paint_aggregator.cc | 4 | ||||
-rw-r--r-- | ppapi/cpp/var.cc | 10 | ||||
-rw-r--r-- | ppapi/cpp/var.h | 8 | ||||
-rw-r--r-- | ppapi/proxy/ppb_var_deprecated_proxy.cc | 2 | ||||
-rw-r--r-- | ppapi/proxy/serialized_structs.cc | 8 | ||||
-rw-r--r-- | ppapi/proxy/serialized_var.cc | 4 |
6 files changed, 26 insertions, 10 deletions
diff --git a/ppapi/cpp/paint_aggregator.cc b/ppapi/cpp/paint_aggregator.cc index 1138974..d0ab03e 100644 --- a/ppapi/cpp/paint_aggregator.cc +++ b/ppapi/cpp/paint_aggregator.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,7 +25,7 @@ namespace pp { -PaintAggregator::PaintUpdate::PaintUpdate() {} +PaintAggregator::PaintUpdate::PaintUpdate() : has_scroll(false) {} PaintAggregator::PaintUpdate::~PaintUpdate() {} diff --git a/ppapi/cpp/var.cc b/ppapi/cpp/var.cc index 43bc869..09a91d8 100644 --- a/ppapi/cpp/var.cc +++ b/ppapi/cpp/var.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -44,28 +44,33 @@ using namespace deprecated; Var::Var() { var_.type = PP_VARTYPE_UNDEFINED; + var_.padding = 0; needs_release_ = false; } Var::Var(Null) { var_.type = PP_VARTYPE_NULL; + var_.padding = 0; needs_release_ = false; } Var::Var(bool b) { var_.type = PP_VARTYPE_BOOL; + var_.padding = 0; var_.value.as_bool = BoolToPPBool(b); needs_release_ = false; } Var::Var(int32_t i) { var_.type = PP_VARTYPE_INT32; + var_.padding = 0; var_.value.as_int = i; needs_release_ = false; } Var::Var(double d) { var_.type = PP_VARTYPE_DOUBLE; + var_.padding = 0; var_.value.as_double = d; needs_release_ = false; } @@ -77,6 +82,7 @@ Var::Var(const char* utf8_str) { Module::Get()->pp_module(), utf8_str, len); } else { var_.type = PP_VARTYPE_NULL; + var_.padding = 0; } needs_release_ = (var_.type == PP_VARTYPE_STRING); } @@ -89,6 +95,7 @@ Var::Var(const std::string& utf8_str) { static_cast<uint32_t>(utf8_str.size())); } else { var_.type = PP_VARTYPE_NULL; + var_.padding = 0; } needs_release_ = (var_.type == PP_VARTYPE_STRING); } @@ -100,6 +107,7 @@ Var::Var(Instance* instance, ScriptableObject* object) { needs_release_ = true; } else { var_.type = PP_VARTYPE_NULL; + var_.padding = 0; needs_release_ = false; } } diff --git a/ppapi/cpp/var.h b/ppapi/cpp/var.h index e055cad..0154fd3 100644 --- a/ppapi/cpp/var.h +++ b/ppapi/cpp/var.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -171,10 +171,12 @@ class Var { OutException(Var* v) : output_(v), originally_had_exception_(v && v->is_null()) { - if (output_) + if (output_) { temp_ = output_->var_; - else + } else { + temp_.padding = 0; temp_.type = PP_VARTYPE_UNDEFINED; + } } ~OutException() { if (output_ && !originally_had_exception_) diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.cc b/ppapi/proxy/ppb_var_deprecated_proxy.cc index f1b7f8b..9571689 100644 --- a/ppapi/proxy/ppb_var_deprecated_proxy.cc +++ b/ppapi/proxy/ppb_var_deprecated_proxy.cc @@ -59,7 +59,7 @@ void ReleaseVar(PP_Var var) { } PP_Var VarFromUtf8(PP_Module module, const char* data, uint32_t len) { - PP_Var ret; + PP_Var ret = {}; ret.type = PP_VARTYPE_STRING; ret.value.as_id = PluginVarTracker::GetInstance()->MakeString( data, len); diff --git a/ppapi/proxy/serialized_structs.cc b/ppapi/proxy/serialized_structs.cc index 1e9ded0..142a926 100644 --- a/ppapi/proxy/serialized_structs.cc +++ b/ppapi/proxy/serialized_structs.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -71,6 +71,12 @@ PPBFlash_DrawGlyphs_Params::PPBFlash_DrawGlyphs_Params() : instance(0), font_desc(), color(0) { + clip.point.x = 0; + clip.point.y = 0; + clip.size.height = 0; + clip.size.width = 0; + position.x = 0; + position.y = 0; } PPBFlash_DrawGlyphs_Params::~PPBFlash_DrawGlyphs_Params() {} diff --git a/ppapi/proxy/serialized_var.cc b/ppapi/proxy/serialized_var.cc index 71c0eed..12df2cc 100644 --- a/ppapi/proxy/serialized_var.cc +++ b/ppapi/proxy/serialized_var.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -510,7 +510,7 @@ SerializedVarTestConstructor::SerializedVarTestConstructor( SerializedVarTestConstructor::SerializedVarTestConstructor( const std::string& str) { - PP_Var string_var; + PP_Var string_var = {}; string_var.type = PP_VARTYPE_STRING; string_var.value.as_id = 0; inner_->SetVar(string_var); |