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

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

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 12 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>
8
7 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
8 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
9 #include "base/task_runner_util.h" 11 #include "base/task_runner_util.h"
10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 12 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
11 #include "chrome/browser/extensions/extension_tab_util.h" 13 #include "chrome/browser/extensions/extension_tab_util.h"
12 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
13 #include "content/public/browser/media_device_id.h" 15 #include "content/public/browser/media_device_id.h"
14 #include "content/public/browser/resource_context.h" 16 #include "content/public/browser/resource_context.h"
15 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
16 #include "extensions/browser/event_router.h" 18 #include "extensions/browser/event_router.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (!router || !router->HasEventListener(kEventName)) 88 if (!router || !router->HasEventListener(kEventName))
87 return; 89 return;
88 90
89 for (const scoped_refptr<const extensions::Extension>& extension : 91 for (const scoped_refptr<const extensions::Extension>& extension :
90 ExtensionRegistry::Get(browser_context_)->enabled_extensions()) { 92 ExtensionRegistry::Get(browser_context_)->enabled_extensions()) {
91 const std::string& extension_id = extension->id(); 93 const std::string& extension_id = extension->id();
92 if (router->ExtensionHasEventListener(extension_id, kEventName) && 94 if (router->ExtensionHasEventListener(extension_id, kEventName) &&
93 extension->permissions_data()->HasAPIPermission("webrtcAudioPrivate")) { 95 extension->permissions_data()->HasAPIPermission("webrtcAudioPrivate")) {
94 scoped_ptr<Event> event( 96 scoped_ptr<Event> event(
95 new Event(events::WEBRTC_AUDIO_PRIVATE_ON_SINKS_CHANGED, kEventName, 97 new Event(events::WEBRTC_AUDIO_PRIVATE_ON_SINKS_CHANGED, kEventName,
96 make_scoped_ptr(new base::ListValue()).Pass())); 98 make_scoped_ptr(new base::ListValue())));
97 router->DispatchEventToExtension(extension_id, event.Pass()); 99 router->DispatchEventToExtension(extension_id, std::move(event));
98 } 100 }
99 } 101 }
100 } 102 }
101 103
102 WebrtcAudioPrivateFunction::WebrtcAudioPrivateFunction() 104 WebrtcAudioPrivateFunction::WebrtcAudioPrivateFunction()
103 : resource_context_(NULL) { 105 : resource_context_(NULL) {
104 } 106 }
105 107
106 WebrtcAudioPrivateFunction::~WebrtcAudioPrivateFunction() { 108 WebrtcAudioPrivateFunction::~WebrtcAudioPrivateFunction() {
107 } 109 }
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 results_.reset(wap::GetAssociatedSink::Results::Create("").release()); 504 results_.reset(wap::GetAssociatedSink::Results::Create("").release());
503 } else { 505 } else {
504 results_.reset( 506 results_.reset(
505 wap::GetAssociatedSink::Results::Create(associated_sink_id).release()); 507 wap::GetAssociatedSink::Results::Create(associated_sink_id).release());
506 } 508 }
507 509
508 SendResponse(true); 510 SendResponse(true);
509 } 511 }
510 512
511 } // namespace extensions 513 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698