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

Side by Side Diff: content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc

Issue 11441012: PPB_UDPSocket_Private is switched to the new Pepper proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync. Created 8 years 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 | Annotate | Revision Log
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/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_flash_browser_host.h" 8 #include "content/browser/renderer_host/pepper/pepper_flash_browser_host.h"
9 #include "content/browser/renderer_host/pepper/pepper_flash_file_host.h" 9 #include "content/browser/renderer_host/pepper/pepper_flash_file_host.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_print_settings_manager.h" 11 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h"
12 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" 12 #include "content/browser/renderer_host/pepper/pepper_printing_host.h"
13 #include "content/browser/renderer_host/pepper/pepper_udp_socket_private_host.h"
13 #include "ppapi/host/resource_host.h" 14 #include "ppapi/host/resource_host.h"
14 #include "ppapi/proxy/ppapi_messages.h" 15 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/shared_impl/ppapi_permissions.h" 16 #include "ppapi/shared_impl/ppapi_permissions.h"
16 17
17 using ppapi::host::ResourceHost; 18 using ppapi::host::ResourceHost;
18 19
19 namespace content { 20 namespace content {
20 21
21 ContentBrowserPepperHostFactory::ContentBrowserPepperHostFactory( 22 ContentBrowserPepperHostFactory::ContentBrowserPepperHostFactory(
22 BrowserPpapiHostImpl* host) 23 BrowserPpapiHostImpl* host)
(...skipping 14 matching lines...) Expand all
37 if (!host_->IsValidInstance(instance)) 38 if (!host_->IsValidInstance(instance))
38 return scoped_ptr<ResourceHost>(); 39 return scoped_ptr<ResourceHost>();
39 40
40 // Public interfaces. 41 // Public interfaces.
41 switch (message.type()) { 42 switch (message.type()) {
42 case PpapiHostMsg_Gamepad_Create::ID: 43 case PpapiHostMsg_Gamepad_Create::ID:
43 return scoped_ptr<ResourceHost>(new PepperGamepadHost( 44 return scoped_ptr<ResourceHost>(new PepperGamepadHost(
44 host_, instance, params.pp_resource())); 45 host_, instance, params.pp_resource()));
45 } 46 }
46 47
48 // Private interfaces.
49 if (host_->GetPpapiHost()->permissions().HasPermission(
50 ppapi::PERMISSION_PRIVATE)) {
dmichael (off chromium) 2012/12/12 23:23:38 This probably won't work for whitelisted NaCl apps
ygorshenin1 2012/12/18 12:07:16 Creation of UDP sockets actually does nothing. All
51 switch (message.type()) {
52 case PpapiHostMsg_UDPSocketPrivate_Create::ID:
53 return scoped_ptr<ResourceHost>(new PepperUDPSocketPrivateHost(
54 host_, instance, params.pp_resource()));
55 }
56 }
57
47 // Dev interfaces. 58 // Dev interfaces.
48 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) { 59 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) {
49 switch (message.type()) { 60 switch (message.type()) {
50 case PpapiHostMsg_Printing_Create::ID: { 61 case PpapiHostMsg_Printing_Create::ID: {
51 scoped_ptr<PepperPrintSettingsManager> manager( 62 scoped_ptr<PepperPrintSettingsManager> manager(
52 new PepperPrintSettingsManagerImpl()); 63 new PepperPrintSettingsManagerImpl());
53 return scoped_ptr<ResourceHost>(new PepperPrintingHost( 64 return scoped_ptr<ResourceHost>(new PepperPrintingHost(
54 host_->GetPpapiHost(), instance, 65 host_->GetPpapiHost(), instance,
55 params.pp_resource(), manager.Pass())); 66 params.pp_resource(), manager.Pass()));
56 } 67 }
(...skipping 14 matching lines...) Expand all
71 82
72 return scoped_ptr<ResourceHost>(); 83 return scoped_ptr<ResourceHost>();
73 } 84 }
74 85
75 const ppapi::PpapiPermissions& 86 const ppapi::PpapiPermissions&
76 ContentBrowserPepperHostFactory::GetPermissions() const { 87 ContentBrowserPepperHostFactory::GetPermissions() const {
77 return host_->GetPpapiHost()->permissions(); 88 return host_->GetPpapiHost()->permissions();
78 } 89 }
79 90
80 } // namespace content 91 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698