| Index: chrome/browser/extensions/menu_manager.cc
|
| diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc
|
| index 7bfaf2d878036e95e6b304c81feb3af05259602f..78f5766ef1dcbd8836e5fdf9b285c6a0815a1b4d 100644
|
| --- a/chrome/browser/extensions/menu_manager.cc
|
| +++ b/chrome/browser/extensions/menu_manager.cc
|
| @@ -663,14 +663,14 @@ void MenuManager::ExecuteCommand(content::BrowserContext* context,
|
| webview_guest->view_instance_id());
|
| }
|
|
|
| - auto args = base::MakeUnique<base::ListValue>();
|
| - args->Reserve(2);
|
| - args->Append(std::move(properties));
|
| + auto args = base::MakeUnique<base::Value>();
|
| + args->GetList().reserve(2);
|
| + args->GetList().push_back(std::move(*properties));
|
| // |properties| is invalidated at this time, which is why |args| needs to be
|
| // queried for the pointer. The obtained pointer is guaranteed to stay valid
|
| // even after further Appends, because enough storage was reserved above.
|
| - base::DictionaryValue* raw_properties = nullptr;
|
| - args->GetDictionary(0, &raw_properties);
|
| + base::DictionaryValue* raw_properties =
|
| + static_cast<base::DictionaryValue*>(&args->GetList()[0]);
|
|
|
| // Add the tab info to the argument list.
|
| // No tab info in a platform app.
|
| @@ -681,9 +681,10 @@ void MenuManager::ExecuteCommand(content::BrowserContext* context,
|
| if (frame_id != ExtensionApiFrameIdMap::kInvalidFrameId)
|
| raw_properties->SetInteger("frameId", frame_id);
|
|
|
| - args->Append(ExtensionTabUtil::CreateTabObject(web_contents)->ToValue());
|
| + args->GetList().push_back(
|
| + *ExtensionTabUtil::CreateTabObject(web_contents)->ToValue());
|
| } else {
|
| - args->Append(base::MakeUnique<base::DictionaryValue>());
|
| + args->GetList().push_back(base::DictionaryValue());
|
| }
|
| }
|
|
|
| @@ -718,7 +719,7 @@ void MenuManager::ExecuteCommand(content::BrowserContext* context,
|
| new Event(webview_guest ? events::WEB_VIEW_INTERNAL_CONTEXT_MENUS
|
| : events::CONTEXT_MENUS,
|
| webview_guest ? kOnWebviewContextMenus : kOnContextMenus,
|
| - std::unique_ptr<base::ListValue>(args->DeepCopy())));
|
| + base::ListValue::From(args->CreateDeepCopy())));
|
| event->restrict_to_browser_context = context;
|
| event->user_gesture = EventRouter::USER_GESTURE_ENABLED;
|
| event_router->DispatchEventToExtension(item->extension_id(),
|
| @@ -731,7 +732,7 @@ void MenuManager::ExecuteCommand(content::BrowserContext* context,
|
| : events::CONTEXT_MENUS_ON_CLICKED,
|
| webview_guest ? api::chrome_web_view_internal::OnClicked::kEventName
|
| : api::context_menus::OnClicked::kEventName,
|
| - std::move(args)));
|
| + base::ListValue::From(std::move(args))));
|
| event->restrict_to_browser_context = context;
|
| event->user_gesture = EventRouter::USER_GESTURE_ENABLED;
|
| if (webview_guest)
|
|
|