summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 22:34:40 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 22:34:40 +0000
commit4f2063cce10295e8b982e98d466c9130d754a540 (patch)
treea26ddb59d9ed3b67100d90216c5af35abfb0eb6f /chrome/browser/webdata
parent93270d001be703684c1c1bd1e28be7e553a19c99 (diff)
downloadchromium_src-4f2063cce10295e8b982e98d466c9130d754a540.zip
chromium_src-4f2063cce10295e8b982e98d466c9130d754a540.tar.gz
chromium_src-4f2063cce10295e8b982e98d466c9130d754a540.tar.bz2
Initialized pair_id variable to 0.
This variable was uninitialized and the compiler gave a warning (which got converted into an error because we compile using -Werror) when GetIDAndCountOfFormElement() and its children are inlined. This is because there is a path in that function that returns true but leaves the pair_id variable uninitialized (if s.Step() is 0). Note that I am not a Chromium committer so you will have to commit this. Patch by asharif; http://codereview.chromium.org/6293011/ BUG=70144 TEST=no visible change git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata')
-rw-r--r--chrome/browser/webdata/web_database.cc3
-rw-r--r--chrome/browser/webdata/web_database.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc
index 6e4a3fb..eea663c 100644
--- a/chrome/browser/webdata/web_database.cc
+++ b/chrome/browser/webdata/web_database.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.
@@ -1202,6 +1202,7 @@ bool WebDatabase::GetIDAndCountOfFormElement(
s.BindString16(0, element.name());
s.BindString16(1, element.value());
+ *pair_id = 0;
*count = 0;
if (s.Step()) {
diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h
index 17bc19c..0356381 100644
--- a/chrome/browser/webdata/web_database.h
+++ b/chrome/browser/webdata/web_database.h
@@ -183,7 +183,8 @@ class WebDatabase {
bool AddToCountOfFormElement(int64 pair_id, int delta, bool* was_removed);
// Gets the pair_id and count entries from name and value specified in
- // |element|. Sets *count to 0 if there is no such row in the table.
+ // |element|. Sets *pair_id and *count to 0 if there is no such row in
+ // the table.
bool GetIDAndCountOfFormElement(const webkit_glue::FormField& element,
int64* pair_id,
int* count);