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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 10 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
23 #include "content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter. h" | 23 #include "content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter. h" |
24 #include "content/browser/renderer_host/pepper/pepper_truetype_font_host.h" | 24 #include "content/browser/renderer_host/pepper/pepper_truetype_font_host.h" |
25 #include "content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h" | 25 #include "content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h" |
26 #include "content/browser/renderer_host/pepper/pepper_udp_socket_message_filter. h" | 26 #include "content/browser/renderer_host/pepper/pepper_udp_socket_message_filter. h" |
27 #include "ppapi/host/message_filter_host.h" | 27 #include "ppapi/host/message_filter_host.h" |
28 #include "ppapi/host/ppapi_host.h" | 28 #include "ppapi/host/ppapi_host.h" |
29 #include "ppapi/host/resource_host.h" | 29 #include "ppapi/host/resource_host.h" |
30 #include "ppapi/proxy/ppapi_messages.h" | 30 #include "ppapi/proxy/ppapi_messages.h" |
31 #include "ppapi/shared_impl/ppapi_permissions.h" | 31 #include "ppapi/shared_impl/ppapi_permissions.h" |
32 | 32 |
33 #if defined(OS_CHROMEOS) | |
34 #include "content/browser/renderer_host/pepper/pepper_vpn_provider_message_filte r_chromeos.h" | |
35 #endif | |
36 | |
33 using ppapi::host::MessageFilterHost; | 37 using ppapi::host::MessageFilterHost; |
34 using ppapi::host::ResourceHost; | 38 using ppapi::host::ResourceHost; |
35 using ppapi::host::ResourceMessageFilter; | 39 using ppapi::host::ResourceMessageFilter; |
36 using ppapi::proxy::SerializedTrueTypeFontDesc; | 40 using ppapi::proxy::SerializedTrueTypeFontDesc; |
37 using ppapi::UnpackMessage; | 41 using ppapi::UnpackMessage; |
38 | 42 |
39 namespace content { | 43 namespace content { |
40 | 44 |
41 namespace { | 45 namespace { |
42 | 46 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 if (!base::IsStringUTF8(desc.family)) | 155 if (!base::IsStringUTF8(desc.family)) |
152 return std::unique_ptr<ResourceHost>(); | 156 return std::unique_ptr<ResourceHost>(); |
153 | 157 |
154 return std::unique_ptr<ResourceHost>( | 158 return std::unique_ptr<ResourceHost>( |
155 new PepperTrueTypeFontHost(host_, instance, resource, desc)); | 159 new PepperTrueTypeFontHost(host_, instance, resource, desc)); |
156 } | 160 } |
157 case PpapiHostMsg_TrueTypeFontSingleton_Create::ID: { | 161 case PpapiHostMsg_TrueTypeFontSingleton_Create::ID: { |
158 return std::unique_ptr<ResourceHost>( | 162 return std::unique_ptr<ResourceHost>( |
159 new PepperTrueTypeFontListHost(host_, instance, resource)); | 163 new PepperTrueTypeFontListHost(host_, instance, resource)); |
160 } | 164 } |
165 #if defined(OS_CHROMEOS) | |
166 case PpapiHostMsg_VpnProvider_Create::ID: { | |
167 scoped_refptr<PepperVpnProviderMessageFilter> vpn_provider( | |
168 new PepperVpnProviderMessageFilter(host_, instance)); | |
169 return std::unique_ptr<ResourceHost>(new MessageFilterHost( | |
dcheng
2016/07/04 04:24:06
Nit: base::MakeUnique<MessageFilterHost(...)
adrian.belgun
2016/07/04 14:28:32
Done.
| |
170 host_->GetPpapiHost(), instance, resource, vpn_provider)); | |
dcheng
2016/07/04 04:24:06
Nit: std::move(vpn_provider)
adrian.belgun
2016/07/04 14:28:32
Done.
| |
171 } | |
172 #endif | |
161 } | 173 } |
162 } | 174 } |
163 | 175 |
164 // Private interfaces. | 176 // Private interfaces. |
165 if (GetPermissions().HasPermission(ppapi::PERMISSION_PRIVATE)) { | 177 if (GetPermissions().HasPermission(ppapi::PERMISSION_PRIVATE)) { |
166 switch (message.type()) { | 178 switch (message.type()) { |
167 case PpapiHostMsg_BrowserFontSingleton_Create::ID: | 179 case PpapiHostMsg_BrowserFontSingleton_Create::ID: |
168 return std::unique_ptr<ResourceHost>( | 180 return std::unique_ptr<ResourceHost>( |
169 new PepperBrowserFontSingletonHost(host_, instance, resource)); | 181 new PepperBrowserFontSingletonHost(host_, instance, resource)); |
170 } | 182 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 return std::unique_ptr<ResourceHost>(new MessageFilterHost( | 268 return std::unique_ptr<ResourceHost>(new MessageFilterHost( |
257 host_->GetPpapiHost(), instance, resource, tcp_socket)); | 269 host_->GetPpapiHost(), instance, resource, tcp_socket)); |
258 } | 270 } |
259 | 271 |
260 const ppapi::PpapiPermissions& ContentBrowserPepperHostFactory::GetPermissions() | 272 const ppapi::PpapiPermissions& ContentBrowserPepperHostFactory::GetPermissions() |
261 const { | 273 const { |
262 return host_->GetPpapiHost()->permissions(); | 274 return host_->GetPpapiHost()->permissions(); |
263 } | 275 } |
264 | 276 |
265 } // namespace content | 277 } // namespace content |
OLD | NEW |