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

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

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/master again, resolved conflicts Created 6 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 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/desktop_capture/desktop_capture_api.h" 5 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/extensions/extension_tab_util.h" 10 #include "chrome/browser/extensions/extension_tab_util.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 DesktopMediaPicker::DoneCallback callback = base::Bind( 208 DesktopMediaPicker::DoneCallback callback = base::Bind(
209 &DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults, this); 209 &DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults, this);
210 210
211 picker_->Show(parent_window, parent_window, 211 picker_->Show(parent_window, parent_window,
212 base::UTF8ToUTF16(GetExtension()->name()), 212 base::UTF8ToUTF16(GetExtension()->name()),
213 target_name, 213 target_name,
214 media_list.Pass(), callback); 214 media_list.Pass(), callback);
215 return true; 215 return true;
216 } 216 }
217 217
218 void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed( 218 void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed() {
219 content::WebContents* web_contents) {
220 Cancel(); 219 Cancel();
221 } 220 }
222 221
223 void DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults( 222 void DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults(
224 content::DesktopMediaID source) { 223 content::DesktopMediaID source) {
225 std::string result; 224 std::string result;
226 if (source.type != content::DesktopMediaID::TYPE_NONE) { 225 if (source.type != content::DesktopMediaID::TYPE_NONE) {
227 DesktopStreamsRegistry* registry = 226 DesktopStreamsRegistry* registry =
228 MediaCaptureDevicesDispatcher::GetInstance()-> 227 MediaCaptureDevicesDispatcher::GetInstance()->
229 GetDesktopStreamsRegistry(); 228 GetDesktopStreamsRegistry();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 291
293 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, 292 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id,
294 int request_id) { 293 int request_id) {
295 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); 294 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id));
296 if (it != requests_.end()) 295 if (it != requests_.end())
297 it->second->Cancel(); 296 it->second->Cancel();
298 } 297 }
299 298
300 299
301 } // namespace extensions 300 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698