Chromium Code Reviews| 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 |
| 75 // HostResolverPrivate interface. | |
| 76 // | |
| 77 // Permissions for HostResolverPrivate interface will be checked at | |
| 78 // the time of the instance's methods calls (because permission | |
| 79 // check for HostResolverPrivate can be performed only on the UI | |
| 80 // thread). Currently this interface is available only for | |
| 81 // whitelisted apps which may not have access to the other private | |
| 82 // interfaces. | |
| 83 if (message.type() == PpapiHostMsg_HostResolverPrivate_Create::ID) { | |
|
brettw
2013/02/11 20:46:58
Can you just group this with the UDPSocket one bel
ygorshenin1
2013/02/11 21:28:53
Done.
| |
| 84 scoped_refptr<ResourceMessageFilter> host_resolver( | |
| 85 new PepperHostResolverPrivateMessageFilter(host_, instance)); | |
| 86 return scoped_ptr<ResourceHost>(new MessageFilterHost( | |
| 87 host_->GetPpapiHost(), instance, params.pp_resource(), host_resolver)); | |
| 88 } | |
| 89 | |
| 74 // UDPSocketPrivate interface. | 90 // UDPSocketPrivate interface. |
| 75 // | 91 // |
| 76 // Permissions for UDPSocketPrivate interface will be checked at the | 92 // Permissions for UDPSocketPrivate interface will be checked at the |
| 77 // time of the instance's methods calls (because permission check | 93 // time of the instance's methods calls (because permission check |
| 78 // for UDPSocketPrivate can be performed only on the UI | 94 // for UDPSocketPrivate can be performed only on the UI |
| 79 // thread). Currently this interface is available only for | 95 // thread). Currently this interface is available only for |
| 80 // whitelisted apps which may not have access to the other private | 96 // whitelisted apps which may not have access to the other private |
| 81 // interfaces. | 97 // interfaces. |
| 82 if (message.type() == PpapiHostMsg_UDPSocketPrivate_Create::ID) { | 98 if (message.type() == PpapiHostMsg_UDPSocketPrivate_Create::ID) { |
| 83 return scoped_ptr<ResourceHost>(new PepperUDPSocketPrivateHost( | 99 return scoped_ptr<ResourceHost>(new PepperUDPSocketPrivateHost( |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 99 | 115 |
| 100 return scoped_ptr<ResourceHost>(); | 116 return scoped_ptr<ResourceHost>(); |
| 101 } | 117 } |
| 102 | 118 |
| 103 const ppapi::PpapiPermissions& | 119 const ppapi::PpapiPermissions& |
| 104 ContentBrowserPepperHostFactory::GetPermissions() const { | 120 ContentBrowserPepperHostFactory::GetPermissions() const { |
| 105 return host_->GetPpapiHost()->permissions(); | 121 return host_->GetPpapiHost()->permissions(); |
| 106 } | 122 } |
| 107 | 123 |
| 108 } // namespace content | 124 } // namespace content |
| OLD | NEW |