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

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

Issue 16933003: Implement PPB_HostResolver_Dev: part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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_file_ref_host.h" 9 #include "content/browser/renderer_host/pepper/pepper_file_ref_host.h"
10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h " 10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h "
11 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter. h" 11 #include "content/browser/renderer_host/pepper/pepper_flash_file_message_filter. h"
12 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" 12 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h"
13 #include "content/browser/renderer_host/pepper/pepper_host_resolver_private_mess age_filter.h" 13 #include "content/browser/renderer_host/pepper/pepper_host_resolver_message_filt er.h"
14 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h" 14 #include "content/browser/renderer_host/pepper/pepper_print_settings_manager.h"
15 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" 15 #include "content/browser/renderer_host/pepper/pepper_printing_host.h"
16 #include "content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h" 16 #include "content/browser/renderer_host/pepper/pepper_truetype_font_list_host.h"
17 #include "content/browser/renderer_host/pepper/pepper_udp_socket_message_filter. h" 17 #include "content/browser/renderer_host/pepper/pepper_udp_socket_message_filter. h"
18 #include "ppapi/host/message_filter_host.h" 18 #include "ppapi/host/message_filter_host.h"
19 #include "ppapi/host/ppapi_host.h" 19 #include "ppapi/host/ppapi_host.h"
20 #include "ppapi/host/resource_host.h" 20 #include "ppapi/host/resource_host.h"
21 #include "ppapi/proxy/ppapi_messages.h" 21 #include "ppapi/proxy/ppapi_messages.h"
22 #include "ppapi/shared_impl/ppapi_permissions.h" 22 #include "ppapi/shared_impl/ppapi_permissions.h"
23 23
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return scoped_ptr<ResourceHost>(); 71 return scoped_ptr<ResourceHost>();
72 } 72 }
73 return scoped_ptr<ResourceHost>(new PepperFileRefHost( 73 return scoped_ptr<ResourceHost>(new PepperFileRefHost(
74 host_, instance, params.pp_resource(), file_system, internal_path)); 74 host_, instance, params.pp_resource(), file_system, internal_path));
75 } 75 }
76 } 76 }
77 77
78 // Dev interfaces. 78 // Dev interfaces.
79 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) { 79 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) {
80 switch (message.type()) { 80 switch (message.type()) {
81 case PpapiHostMsg_HostResolver_Create::ID: {
82 scoped_refptr<ResourceMessageFilter> host_resolver(
83 new PepperHostResolverMessageFilter(host_, instance, false));
84 return scoped_ptr<ResourceHost>(new MessageFilterHost(
85 host_->GetPpapiHost(), instance, params.pp_resource(),
86 host_resolver));
87 }
81 case PpapiHostMsg_Printing_Create::ID: { 88 case PpapiHostMsg_Printing_Create::ID: {
82 scoped_ptr<PepperPrintSettingsManager> manager( 89 scoped_ptr<PepperPrintSettingsManager> manager(
83 new PepperPrintSettingsManagerImpl()); 90 new PepperPrintSettingsManagerImpl());
84 return scoped_ptr<ResourceHost>(new PepperPrintingHost( 91 return scoped_ptr<ResourceHost>(new PepperPrintingHost(
85 host_->GetPpapiHost(), instance, 92 host_->GetPpapiHost(), instance,
86 params.pp_resource(), manager.Pass())); 93 params.pp_resource(), manager.Pass()));
87 } 94 }
88 case PpapiHostMsg_TrueTypeFontSingleton_Create::ID: { 95 case PpapiHostMsg_TrueTypeFontSingleton_Create::ID: {
89 return scoped_ptr<ResourceHost>(new PepperTrueTypeFontListHost( 96 return scoped_ptr<ResourceHost>(new PepperTrueTypeFontListHost(
90 host_, instance, params.pp_resource())); 97 host_, instance, params.pp_resource()));
(...skipping 15 matching lines...) Expand all
106 host_, instance, params.pp_resource())); 113 host_, instance, params.pp_resource()));
107 } 114 }
108 } 115 }
109 116
110 // Permissions for the following interfaces will be checked at the 117 // Permissions for the following interfaces will be checked at the
111 // time of the corresponding instance's methods calls (because 118 // time of the corresponding instance's methods calls (because
112 // permission check can be performed only on the UI 119 // permission check can be performed only on the UI
113 // thread). Currently these interfaces are available only for 120 // thread). Currently these interfaces are available only for
114 // whitelisted apps which may not have access to the other private 121 // whitelisted apps which may not have access to the other private
115 // interfaces. 122 // interfaces.
116 if (message.type() == PpapiHostMsg_HostResolverPrivate_Create::ID) { 123 if (message.type() == PpapiHostMsg_HostResolver_CreatePrivate::ID) {
117 scoped_refptr<ResourceMessageFilter> host_resolver( 124 scoped_refptr<ResourceMessageFilter> host_resolver(
118 new PepperHostResolverPrivateMessageFilter(host_, instance)); 125 new PepperHostResolverMessageFilter(host_, instance, true));
119 return scoped_ptr<ResourceHost>(new MessageFilterHost( 126 return scoped_ptr<ResourceHost>(new MessageFilterHost(
120 host_->GetPpapiHost(), instance, params.pp_resource(), host_resolver)); 127 host_->GetPpapiHost(), instance, params.pp_resource(), host_resolver));
121 } 128 }
122 if (message.type() == PpapiHostMsg_UDPSocket_CreatePrivate::ID) { 129 if (message.type() == PpapiHostMsg_UDPSocket_CreatePrivate::ID) {
123 scoped_refptr<ResourceMessageFilter> udp_socket( 130 scoped_refptr<ResourceMessageFilter> udp_socket(
124 new PepperUDPSocketMessageFilter(host_, instance, true)); 131 new PepperUDPSocketMessageFilter(host_, instance, true));
125 return scoped_ptr<ResourceHost>(new MessageFilterHost( 132 return scoped_ptr<ResourceHost>(new MessageFilterHost(
126 host_->GetPpapiHost(), instance, params.pp_resource(), udp_socket)); 133 host_->GetPpapiHost(), instance, params.pp_resource(), udp_socket));
127 } 134 }
128 135
(...skipping 12 matching lines...) Expand all
141 148
142 return scoped_ptr<ResourceHost>(); 149 return scoped_ptr<ResourceHost>();
143 } 150 }
144 151
145 const ppapi::PpapiPermissions& 152 const ppapi::PpapiPermissions&
146 ContentBrowserPepperHostFactory::GetPermissions() const { 153 ContentBrowserPepperHostFactory::GetPermissions() const {
147 return host_->GetPpapiHost()->permissions(); 154 return host_->GetPpapiHost()->permissions();
148 } 155 }
149 156
150 } // namespace content 157 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698