| Index: chrome/browser/extensions/api/debugger/debugger_api.cc
|
| diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
|
| index 23426917cb77b888d18df25c4e7a73e40ae33e9a..85549bb40c711b52e1da2ab3c4fc0da3a8c487ce 100644
|
| --- a/chrome/browser/extensions/api/debugger/debugger_api.cc
|
| +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
|
| @@ -176,6 +176,25 @@ class AttachedClientHosts {
|
| std::set<DevToolsClientHost*> client_hosts_;
|
| };
|
|
|
| +scoped_ptr<base::DictionaryValue> ValueMapToDictionary(
|
| + const std::map<std::string, linked_ptr<base::Value> >& values) {
|
| + scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
|
| + for (std::map<std::string, linked_ptr<base::Value> >::const_iterator it =
|
| + values.begin();
|
| + it != values.end(); ++it) {
|
| + dict->SetWithoutPathExpansion(it->first, it->second->DeepCopy());
|
| + }
|
| + return dict.Pass();
|
| +}
|
| +
|
| +std::map<std::string, linked_ptr<base::Value> > DictionaryToValueMap(
|
| + const base::DictionaryValue& dict) {
|
| + std::map<std::string, linked_ptr<base::Value> > values;
|
| + for (DictionaryValue::Iterator it(dict); it.HasNext(); it.Advance())
|
| + values[it.key()] = make_linked_ptr(it.value().DeepCopy());
|
| + return values;
|
| +}
|
| +
|
| } // namespace
|
|
|
| ExtensionDevToolsClientHost::ExtensionDevToolsClientHost(
|
| @@ -259,8 +278,9 @@ void ExtensionDevToolsClientHost::SendMessageToBackend(
|
| protocol_request.SetInteger("id", request_id);
|
| protocol_request.SetString("method", method);
|
| if (command_params) {
|
| - protocol_request.Set("params",
|
| - command_params->additional_properties.DeepCopy());
|
| + protocol_request.Set(
|
| + "params",
|
| + ValueMapToDictionary(command_params->additional_properties).release());
|
| }
|
|
|
| std::string json_args;
|
| @@ -335,7 +355,7 @@ void ExtensionDevToolsClientHost::DispatchOnInspectorFrontend(
|
| OnEvent::Params params;
|
| DictionaryValue* params_value;
|
| if (dictionary->GetDictionary("params", ¶ms_value))
|
| - params.additional_properties.Swap(params_value);
|
| + params.additional_properties = DictionaryToValueMap(*params_value);
|
|
|
| scoped_ptr<ListValue> args(OnEvent::Create(debuggee, method_name, params));
|
| scoped_ptr<extensions::Event> event(new extensions::Event(
|
| @@ -543,7 +563,7 @@ void SendCommandDebuggerFunction::SendResponseBody(
|
| DictionaryValue* result_body;
|
| SendCommand::Results::Result result;
|
| if (response->GetDictionary("result", &result_body))
|
| - result.additional_properties.Swap(result_body);
|
| + result.additional_properties = DictionaryToValueMap(*result_body);
|
|
|
| results_ = SendCommand::Results::Create(result);
|
| SendResponse(true);
|
|
|