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

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 9903014: Using WeakPtr for requests to MediaStreamDispatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/mock_media_stream_dispatcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/pepper/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 1343
1344 int PepperPluginDelegateImpl::EnumerateDevices( 1344 int PepperPluginDelegateImpl::EnumerateDevices(
1345 PP_DeviceType_Dev type, 1345 PP_DeviceType_Dev type,
1346 const EnumerateDevicesCallback& callback) { 1346 const EnumerateDevicesCallback& callback) {
1347 int request_id = 1347 int request_id =
1348 device_enumeration_event_handler_->RegisterEnumerateDevicesCallback( 1348 device_enumeration_event_handler_->RegisterEnumerateDevicesCallback(
1349 callback); 1349 callback);
1350 1350
1351 #if defined(ENABLE_WEBRTC) 1351 #if defined(ENABLE_WEBRTC)
1352 render_view_->media_stream_dispatcher()->EnumerateDevices( 1352 render_view_->media_stream_dispatcher()->EnumerateDevices(
1353 request_id, device_enumeration_event_handler_.get(), 1353 request_id, device_enumeration_event_handler_.get()->AsWeakPtr(),
1354 PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), ""); 1354 PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), "");
1355 #else 1355 #else
1356 MessageLoop::current()->PostTask( 1356 MessageLoop::current()->PostTask(
1357 FROM_HERE, 1357 FROM_HERE,
1358 base::Bind( 1358 base::Bind(
1359 &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed, 1359 &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed,
1360 device_enumeration_event_handler_->AsWeakPtr(), request_id)); 1360 device_enumeration_event_handler_->AsWeakPtr(), request_id));
1361 #endif 1361 #endif
1362 1362
1363 return request_id; 1363 return request_id;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 } 1531 }
1532 1532
1533 int PepperPluginDelegateImpl::OpenDevice(PP_DeviceType_Dev type, 1533 int PepperPluginDelegateImpl::OpenDevice(PP_DeviceType_Dev type,
1534 const std::string& device_id, 1534 const std::string& device_id,
1535 const OpenDeviceCallback& callback) { 1535 const OpenDeviceCallback& callback) {
1536 int request_id = 1536 int request_id =
1537 device_enumeration_event_handler_->RegisterOpenDeviceCallback(callback); 1537 device_enumeration_event_handler_->RegisterOpenDeviceCallback(callback);
1538 1538
1539 #if defined(ENABLE_WEBRTC) 1539 #if defined(ENABLE_WEBRTC)
1540 render_view_->media_stream_dispatcher()->OpenDevice( 1540 render_view_->media_stream_dispatcher()->OpenDevice(
1541 request_id, device_enumeration_event_handler_.get(), device_id, 1541 request_id,
1542 device_enumeration_event_handler_.get()->AsWeakPtr(),
1543 device_id,
1542 PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), ""); 1544 PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), "");
1543 #else 1545 #else
1544 MessageLoop::current()->PostTask( 1546 MessageLoop::current()->PostTask(
1545 FROM_HERE, 1547 FROM_HERE,
1546 base::Bind(&PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed, 1548 base::Bind(&PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed,
1547 device_enumeration_event_handler_->AsWeakPtr(), request_id)); 1549 device_enumeration_event_handler_->AsWeakPtr(), request_id));
1548 #endif 1550 #endif
1549 1551
1550 return request_id; 1552 return request_id;
1551 } 1553 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 mouse_lock_instances_.erase(it); 1611 mouse_lock_instances_.erase(it);
1610 } 1612 }
1611 } 1613 }
1612 1614
1613 webkit_glue::ClipboardClient* 1615 webkit_glue::ClipboardClient*
1614 PepperPluginDelegateImpl::CreateClipboardClient() const { 1616 PepperPluginDelegateImpl::CreateClipboardClient() const {
1615 return new RendererClipboardClient; 1617 return new RendererClipboardClient;
1616 } 1618 }
1617 1619
1618 } // namespace content 1620 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/mock_media_stream_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698