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

Side by Side Diff: chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat e_api.h" 5 #include "chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_privat e_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 EventRouter* router = EventRouter::Get(browser_context_); 90 EventRouter* router = EventRouter::Get(browser_context_);
91 if (!router || !router->HasEventListener(kEventName)) 91 if (!router || !router->HasEventListener(kEventName))
92 return; 92 return;
93 93
94 for (const scoped_refptr<const extensions::Extension>& extension : 94 for (const scoped_refptr<const extensions::Extension>& extension :
95 ExtensionRegistry::Get(browser_context_)->enabled_extensions()) { 95 ExtensionRegistry::Get(browser_context_)->enabled_extensions()) {
96 const std::string& extension_id = extension->id(); 96 const std::string& extension_id = extension->id();
97 if (router->ExtensionHasEventListener(extension_id, kEventName) && 97 if (router->ExtensionHasEventListener(extension_id, kEventName) &&
98 extension->permissions_data()->HasAPIPermission("webrtcAudioPrivate")) { 98 extension->permissions_data()->HasAPIPermission("webrtcAudioPrivate")) {
99 std::unique_ptr<Event> event( 99 std::unique_ptr<Event> event(
100 new Event(events::WEBRTC_AUDIO_PRIVATE_ON_SINKS_CHANGED, kEventName, 100 new Event(events::WEBRTC_AUDIO_PRIVATE_ON_SINKS_CHANGED, kEventName,
Devlin 2016/08/29 15:10:01 MakeUnique
Adam Rice 2016/08/30 07:03:00 Done.
101 base::WrapUnique(new base::ListValue()))); 101 base::MakeUnique<base::ListValue>()));
102 router->DispatchEventToExtension(extension_id, std::move(event)); 102 router->DispatchEventToExtension(extension_id, std::move(event));
103 } 103 }
104 } 104 }
105 } 105 }
106 106
107 WebrtcAudioPrivateFunction::WebrtcAudioPrivateFunction() {} 107 WebrtcAudioPrivateFunction::WebrtcAudioPrivateFunction() {}
108 108
109 WebrtcAudioPrivateFunction::~WebrtcAudioPrivateFunction() { 109 WebrtcAudioPrivateFunction::~WebrtcAudioPrivateFunction() {
110 } 110 }
111 111
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 results_.reset(wap::GetAssociatedSink::Results::Create("").release()); 497 results_.reset(wap::GetAssociatedSink::Results::Create("").release());
498 } else { 498 } else {
499 results_.reset( 499 results_.reset(
500 wap::GetAssociatedSink::Results::Create(associated_sink_id).release()); 500 wap::GetAssociatedSink::Results::Create(associated_sink_id).release());
501 } 501 }
502 502
503 SendResponse(true); 503 SendResponse(true);
504 } 504 }
505 505
506 } // namespace extensions 506 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698