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

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

Issue 12213066: Use base namespace for FilePath in content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
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/browser_ppapi_host_impl.h" 5 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h"
6 6
7 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" 7 #include "content/browser/renderer_host/pepper/pepper_message_filter.h"
8 #include "content/browser/tracing/trace_message_filter.h" 8 #include "content/browser/tracing/trace_message_filter.h"
9 #include "content/common/pepper_renderer_instance_data.h" 9 #include "content/common/pepper_renderer_instance_data.h"
10 #include "content/public/browser/render_view_host.h" 10 #include "content/public/browser/render_view_host.h"
11 #include "content/public/common/process_type.h" 11 #include "content/public/common/process_type.h"
12 #include "ipc/ipc_message_macros.h" 12 #include "ipc/ipc_message_macros.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 // static 16 // static
17 BrowserPpapiHost* BrowserPpapiHost::CreateExternalPluginProcess( 17 BrowserPpapiHost* BrowserPpapiHost::CreateExternalPluginProcess(
18 IPC::Sender* sender, 18 IPC::Sender* sender,
19 ppapi::PpapiPermissions permissions, 19 ppapi::PpapiPermissions permissions,
20 base::ProcessHandle plugin_child_process, 20 base::ProcessHandle plugin_child_process,
21 IPC::ChannelProxy* channel, 21 IPC::ChannelProxy* channel,
22 net::HostResolver* host_resolver, 22 net::HostResolver* host_resolver,
23 int render_process_id, 23 int render_process_id,
24 int render_view_id) { 24 int render_view_id) {
25 // TODO(raymes): Figure out how to plumb plugin_name and 25 // TODO(raymes): Figure out how to plumb plugin_name and
26 // profile_data_directory through for NaCl. They are currently only needed for 26 // profile_data_directory through for NaCl. They are currently only needed for
27 // PPB_Flash_File interfaces so it doesn't matter. 27 // PPB_Flash_File interfaces so it doesn't matter.
28 std::string plugin_name; 28 std::string plugin_name;
29 FilePath profile_data_directory; 29 base::FilePath profile_data_directory;
30 BrowserPpapiHostImpl* browser_ppapi_host = 30 BrowserPpapiHostImpl* browser_ppapi_host =
31 new BrowserPpapiHostImpl(sender, permissions, plugin_name, 31 new BrowserPpapiHostImpl(sender, permissions, plugin_name,
32 profile_data_directory, 32 profile_data_directory,
33 PROCESS_TYPE_NACL_LOADER); 33 PROCESS_TYPE_NACL_LOADER);
34 browser_ppapi_host->set_plugin_process_handle(plugin_child_process); 34 browser_ppapi_host->set_plugin_process_handle(plugin_child_process);
35 35
36 channel->AddFilter( 36 channel->AddFilter(
37 new PepperMessageFilter(PROCESS_TYPE_NACL_LOADER, 37 new PepperMessageFilter(PROCESS_TYPE_NACL_LOADER,
38 permissions, 38 permissions,
39 host_resolver, 39 host_resolver,
40 render_process_id, 40 render_process_id,
41 render_view_id)); 41 render_view_id));
42 channel->AddFilter(browser_ppapi_host->message_filter()); 42 channel->AddFilter(browser_ppapi_host->message_filter());
43 channel->AddFilter(new TraceMessageFilter()); 43 channel->AddFilter(new TraceMessageFilter());
44 44
45 return browser_ppapi_host; 45 return browser_ppapi_host;
46 } 46 }
47 47
48 BrowserPpapiHostImpl::BrowserPpapiHostImpl( 48 BrowserPpapiHostImpl::BrowserPpapiHostImpl(
49 IPC::Sender* sender, 49 IPC::Sender* sender,
50 const ppapi::PpapiPermissions& permissions, 50 const ppapi::PpapiPermissions& permissions,
51 const std::string& plugin_name, 51 const std::string& plugin_name,
52 const FilePath& profile_data_directory, 52 const base::FilePath& profile_data_directory,
53 ProcessType plugin_process_type) 53 ProcessType plugin_process_type)
54 : ppapi_host_(new ppapi::host::PpapiHost(sender, permissions)), 54 : ppapi_host_(new ppapi::host::PpapiHost(sender, permissions)),
55 plugin_process_handle_(base::kNullProcessHandle), 55 plugin_process_handle_(base::kNullProcessHandle),
56 plugin_name_(plugin_name), 56 plugin_name_(plugin_name),
57 profile_data_directory_(profile_data_directory), 57 profile_data_directory_(profile_data_directory),
58 plugin_process_type_(plugin_process_type) { 58 plugin_process_type_(plugin_process_type) {
59 message_filter_ = new HostMessageFilter(ppapi_host_.get()); 59 message_filter_ = new HostMessageFilter(ppapi_host_.get());
60 ppapi_host_->AddHostFactoryFilter(scoped_ptr<ppapi::host::HostFactory>( 60 ppapi_host_->AddHostFactoryFilter(scoped_ptr<ppapi::host::HostFactory>(
61 new ContentBrowserPepperHostFactory(this))); 61 new ContentBrowserPepperHostFactory(this)));
62 } 62 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 *render_process_id = found->second.render_process_id; 99 *render_process_id = found->second.render_process_id;
100 *render_view_id = found->second.render_view_id; 100 *render_view_id = found->second.render_view_id;
101 return true; 101 return true;
102 } 102 }
103 103
104 const std::string& BrowserPpapiHostImpl::GetPluginName() { 104 const std::string& BrowserPpapiHostImpl::GetPluginName() {
105 return plugin_name_; 105 return plugin_name_;
106 } 106 }
107 107
108 const FilePath& BrowserPpapiHostImpl::GetProfileDataDirectory() { 108 const base::FilePath& BrowserPpapiHostImpl::GetProfileDataDirectory() {
109 return profile_data_directory_; 109 return profile_data_directory_;
110 } 110 }
111 111
112 GURL BrowserPpapiHostImpl::GetDocumentURLForInstance(PP_Instance instance) { 112 GURL BrowserPpapiHostImpl::GetDocumentURLForInstance(PP_Instance instance) {
113 InstanceMap::const_iterator found = instance_map_.find(instance); 113 InstanceMap::const_iterator found = instance_map_.find(instance);
114 if (found == instance_map_.end()) 114 if (found == instance_map_.end())
115 return GURL(); 115 return GURL();
116 return found->second.document_url; 116 return found->second.document_url;
117 } 117 }
118 118
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 */ 155 */
156 return ppapi_host_->OnMessageReceived(msg); 156 return ppapi_host_->OnMessageReceived(msg);
157 } 157 }
158 158
159 void BrowserPpapiHostImpl::HostMessageFilter::OnHostDestroyed() { 159 void BrowserPpapiHostImpl::HostMessageFilter::OnHostDestroyed() {
160 DCHECK(ppapi_host_); 160 DCHECK(ppapi_host_);
161 ppapi_host_ = NULL; 161 ppapi_host_ = NULL;
162 } 162 }
163 163
164 } // namespace content 164 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698