Chromium Code Reviews| Index: chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| index 2604a1acd8649a52cf054ddd749d2c1ccb66a81c..29aded24b078063a7609f281a18c8abc5bcdfb81 100644 |
| --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| @@ -388,7 +388,7 @@ void DeveloperPrivateEventRouter::BroadcastItemStateChangedHelper( |
| developer::EventType event_type, |
| const std::string& extension_id, |
| scoped_ptr<ExtensionInfoGenerator> info_generator, |
| - const ExtensionInfoGenerator::ExtensionInfoList& infos) { |
| + ExtensionInfoGenerator::ExtensionInfoList infos) { |
| DCHECK_LE(infos.size(), 1u); |
| developer::EventData event_data; |
| @@ -402,7 +402,7 @@ void DeveloperPrivateEventRouter::BroadcastItemStateChangedHelper( |
| // scoped ptr, and so ownership between that and the vector of linked ptrs |
|
asargent_no_longer_on_chrome
2016/03/21 21:03:13
is this part of the comment about "vector of linke
Devlin
2016/03/21 22:24:27
Good call! We can actually completely remove this
|
| // here is, well, messy. Easier to just set it like this. |
| dict->SetWithoutPathExpansion("extensionInfo", |
| - infos[0]->ToValue().release()); |
| + infos[0].ToValue().release()); |
| } |
| scoped_ptr<base::ListValue> args(new base::ListValue()); |
| @@ -510,7 +510,7 @@ DeveloperPrivateGetExtensionsInfoFunction::Run() { |
| } |
| void DeveloperPrivateGetExtensionsInfoFunction::OnInfosGenerated( |
| - const ExtensionInfoGenerator::ExtensionInfoList& list) { |
| + ExtensionInfoGenerator::ExtensionInfoList list) { |
| Respond(ArgumentList(developer::GetExtensionsInfo::Results::Create(list))); |
| } |
| @@ -538,11 +538,10 @@ DeveloperPrivateGetExtensionInfoFunction::Run() { |
| } |
| void DeveloperPrivateGetExtensionInfoFunction::OnInfosGenerated( |
| - const ExtensionInfoGenerator::ExtensionInfoList& list) { |
| - DCHECK_EQ(1u, list.size()); |
| - const linked_ptr<developer::ExtensionInfo>& info = list[0]; |
| - Respond(info.get() ? OneArgument(info->ToValue()) : |
| - Error(kNoSuchExtensionError)); |
| + ExtensionInfoGenerator::ExtensionInfoList list) { |
| + DCHECK_LE(1u, list.size()); |
| + Respond(list.empty() ? Error(kNoSuchExtensionError) |
| + : OneArgument(list[0].ToValue())); |
| } |
| DeveloperPrivateGetItemsInfoFunction::DeveloperPrivateGetItemsInfoFunction() {} |
| @@ -564,10 +563,10 @@ ExtensionFunction::ResponseAction DeveloperPrivateGetItemsInfoFunction::Run() { |
| } |
| void DeveloperPrivateGetItemsInfoFunction::OnInfosGenerated( |
| - const ExtensionInfoGenerator::ExtensionInfoList& list) { |
| - std::vector<linked_ptr<developer::ItemInfo>> item_list; |
| - for (const linked_ptr<developer::ExtensionInfo>& info : list) |
| - item_list.push_back(developer_private_mangle::MangleExtensionInfo(*info)); |
| + ExtensionInfoGenerator::ExtensionInfoList list) { |
| + std::vector<developer::ItemInfo> item_list; |
| + for (const developer::ExtensionInfo& info : list) |
| + item_list.push_back(developer_private_mangle::MangleExtensionInfo(info)); |
| Respond(ArgumentList(developer::GetItemsInfo::Results::Create(item_list))); |
| } |