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/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 : network_observer_(new PluginNetworkObserver(this)), | 120 : network_observer_(new PluginNetworkObserver(this)), |
121 profile_data_directory_(profile_data_directory), | 121 profile_data_directory_(profile_data_directory), |
122 is_broker_(false) { | 122 is_broker_(false) { |
123 process_.reset(new BrowserChildProcessHostImpl( | 123 process_.reset(new BrowserChildProcessHostImpl( |
124 content::PROCESS_TYPE_PPAPI_PLUGIN, this)); | 124 content::PROCESS_TYPE_PPAPI_PLUGIN, this)); |
125 | 125 |
126 filter_ = new PepperMessageFilter(PepperMessageFilter::PLUGIN, | 126 filter_ = new PepperMessageFilter(PepperMessageFilter::PLUGIN, |
127 host_resolver); | 127 host_resolver); |
128 | 128 |
129 ppapi::PpapiPermissions permissions(info.permissions); | 129 ppapi::PpapiPermissions permissions(info.permissions); |
130 host_impl_.reset(new content::BrowserPpapiHostImpl(this, permissions)); | 130 host_impl_ = new content::BrowserPpapiHostImpl(this, permissions); |
131 | 131 |
132 file_filter_ = new PepperTrustedFileMessageFilter( | 132 file_filter_ = new PepperTrustedFileMessageFilter( |
133 process_->GetData().id, info.name, profile_data_directory); | 133 process_->GetData().id, info.name, profile_data_directory); |
134 | 134 |
135 process_->GetHost()->AddFilter(filter_.get()); | 135 process_->GetHost()->AddFilter(filter_.get()); |
136 process_->GetHost()->AddFilter(file_filter_.get()); | 136 process_->GetHost()->AddFilter(file_filter_.get()); |
| 137 process_->GetHost()->AddFilter(host_impl_.get()); |
137 } | 138 } |
138 | 139 |
139 PpapiPluginProcessHost::PpapiPluginProcessHost() | 140 PpapiPluginProcessHost::PpapiPluginProcessHost() |
140 : is_broker_(true) { | 141 : is_broker_(true) { |
141 process_.reset(new BrowserChildProcessHostImpl( | 142 process_.reset(new BrowserChildProcessHostImpl( |
142 content::PROCESS_TYPE_PPAPI_BROKER, this)); | 143 content::PROCESS_TYPE_PPAPI_BROKER, this)); |
143 } | 144 } |
144 | 145 |
145 bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) { | 146 bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) { |
146 plugin_path_ = info.path; | 147 plugin_path_ = info.path; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 if (sent_requests_.empty()) | 301 if (sent_requests_.empty()) |
301 return; | 302 return; |
302 | 303 |
303 // All requests should be processed FIFO, so the next item in the | 304 // All requests should be processed FIFO, so the next item in the |
304 // sent_requests_ queue should be the one that the plugin just created. | 305 // sent_requests_ queue should be the one that the plugin just created. |
305 Client* client = sent_requests_.front(); | 306 Client* client = sent_requests_.front(); |
306 sent_requests_.pop(); | 307 sent_requests_.pop(); |
307 | 308 |
308 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); | 309 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); |
309 } | 310 } |
OLD | NEW |