Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1133)

Side by Side Diff: chrome/browser/search_engines/template_url_prepopulate_data.cc

Issue 7206058: Coverity: Check a return value. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" 5 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <locale.h> 8 #include <locale.h>
9 #endif 9 #endif
10 10
(...skipping 3410 matching lines...) Expand 10 before | Expand all | Expand 10 after
3421 std::string favicon_url; 3421 std::string favicon_url;
3422 std::string encoding; 3422 std::string encoding;
3423 int search_engine_type; 3423 int search_engine_type;
3424 int logo_id; 3424 int logo_id;
3425 int id; 3425 int id;
3426 3426
3427 size_t num_engines = list->GetSize(); 3427 size_t num_engines = list->GetSize();
3428 for (size_t i = 0; i != num_engines; ++i) { 3428 for (size_t i = 0; i != num_engines; ++i) {
3429 Value* val; 3429 Value* val;
3430 DictionaryValue* engine; 3430 DictionaryValue* engine;
3431 list->GetDictionary(i, &engine); 3431 if (list->GetDictionary(i, &engine) &&
3432 if (engine->Get("name", &val) && val->GetAsString(&name) && 3432 engine->Get("name", &val) && val->GetAsString(&name) &&
3433 engine->Get("keyword", &val) && val->GetAsString(&keyword) && 3433 engine->Get("keyword", &val) && val->GetAsString(&keyword) &&
3434 engine->Get("search_url", &val) && val->GetAsString(&search_url) && 3434 engine->Get("search_url", &val) && val->GetAsString(&search_url) &&
3435 engine->Get("suggest_url", &val) && val->GetAsString(&suggest_url) && 3435 engine->Get("suggest_url", &val) && val->GetAsString(&suggest_url) &&
3436 engine->Get("instant_url", &val) && val->GetAsString(&instant_url) && 3436 engine->Get("instant_url", &val) && val->GetAsString(&instant_url) &&
3437 engine->Get("favicon_url", &val) && val->GetAsString(&favicon_url) && 3437 engine->Get("favicon_url", &val) && val->GetAsString(&favicon_url) &&
3438 engine->Get("encoding", &val) && val->GetAsString(&encoding) && 3438 engine->Get("encoding", &val) && val->GetAsString(&encoding) &&
3439 engine->Get("search_engine_type", &val) && val->GetAsInteger( 3439 engine->Get("search_engine_type", &val) && val->GetAsInteger(
3440 &search_engine_type) && 3440 &search_engine_type) &&
3441 engine->Get("logo_id", &val) && val->GetAsInteger(&logo_id) && 3441 engine->Get("logo_id", &val) && val->GetAsInteger(&logo_id) &&
3442 engine->Get("id", &val) && val->GetAsInteger(&id)) { 3442 engine->Get("id", &val) && val->GetAsInteger(&id)) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
3572 for (size_t i = 0; i < arraysize(kAllEngines); ++i) { 3572 for (size_t i = 0; i < arraysize(kAllEngines); ++i) {
3573 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url)); 3573 std::string url_utf8_string(ToUTF8(kAllEngines[i]->search_url));
3574 GURL url(url_utf8_string); 3574 GURL url(url_utf8_string);
3575 if (origin_to_find == url.GetOrigin()) 3575 if (origin_to_find == url.GetOrigin())
3576 return kAllEngines[i]->logo_id; 3576 return kAllEngines[i]->logo_id;
3577 } 3577 }
3578 return kNoSearchEngineLogo; 3578 return kNoSearchEngineLogo;
3579 } 3579 }
3580 3580
3581 } // namespace TemplateURLPrepopulateData 3581 } // namespace TemplateURLPrepopulateData
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698