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

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

Issue 11617005: Refactor PepperFlashFileHost and PepperBrokerHost to use MessageFilterHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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_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_host.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_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 "ppapi/host/message_filter_host.h"
14 #include "ppapi/host/ppapi_host.h"
13 #include "ppapi/host/resource_host.h" 15 #include "ppapi/host/resource_host.h"
14 #include "ppapi/proxy/ppapi_messages.h" 16 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/shared_impl/ppapi_permissions.h" 17 #include "ppapi/shared_impl/ppapi_permissions.h"
16 18
19 using ppapi::host::MessageFilterHost;
17 using ppapi::host::ResourceHost; 20 using ppapi::host::ResourceHost;
21 using ppapi::host::ResourceMessageFilter;
18 22
19 namespace content { 23 namespace content {
20 24
21 ContentBrowserPepperHostFactory::ContentBrowserPepperHostFactory( 25 ContentBrowserPepperHostFactory::ContentBrowserPepperHostFactory(
22 BrowserPpapiHostImpl* host) 26 BrowserPpapiHostImpl* host)
23 : host_(host) { 27 : host_(host) {
24 } 28 }
25 29
26 ContentBrowserPepperHostFactory::~ContentBrowserPepperHostFactory() { 30 ContentBrowserPepperHostFactory::~ContentBrowserPepperHostFactory() {
27 } 31 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 switch (message.type()) { 66 switch (message.type()) {
63 case PpapiHostMsg_BrowserFontSingleton_Create::ID: 67 case PpapiHostMsg_BrowserFontSingleton_Create::ID:
64 return scoped_ptr<ResourceHost>(new PepperBrowserFontSingletonHost( 68 return scoped_ptr<ResourceHost>(new PepperBrowserFontSingletonHost(
65 host_, instance, params.pp_resource())); 69 host_, instance, params.pp_resource()));
66 } 70 }
67 } 71 }
68 72
69 // Flash interfaces. 73 // Flash interfaces.
70 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { 74 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) {
71 switch (message.type()) { 75 switch (message.type()) {
72 case PpapiHostMsg_FlashFile_Create::ID: 76 case PpapiHostMsg_FlashFile_Create::ID: {
73 return scoped_ptr<ResourceHost>(new PepperFlashFileHost( 77 scoped_refptr<ResourceMessageFilter> file_filter(
74 host_, instance, params.pp_resource())); 78 new PepperFlashFileMessageFilter(instance, host_));
79 return scoped_ptr<ResourceHost>(new MessageFilterHost(
80 host_->GetPpapiHost(), instance, params.pp_resource(),
81 file_filter));
82 }
75 } 83 }
76 } 84 }
77 85
78 return scoped_ptr<ResourceHost>(); 86 return scoped_ptr<ResourceHost>();
79 } 87 }
80 88
81 const ppapi::PpapiPermissions& 89 const ppapi::PpapiPermissions&
82 ContentBrowserPepperHostFactory::GetPermissions() const { 90 ContentBrowserPepperHostFactory::GetPermissions() const {
83 return host_->GetPpapiHost()->permissions(); 91 return host_->GetPpapiHost()->permissions();
84 } 92 }
85 93
86 } // namespace content 94 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/browser/renderer_host/pepper/pepper_flash_file_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698