| OLD | NEW |
| 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/browser/renderer_host/pepper/content_browser_pepper_host_facto
ry.h" | 5 #include "content/browser/renderer_host/pepper/content_browser_pepper_host_facto
ry.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 7 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
| 8 #include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_hos
t.h" | 8 #include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_hos
t.h" |
| 9 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" | 9 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter.
h" |
| 10 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" | 10 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" |
| 11 #include "content/browser/renderer_host/pepper/pepper_host_resolver_private_mess
age_filter.h" |
| 11 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" | 12 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" |
| 12 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" | 13 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" |
| 13 #include "content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h" | 14 #include "content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h" |
| 14 #include "ppapi/host/message_filter_host.h" | 15 #include "ppapi/host/message_filter_host.h" |
| 15 #include "ppapi/host/ppapi_host.h" | 16 #include "ppapi/host/ppapi_host.h" |
| 16 #include "ppapi/host/resource_host.h" | 17 #include "ppapi/host/resource_host.h" |
| 17 #include "ppapi/proxy/ppapi_messages.h" | 18 #include "ppapi/proxy/ppapi_messages.h" |
| 18 #include "ppapi/shared_impl/ppapi_permissions.h" | 19 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 19 | 20 |
| 20 using ppapi::host::MessageFilterHost; | 21 using ppapi::host::MessageFilterHost; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 65 |
| 65 // Private interfaces. | 66 // Private interfaces. |
| 66 if (GetPermissions().HasPermission(ppapi::PERMISSION_PRIVATE)) { | 67 if (GetPermissions().HasPermission(ppapi::PERMISSION_PRIVATE)) { |
| 67 switch (message.type()) { | 68 switch (message.type()) { |
| 68 case PpapiHostMsg_BrowserFontSingleton_Create::ID: | 69 case PpapiHostMsg_BrowserFontSingleton_Create::ID: |
| 69 return scoped_ptr<ResourceHost>(new PepperBrowserFontSingletonHost( | 70 return scoped_ptr<ResourceHost>(new PepperBrowserFontSingletonHost( |
| 70 host_, instance, params.pp_resource())); | 71 host_, instance, params.pp_resource())); |
| 71 } | 72 } |
| 72 } | 73 } |
| 73 | 74 |
| 74 // UDPSocketPrivate interface. | 75 // Permissions for the following interfaces will be checked at the |
| 75 // | 76 // time of the corresponding instance's methods calls (because |
| 76 // Permissions for UDPSocketPrivate interface will be checked at the | 77 // permission check can be performed only on the UI |
| 77 // time of the instance's methods calls (because permission check | 78 // thread). Currently thise interfaces are available only for |
| 78 // for UDPSocketPrivate can be performed only on the UI | |
| 79 // thread). Currently this interface is available only for | |
| 80 // whitelisted apps which may not have access to the other private | 79 // whitelisted apps which may not have access to the other private |
| 81 // interfaces. | 80 // interfaces. |
| 81 if (message.type() == PpapiHostMsg_HostResolverPrivate_Create::ID) { |
| 82 scoped_refptr<ResourceMessageFilter> host_resolver( |
| 83 new PepperHostResolverPrivateMessageFilter(host_, instance)); |
| 84 return scoped_ptr<ResourceHost>(new MessageFilterHost( |
| 85 host_->GetPpapiHost(), instance, params.pp_resource(), host_resolver)); |
| 86 } |
| 82 if (message.type() == PpapiHostMsg_UDPSocketPrivate_Create::ID) { | 87 if (message.type() == PpapiHostMsg_UDPSocketPrivate_Create::ID) { |
| 83 return scoped_ptr<ResourceHost>(new PepperUDPSocketPrivateHost( | 88 return scoped_ptr<ResourceHost>(new PepperUDPSocketPrivateHost( |
| 84 host_, instance, params.pp_resource())); | 89 host_, instance, params.pp_resource())); |
| 85 } | 90 } |
| 86 | 91 |
| 87 // Flash interfaces. | 92 // Flash interfaces. |
| 88 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { | 93 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { |
| 89 switch (message.type()) { | 94 switch (message.type()) { |
| 90 case PpapiHostMsg_FlashFile_Create::ID: { | 95 case PpapiHostMsg_FlashFile_Create::ID: { |
| 91 scoped_refptr<ResourceMessageFilter> file_filter( | 96 scoped_refptr<ResourceMessageFilter> file_filter( |
| 92 new PepperFlashFileMessageFilter(instance, host_)); | 97 new PepperFlashFileMessageFilter(instance, host_)); |
| 93 return scoped_ptr<ResourceHost>(new MessageFilterHost( | 98 return scoped_ptr<ResourceHost>(new MessageFilterHost( |
| 94 host_->GetPpapiHost(), instance, params.pp_resource(), | 99 host_->GetPpapiHost(), instance, params.pp_resource(), |
| 95 file_filter)); | 100 file_filter)); |
| 96 } | 101 } |
| 97 } | 102 } |
| 98 } | 103 } |
| 99 | 104 |
| 100 return scoped_ptr<ResourceHost>(); | 105 return scoped_ptr<ResourceHost>(); |
| 101 } | 106 } |
| 102 | 107 |
| 103 const ppapi::PpapiPermissions& | 108 const ppapi::PpapiPermissions& |
| 104 ContentBrowserPepperHostFactory::GetPermissions() const { | 109 ContentBrowserPepperHostFactory::GetPermissions() const { |
| 105 return host_->GetPpapiHost()->permissions(); | 110 return host_->GetPpapiHost()->permissions(); |
| 106 } | 111 } |
| 107 | 112 |
| 108 } // namespace content | 113 } // namespace content |
| OLD | NEW |