Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1333)

Unified Diff: chrome/browser/extensions/api/tabs/windows_event_router.cc

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tabs/windows_event_router.cc
diff --git a/chrome/browser/extensions/api/tabs/windows_event_router.cc b/chrome/browser/extensions/api/tabs/windows_event_router.cc
index 450bb9aa81a738fc440bc97ec8e984bc767458ad..6a85fc10464b579e3623f20a66fc51c437baba42 100644
--- a/chrome/browser/extensions/api/tabs/windows_event_router.cc
+++ b/chrome/browser/extensions/api/tabs/windows_event_router.cc
@@ -252,9 +252,9 @@ void WindowsEventRouter::OnActiveWindowChanged(
if (!HasEventListener(windows::OnFocusChanged::kEventName))
return;
- std::unique_ptr<Event> event(new Event(
+ std::unique_ptr<Event> event = base::MakeUnique<Event>(
events::WINDOWS_ON_FOCUS_CHANGED, windows::OnFocusChanged::kEventName,
- base::WrapUnique(new base::ListValue())));
+ base::MakeUnique<base::ListValue>());
event->will_dispatch_callback =
base::Bind(&WillDispatchWindowFocusedEvent, window_controller);
EventRouter::Get(profile_)->BroadcastEvent(std::move(event));
@@ -264,8 +264,8 @@ void WindowsEventRouter::DispatchEvent(events::HistogramValue histogram_value,
const std::string& event_name,
WindowController* window_controller,
std::unique_ptr<base::ListValue> args) {
- std::unique_ptr<Event> event(
- new Event(histogram_value, event_name, std::move(args)));
+ std::unique_ptr<Event> event =
+ base::MakeUnique<Event>(histogram_value, event_name, std::move(args));
event->restrict_to_browser_context = window_controller->profile();
event->will_dispatch_callback =
base::Bind(&WillDispatchWindowEvent, window_controller);
@@ -278,7 +278,7 @@ bool WindowsEventRouter::HasEventListener(const std::string& event_name) {
void WindowsEventRouter::AddAppWindow(extensions::AppWindow* app_window) {
std::unique_ptr<AppWindowController> controller(new AppWindowController(
- app_window, base::WrapUnique(new AppBaseWindow(app_window)), profile_));
+ app_window, base::MakeUnique<AppBaseWindow>(app_window), profile_));
app_windows_[app_window->session_id().id()] = std::move(controller);
}

Powered by Google App Engine
This is Rietveld 408576698