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

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

Issue 10830063: refactor EnumerateDevices to make it a persistent request. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unit test Created 8 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 | Annotate | Revision Log
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 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 MessageLoop::current()->PostTask( 1499 MessageLoop::current()->PostTask(
1500 FROM_HERE, 1500 FROM_HERE,
1501 base::Bind( 1501 base::Bind(
1502 &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed, 1502 &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed,
1503 device_enumeration_event_handler_->AsWeakPtr(), request_id)); 1503 device_enumeration_event_handler_->AsWeakPtr(), request_id));
1504 #endif 1504 #endif
1505 1505
1506 return request_id; 1506 return request_id;
1507 } 1507 }
1508 1508
1509 void PepperPluginDelegateImpl::StopEnumerateDevices(int request_id) {
1510 #if defined(ENABLE_WEBRTC)
1511 // Need to post task since this function might be called inside the callback
1512 // of EnumerateDevices.
1513 MessageLoop::current()->PostTask(
1514 FROM_HERE,
1515 base::Bind(
1516 &MediaStreamDispatcher::StopEnumerateDevices,
1517 base::Unretained(render_view_->media_stream_dispatcher()),
1518 request_id, device_enumeration_event_handler_.get()->AsWeakPtr()));
1519 #endif
1520 }
1521
1509 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) { 1522 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) {
1510 bool handled = true; 1523 bool handled = true;
1511 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message) 1524 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message)
1512 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, 1525 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK,
1513 OnTCPSocketConnectACK) 1526 OnTCPSocketConnectACK)
1514 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, 1527 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK,
1515 OnTCPSocketSSLHandshakeACK) 1528 OnTCPSocketSSLHandshakeACK)
1516 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) 1529 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK)
1517 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) 1530 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK)
1518 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK) 1531 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK)
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 else 1777 else
1765 return render_view_->mouse_lock_dispatcher(); 1778 return render_view_->mouse_lock_dispatcher();
1766 } 1779 }
1767 1780
1768 webkit_glue::ClipboardClient* 1781 webkit_glue::ClipboardClient*
1769 PepperPluginDelegateImpl::CreateClipboardClient() const { 1782 PepperPluginDelegateImpl::CreateClipboardClient() const {
1770 return new RendererClipboardClient; 1783 return new RendererClipboardClient;
1771 } 1784 }
1772 1785
1773 } // namespace content 1786 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | webkit/plugins/ppapi/mock_plugin_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698