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

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

Issue 19723010: Pepper Message Filters: Port to use explicit permission grants in ChildProcessSecurityPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0044-write-support-remove-child-process-security-policy-bitmask-usage
Patch Set: Created 7 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
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_helper_impl.h" 5 #include "content/renderer/pepper/pepper_helper_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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "ipc/ipc_channel_handle.h" 62 #include "ipc/ipc_channel_handle.h"
63 #include "ipc/ipc_platform_file.h" 63 #include "ipc/ipc_platform_file.h"
64 #include "media/video/capture/video_capture_proxy.h" 64 #include "media/video/capture/video_capture_proxy.h"
65 #include "ppapi/c/dev/pp_video_dev.h" 65 #include "ppapi/c/dev/pp_video_dev.h"
66 #include "ppapi/c/pp_errors.h" 66 #include "ppapi/c/pp_errors.h"
67 #include "ppapi/c/private/ppb_flash.h" 67 #include "ppapi/c/private/ppb_flash.h"
68 #include "ppapi/proxy/ppapi_messages.h" 68 #include "ppapi/proxy/ppapi_messages.h"
69 #include "ppapi/proxy/url_loader_resource.h" 69 #include "ppapi/proxy/url_loader_resource.h"
70 #include "ppapi/shared_impl/api_id.h" 70 #include "ppapi/shared_impl/api_id.h"
71 #include "ppapi/shared_impl/file_path.h" 71 #include "ppapi/shared_impl/file_path.h"
72 #include "ppapi/shared_impl/file_type_conversion.h"
72 #include "ppapi/shared_impl/platform_file.h" 73 #include "ppapi/shared_impl/platform_file.h"
73 #include "ppapi/shared_impl/ppapi_globals.h" 74 #include "ppapi/shared_impl/ppapi_globals.h"
74 #include "ppapi/shared_impl/ppapi_preferences.h" 75 #include "ppapi/shared_impl/ppapi_preferences.h"
75 #include "ppapi/shared_impl/ppb_device_ref_shared.h" 76 #include "ppapi/shared_impl/ppb_device_ref_shared.h"
76 #include "ppapi/shared_impl/ppp_instance_combined.h" 77 #include "ppapi/shared_impl/ppp_instance_combined.h"
77 #include "ppapi/shared_impl/resource_tracker.h" 78 #include "ppapi/shared_impl/resource_tracker.h"
78 #include "ppapi/shared_impl/socket_option_data.h" 79 #include "ppapi/shared_impl/socket_option_data.h"
79 #include "ppapi/thunk/enter.h" 80 #include "ppapi/thunk/enter.h"
80 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h" 81 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h"
81 #include "third_party/WebKit/public/web/WebCursorInfo.h" 82 #include "third_party/WebKit/public/web/WebCursorInfo.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 544
544 PluginModule* plugin_module = ResourceHelper::GetPluginModule(client.get()); 545 PluginModule* plugin_module = ResourceHelper::GetPluginModule(client.get());
545 if (!plugin_module) 546 if (!plugin_module)
546 return; 547 return;
547 548
548 PepperBroker* broker = static_cast<PepperBroker*>(plugin_module->GetBroker()); 549 PepperBroker* broker = static_cast<PepperBroker*>(plugin_module->GetBroker());
549 broker->OnBrokerPermissionResult(client.get(), result); 550 broker->OnBrokerPermissionResult(client.get(), result);
550 } 551 }
551 552
552 bool PepperHelperImpl::AsyncOpenFile(const base::FilePath& path, 553 bool PepperHelperImpl::AsyncOpenFile(const base::FilePath& path,
553 int flags, 554 int pp_open_flags,
554 const AsyncOpenFileCallback& callback) { 555 const AsyncOpenFileCallback& callback) {
555 int message_id = pending_async_open_files_.Add( 556 int message_id = pending_async_open_files_.Add(
556 new AsyncOpenFileCallback(callback)); 557 new AsyncOpenFileCallback(callback));
557 return Send(new ViewHostMsg_AsyncOpenFile( 558 return Send(new ViewHostMsg_AsyncOpenPepperFile(
558 routing_id(), path, flags, message_id)); 559 routing_id(), path, pp_open_flags, message_id));
559 } 560 }
560 561
561 void PepperHelperImpl::OnAsyncFileOpened( 562 void PepperHelperImpl::OnAsyncFileOpened(
562 base::PlatformFileError error_code, 563 base::PlatformFileError error_code,
563 IPC::PlatformFileForTransit file_for_transit, 564 IPC::PlatformFileForTransit file_for_transit,
564 int message_id) { 565 int message_id) {
565 AsyncOpenFileCallback* callback = 566 AsyncOpenFileCallback* callback =
566 pending_async_open_files_.Lookup(message_id); 567 pending_async_open_files_.Lookup(message_id);
567 DCHECK(callback); 568 DCHECK(callback);
568 pending_async_open_files_.Remove(message_id); 569 pending_async_open_files_.Remove(message_id);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) 737 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK)
737 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) 738 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK)
738 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SetOptionACK, 739 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SetOptionACK,
739 OnTCPSocketSetOptionACK) 740 OnTCPSocketSetOptionACK)
740 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_ListenACK, 741 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_ListenACK,
741 OnTCPServerSocketListenACK) 742 OnTCPServerSocketListenACK)
742 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_AcceptACK, 743 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_AcceptACK,
743 OnTCPServerSocketAcceptACK) 744 OnTCPServerSocketAcceptACK)
744 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerChannelCreated, 745 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerChannelCreated,
745 OnPpapiBrokerChannelCreated) 746 OnPpapiBrokerChannelCreated)
746 IPC_MESSAGE_HANDLER(ViewMsg_AsyncOpenFile_ACK, OnAsyncFileOpened) 747 IPC_MESSAGE_HANDLER(ViewMsg_AsyncOpenPepperFile_ACK, OnAsyncFileOpened)
747 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerPermissionResult, 748 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerPermissionResult,
748 OnPpapiBrokerPermissionResult) 749 OnPpapiBrokerPermissionResult)
749 IPC_MESSAGE_UNHANDLED(handled = false) 750 IPC_MESSAGE_UNHANDLED(handled = false)
750 IPC_END_MESSAGE_MAP() 751 IPC_END_MESSAGE_MAP()
751 return handled; 752 return handled;
752 } 753 }
753 754
754 void PepperHelperImpl::OnDestruct() { 755 void PepperHelperImpl::OnDestruct() {
755 // Nothing to do here. Default implementation in RenderViewObserver does 756 // Nothing to do here. Default implementation in RenderViewObserver does
756 // 'delete this' but it's not suitable for PepperHelperImpl because 757 // 'delete this' but it's not suitable for PepperHelperImpl because
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 socket->OnAcceptCompleted(succeeded, 840 socket->OnAcceptCompleted(succeeded,
840 accepted_socket_id, 841 accepted_socket_id,
841 local_addr, 842 local_addr,
842 remote_addr); 843 remote_addr);
843 } else if (accepted_socket_id != 0) { 844 } else if (accepted_socket_id != 0) {
844 Send(new PpapiHostMsg_PPBTCPSocket_Disconnect(accepted_socket_id)); 845 Send(new PpapiHostMsg_PPBTCPSocket_Disconnect(accepted_socket_id));
845 } 846 }
846 } 847 }
847 848
848 } // namespace content 849 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_helper_impl.h ('k') | content/renderer/pepper/ppb_file_ref_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698