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

Side by Side Diff: content/renderer/pepper_plugin_delegate_impl.h

Issue 9283022: Exposed Listen and Accept methods to plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added documentation for PPB_TCPServerSocket_Private methods, Create method became async. Created 8 years, 10 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
« no previous file with comments | « content/content_browser.gypi ('k') | content/renderer/pepper_plugin_delegate_impl.cc » ('j') | 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 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_
6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <queue>
10 #include <set> 11 #include <set>
11 #include <string> 12 #include <string>
12 13
13 #include "base/basictypes.h" 14 #include "base/basictypes.h"
14 #include "base/id_map.h" 15 #include "base/id_map.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
17 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
18 #include "content/public/renderer/render_view_observer.h" 19 #include "content/public/renderer/render_view_observer.h"
19 #include "content/renderer/mouse_lock_dispatcher.h" 20 #include "content/renderer/mouse_lock_dispatcher.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, 330 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
330 uint32 socket_id, 331 uint32 socket_id,
331 const PP_NetAddress_Private& addr) OVERRIDE; 332 const PP_NetAddress_Private& addr) OVERRIDE;
332 virtual void TCPSocketSSLHandshake(uint32 socket_id, 333 virtual void TCPSocketSSLHandshake(uint32 socket_id,
333 const std::string& server_name, 334 const std::string& server_name,
334 uint16_t server_port) OVERRIDE; 335 uint16_t server_port) OVERRIDE;
335 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; 336 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE;
336 virtual void TCPSocketWrite(uint32 socket_id, 337 virtual void TCPSocketWrite(uint32 socket_id,
337 const std::string& buffer) OVERRIDE; 338 const std::string& buffer) OVERRIDE;
338 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; 339 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE;
340 virtual void TCPSocketRegister(
341 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
342 uint32 socket_id) OVERRIDE;
339 343
340 virtual uint32 UDPSocketCreate() OVERRIDE; 344 virtual uint32 UDPSocketCreate() OVERRIDE;
341 virtual void UDPSocketBind( 345 virtual void UDPSocketBind(
342 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, 346 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket,
343 uint32 socket_id, 347 uint32 socket_id,
344 const PP_NetAddress_Private& addr) OVERRIDE; 348 const PP_NetAddress_Private& addr) OVERRIDE;
345 virtual void UDPSocketRecvFrom(uint32 socket_id, 349 virtual void UDPSocketRecvFrom(uint32 socket_id,
346 int32_t num_bytes) OVERRIDE; 350 int32_t num_bytes) OVERRIDE;
347 virtual void UDPSocketSendTo(uint32 socket_id, 351 virtual void UDPSocketSendTo(uint32 socket_id,
348 const std::string& buffer, 352 const std::string& buffer,
349 const PP_NetAddress_Private& addr) OVERRIDE; 353 const PP_NetAddress_Private& addr) OVERRIDE;
350 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; 354 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE;
351 355
brettw 2012/02/09 00:13:48 No blank lines in a block of functions implementin
ygorshenin1 2012/02/09 15:00:10 Done.
356 virtual bool TCPServerSocketInitialize(
357 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket) OVERRIDE;
358 virtual void TCPServerSocketListen(
359 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket,
360 uint32 socket_id,
361 const PP_NetAddress_Private& addr,
362 int32_t backlog) OVERRIDE;
363 virtual void TCPServerSocketAccept(uint32 socket_id) OVERRIDE;
364 virtual void TCPServerSocketStopListening(uint32 socket_id) OVERRIDE;
365
352 virtual int32_t ShowContextMenu( 366 virtual int32_t ShowContextMenu(
353 webkit::ppapi::PluginInstance* instance, 367 webkit::ppapi::PluginInstance* instance,
354 webkit::ppapi::PPB_Flash_Menu_Impl* menu, 368 webkit::ppapi::PPB_Flash_Menu_Impl* menu,
355 const gfx::Point& position) OVERRIDE; 369 const gfx::Point& position) OVERRIDE;
356 void OnContextMenuClosed( 370 void OnContextMenuClosed(
357 const webkit_glue::CustomContextMenuContext& custom_context); 371 const webkit_glue::CustomContextMenuContext& custom_context);
358 void OnCustomContextMenuAction( 372 void OnCustomContextMenuAction(
359 const webkit_glue::CustomContextMenuContext& custom_context, 373 const webkit_glue::CustomContextMenuContext& custom_context,
360 unsigned action); 374 unsigned action);
361 void CompleteShowContextMenu(int request_id, 375 void CompleteShowContextMenu(int request_id,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 bool succeeded); 429 bool succeeded);
416 void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, 430 void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id,
417 uint32 socket_id, 431 uint32 socket_id,
418 bool succeeded, 432 bool succeeded,
419 int32_t bytes_written); 433 int32_t bytes_written);
420 void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id, 434 void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id,
421 uint32 socket_id, 435 uint32 socket_id,
422 bool succeeded, 436 bool succeeded,
423 const std::string& data, 437 const std::string& data,
424 const PP_NetAddress_Private& addr); 438 const PP_NetAddress_Private& addr);
425 439
brettw 2012/02/09 00:13:48 I wouldn't do blank lines here either.
ygorshenin1 2012/02/09 15:00:10 Done.
440 void OnTCPServerSocketInitializeACK(uint32 plugin_dispatcher_id,
441 uint32 tcp_server_socket_id);
442 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id,
443 uint32 socket_id,
444 bool succeeded);
445 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id,
446 uint32 tcp_server_socket_id,
447 uint32 tcp_socket_id,
448 const PP_NetAddress_Private& local_addr,
449 const PP_NetAddress_Private& remote_addr);
450
426 CONTENT_EXPORT int GetRoutingId() const; 451 CONTENT_EXPORT int GetRoutingId() const;
427 452
428 private: 453 private:
429 // Asynchronously attempts to create a PPAPI broker for the given plugin. 454 // Asynchronously attempts to create a PPAPI broker for the given plugin.
430 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( 455 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker(
431 webkit::ppapi::PluginModule* plugin_module); 456 webkit::ppapi::PluginModule* plugin_module);
432 457
433 // Implementation of PepperParentContextProvider. 458 // Implementation of PepperParentContextProvider.
434 virtual ContentGLContext* GetParentContextForPlatformContext3D() OVERRIDE; 459 virtual ContentGLContext* GetParentContextForPlatformContext3D() OVERRIDE;
435 460
(...skipping 25 matching lines...) Expand all
461 486
462 IDMap<AsyncOpenFileCallback> pending_async_open_files_; 487 IDMap<AsyncOpenFileCallback> pending_async_open_files_;
463 488
464 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, 489 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>,
465 IDMapOwnPointer> pending_connect_tcps_; 490 IDMapOwnPointer> pending_connect_tcps_;
466 491
467 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; 492 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_;
468 493
469 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; 494 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_;
470 495
496 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> tcp_server_sockets_;
497
498 std::queue<webkit::ppapi::PPB_TCPServerSocket_Private_Impl*>
499 uninitialized_tcp_server_sockets_;
500
471 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, 501 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>,
472 IDMapOwnPointer> pending_context_menus_; 502 IDMapOwnPointer> pending_context_menus_;
473 503
474 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; 504 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap;
475 BrokerMap pending_connect_broker_; 505 BrokerMap pending_connect_broker_;
476 506
477 // Whether or not the focus is on a PPAPI plugin 507 // Whether or not the focus is on a PPAPI plugin
478 webkit::ppapi::PluginInstance* focused_plugin_; 508 webkit::ppapi::PluginInstance* focused_plugin_;
479 509
480 // Current text input composition text. Empty if no composition is in 510 // Current text input composition text. Empty if no composition is in
481 // progress. 511 // progress.
482 string16 composition_text_; 512 string16 composition_text_;
483 513
484 // The plugin instance that received the last mouse event. It is set to NULL 514 // The plugin instance that received the last mouse event. It is set to NULL
485 // if the last mouse event went to elements other than Pepper plugins. 515 // if the last mouse event went to elements other than Pepper plugins.
486 // |last_mouse_event_target_| is not owned by this class. We can know about 516 // |last_mouse_event_target_| is not owned by this class. We can know about
487 // when it is destroyed via InstanceDeleted(). 517 // when it is destroyed via InstanceDeleted().
488 webkit::ppapi::PluginInstance* last_mouse_event_target_; 518 webkit::ppapi::PluginInstance* last_mouse_event_target_;
489 519
490 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; 520 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_;
491 521
492 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); 522 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl);
493 }; 523 };
494 524
495 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ 525 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | content/renderer/pepper_plugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698