diff options
author | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-26 01:54:00 +0000 |
---|---|---|
committer | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-26 01:54:00 +0000 |
commit | 0de764e26db70294974f67061ab2d991c739e27f (patch) | |
tree | c3d7cfa40628e20496f65ce7abd56daebc521077 /chrome/browser/autocomplete/search_provider.cc | |
parent | 79d0b6726455b644b1a2532cea21a421ce2f9990 (diff) | |
download | chromium_src-0de764e26db70294974f67061ab2d991c739e27f.zip chromium_src-0de764e26db70294974f67061ab2d991c739e27f.tar.gz chromium_src-0de764e26db70294974f67061ab2d991c739e27f.tar.bz2 |
Revert recent changes to base::Value
Reverts:
98223: base: Add AsList() function to Value API.
98266: base: Add AsBinary() function to Value API.
There are two issues with these commits:
1. libcros uses base::Value to pass data to Chrome. It includes values.h from libchrome which contains its own copy. This is a terrible design flaw in libcros and is being addressed (http://crosbug.com/19576), however we need some time to address this before we can make these changes without breaking Chrome on ChromeOS.
2. AsList() and AsBinary() should be const. The fact that they were not const caused re-factoring that changed const Value& input arguments to Value*, which is against the spec. When we re-introduce this, these members should be made const.
BUG=chromium-os:19604
TEST=Check bots + ChromeOS autotests
Review URL: http://codereview.chromium.org/7753020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98378 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/search_provider.cc')
-rw-r--r-- | chrome/browser/autocomplete/search_provider.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index 8bd3478..1dae40a 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -452,9 +452,9 @@ bool SearchProvider::ParseSuggestResults(Value* root_val, bool is_keyword, const string16& input_text, SuggestResults* suggest_results) { - ListValue* root_list = root_val->AsList(); - if (!root_list) + if (!root_val->IsType(Value::TYPE_LIST)) return false; + ListValue* root_list = static_cast<ListValue*>(root_val); Value* query_val; string16 query_str; @@ -462,15 +462,16 @@ bool SearchProvider::ParseSuggestResults(Value* root_val, if ((root_list->GetSize() < 2) || !root_list->Get(0, &query_val) || !query_val->GetAsString(&query_str) || (query_str != input_text) || - !root_list->Get(1, &result_val) || !result_val->AsList()) + !root_list->Get(1, &result_val) || !result_val->IsType(Value::TYPE_LIST)) return false; ListValue* description_list = NULL; if (root_list->GetSize() > 2) { // 3rd element: Description list. Value* description_val; - if (root_list->Get(2, &description_val)) - description_list = description_val->AsList(); + if (root_list->Get(2, &description_val) && + description_val->IsType(Value::TYPE_LIST)) + description_list = static_cast<ListValue*>(description_val); } // We don't care about the query URL list (the fourth element in the |