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

Side by Side Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc

Issue 1991083002: Remove ExtensionFunction::SetResult(T*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/desktop_capture/desktop_capture_base.h" 5 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 render_frame_host()->GetProcess()->GetID(), request_id_); 58 render_frame_host()->GetProcess()->GetID(), request_id_);
59 } 59 }
60 } 60 }
61 61
62 void DesktopCaptureChooseDesktopMediaFunctionBase::Cancel() { 62 void DesktopCaptureChooseDesktopMediaFunctionBase::Cancel() {
63 // Keep reference to |this| to ensure the object doesn't get destroyed before 63 // Keep reference to |this| to ensure the object doesn't get destroyed before
64 // we return. 64 // we return.
65 scoped_refptr<DesktopCaptureChooseDesktopMediaFunctionBase> self(this); 65 scoped_refptr<DesktopCaptureChooseDesktopMediaFunctionBase> self(this);
66 if (picker_) { 66 if (picker_) {
67 picker_.reset(); 67 picker_.reset();
68 SetResult(new base::StringValue(std::string())); 68 SetResult(base::MakeUnique<base::StringValue>(std::string()));
69 SendResponse(true); 69 SendResponse(true);
70 } 70 }
71 } 71 }
72 72
73 bool DesktopCaptureChooseDesktopMediaFunctionBase::Execute( 73 bool DesktopCaptureChooseDesktopMediaFunctionBase::Execute(
74 const std::vector<api::desktop_capture::DesktopCaptureSourceType>& sources, 74 const std::vector<api::desktop_capture::DesktopCaptureSourceType>& sources,
75 content::WebContents* web_contents, 75 content::WebContents* web_contents,
76 const GURL& origin, 76 const GURL& origin,
77 const base::string16 target_name) { 77 const base::string16 target_name) {
78 // Register to be notified when the tab is closed. 78 // Register to be notified when the tab is closed.
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest(). 223 // MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest().
224 // http://crbug.com/304341 224 // http://crbug.com/304341
225 content::RenderFrameHost* const main_frame = web_contents()->GetMainFrame(); 225 content::RenderFrameHost* const main_frame = web_contents()->GetMainFrame();
226 result = registry->RegisterStream(main_frame->GetProcess()->GetID(), 226 result = registry->RegisterStream(main_frame->GetProcess()->GetID(),
227 main_frame->GetRoutingID(), 227 main_frame->GetRoutingID(),
228 origin_, 228 origin_,
229 source, 229 source,
230 extension()->name()); 230 extension()->name());
231 } 231 }
232 232
233 SetResult(new base::StringValue(result)); 233 SetResult(base::MakeUnique<base::StringValue>(result));
234 SendResponse(true); 234 SendResponse(true);
235 } 235 }
236 236
237 DesktopCaptureRequestsRegistry::RequestId::RequestId(int process_id, 237 DesktopCaptureRequestsRegistry::RequestId::RequestId(int process_id,
238 int request_id) 238 int request_id)
239 : process_id(process_id), 239 : process_id(process_id),
240 request_id(request_id) { 240 request_id(request_id) {
241 } 241 }
242 242
243 bool DesktopCaptureRequestsRegistry::RequestId::operator<( 243 bool DesktopCaptureRequestsRegistry::RequestId::operator<(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, 285 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id,
286 int request_id) { 286 int request_id) {
287 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); 287 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id));
288 if (it != requests_.end()) 288 if (it != requests_.end())
289 it->second->Cancel(); 289 it->second->Cancel();
290 } 290 }
291 291
292 292
293 } // namespace extensions 293 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698