Home | History | Annotate | Download | only in commands

Lines Matching refs:json

141 // object passed in as |json|.
146 const base::DictionaryValue* json,
151 if (json->Get(commands::attributes::kCommand_Parameters, &params_value)) {
155 return Error::AddToPrintf(error, FROM_HERE, errors::json::kObjectExpected,
156 "Property '%s' must be a JSON object",
179 // Get the command JSON object from the value.
180 const base::DictionaryValue* json = nullptr;
181 if (!value->GetAsDictionary(&json)) {
183 return Error::AddTo(error, FROM_HERE, errors::json::kObjectExpected,
184 "Command instance is not a JSON object");
188 if (!json->GetString(commands::attributes::kCommand_Id, command_id))
193 if (!json->GetString(commands::attributes::kCommand_Name, &command_name)) {
198 auto parameters = GetCommandParameters(json, error);
212 if (json->GetString(commands::attributes::kCommand_Component, &component))
219 std::unique_ptr<base::DictionaryValue> json{new base::DictionaryValue};
221 json->SetString(commands::attributes::kCommand_Id, id_);
222 json->SetString(commands::attributes::kCommand_Name, name_);
223 json->Set(commands::attributes::kCommand_Parameters, parameters_.DeepCopy());
224 json->Set(commands::attributes::kCommand_Progress, progress_.DeepCopy());
225 json->Set(commands::attributes::kCommand_Results, results_.DeepCopy());
226 json->SetString(commands::attributes::kCommand_State, EnumToString(state_));
228 json->Set(commands::attributes::kCommand_Error,
232 return json;