diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 20:34:43 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 20:34:43 +0000 |
commit | 88942a2dab7da11dc89b4fe95151fdefa6cef036 (patch) | |
tree | 3047b9779e5b8b8a9a04c26e83ebc478e825f4b5 /chrome/browser/dom_ui/dom_ui_util.cc | |
parent | 2acaa4de809c66b8b826e3bf93930e2b3bf4c65f (diff) | |
download | chromium_src-88942a2dab7da11dc89b4fe95151fdefa6cef036.zip chromium_src-88942a2dab7da11dc89b4fe95151fdefa6cef036.tar.gz chromium_src-88942a2dab7da11dc89b4fe95151fdefa6cef036.tar.bz2 |
DOM UI: Change DOMMessageHandler callback arg type to ListValue.
The parameter describes a list of Values that act as parameters to the callback. It is always a ListValue. It should be typed as such.
BUG=none
TEST=compile; manual testing
Review URL: http://codereview.chromium.org/3146019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/dom_ui_util.cc')
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_util.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/browser/dom_ui/dom_ui_util.cc b/chrome/browser/dom_ui/dom_ui_util.cc index e247655..d2030e4 100644 --- a/chrome/browser/dom_ui/dom_ui_util.cc +++ b/chrome/browser/dom_ui/dom_ui_util.cc @@ -9,19 +9,13 @@ namespace dom_ui_util { -std::string GetJsonResponseFromFirstArgumentInList(const Value* content) { - return GetJsonResponseFromArgumentList(content, 0); +std::string GetJsonResponseFromFirstArgumentInList(const ListValue* args) { + return GetJsonResponseFromArgumentList(args, 0); } -std::string GetJsonResponseFromArgumentList(const Value* content, +std::string GetJsonResponseFromArgumentList(const ListValue* args, size_t list_index) { std::string result; - - if (!content || !content->IsType(Value::TYPE_LIST)) { - NOTREACHED(); - return result; - } - const ListValue* args = static_cast<const ListValue*>(content); if (args->GetSize() <= list_index) { NOTREACHED(); return result; @@ -30,6 +24,8 @@ std::string GetJsonResponseFromArgumentList(const Value* content, Value* value = NULL; if (args->Get(list_index, &value)) value->GetAsString(&result); + else + NOTREACHED(); return result; } |