Commit 4518b61f authored by danhn@chromium.org's avatar danhn@chromium.org

Fixed the following warnings:

CID=104268,104216,104131,104058


Review URL: https://chromiumcodereview.appspot.com/10830022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148638 0039d316-1c4b-4281-b951-d872f2087c98
parent 91ede468
...@@ -43,6 +43,8 @@ const base::Value* ManagedModePolicyProvider::GetPolicy( ...@@ -43,6 +43,8 @@ const base::Value* ManagedModePolicyProvider::GetPolicy(
const std::string& key) const { const std::string& key) const {
base::DictionaryValue* dict = GetCachedPolicy(); base::DictionaryValue* dict = GetCachedPolicy();
base::Value* value = NULL; base::Value* value = NULL;
// Returns NULL if the key doesn't exist.
dict->GetWithoutPathExpansion(key, &value); dict->GetWithoutPathExpansion(key, &value);
return value; return value;
} }
......
...@@ -88,9 +88,10 @@ bool LoadHighestPriorityKey(const string16& key_path, ...@@ -88,9 +88,10 @@ bool LoadHighestPriorityKey(const string16& key_path,
string16 path(kKeyPaths[k].path); string16 path(kKeyPaths[k].path);
if (!key_path.empty()) if (!key_path.empty())
path += kPathSep + key_path; path += kPathSep + key_path;
key->Open(kHives[h].hive, path.c_str(), KEY_READ); if (key->Open(kHives[h].hive, path.c_str(), KEY_READ) != ERROR_SUCCESS ||
if (!key->Valid()) !key->Valid()) {
continue; continue;
}
if (value_name.empty() || key->HasValue(value_name.c_str())) { if (value_name.empty() || key->HasValue(value_name.c_str())) {
*level = kKeyPaths[k].level; *level = kKeyPaths[k].level;
*scope = kHives[h].scope; *scope = kHives[h].scope;
......
...@@ -98,8 +98,8 @@ ValueStore::WriteResult TestingValueStore::Set( ...@@ -98,8 +98,8 @@ ValueStore::WriteResult TestingValueStore::Set(
scoped_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList()); scoped_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList());
for (DictionaryValue::Iterator it(settings); it.HasNext(); it.Advance()) { for (DictionaryValue::Iterator it(settings); it.HasNext(); it.Advance()) {
Value* old_value = NULL; Value* old_value = NULL;
storage_.GetWithoutPathExpansion(it.key(), &old_value); if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) ||
if (!old_value || !old_value->Equals(&it.value())) { !old_value->Equals(&it.value())) {
changes->push_back( changes->push_back(
ValueStoreChange( ValueStoreChange(
it.key(), it.key(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment