| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 uint32_t base_permissions = info.permissions; | 323 uint32_t base_permissions = info.permissions; |
| 324 | 324 |
| 325 // We don't have to do any whitelisting for APIs in this process host, so | 325 // We don't have to do any whitelisting for APIs in this process host, so |
| 326 // don't bother passing a browser context or document url here. | 326 // don't bother passing a browser context or document url here. |
| 327 if (GetContentClient()->browser()->IsPluginAllowedToUseDevChannelAPIs( | 327 if (GetContentClient()->browser()->IsPluginAllowedToUseDevChannelAPIs( |
| 328 NULL, GURL())) | 328 NULL, GURL())) |
| 329 base_permissions |= ppapi::PERMISSION_DEV_CHANNEL; | 329 base_permissions |= ppapi::PERMISSION_DEV_CHANNEL; |
| 330 permissions_ = ppapi::PpapiPermissions::GetForCommandLine(base_permissions); | 330 permissions_ = ppapi::PpapiPermissions::GetForCommandLine(base_permissions); |
| 331 | 331 |
| 332 process_.reset(new BrowserChildProcessHostImpl( | 332 process_.reset(new BrowserChildProcessHostImpl( |
| 333 PROCESS_TYPE_PPAPI_PLUGIN, this, kPluginMojoApplicationName)); | 333 PROCESS_TYPE_PPAPI_PLUGIN, this, kPluginServiceName)); |
| 334 | 334 |
| 335 host_impl_.reset(new BrowserPpapiHostImpl(this, permissions_, info.name, | 335 host_impl_.reset(new BrowserPpapiHostImpl(this, permissions_, info.name, |
| 336 info.path, profile_data_directory, | 336 info.path, profile_data_directory, |
| 337 false /* in_process */, | 337 false /* in_process */, |
| 338 false /* external_plugin */)); | 338 false /* external_plugin */)); |
| 339 | 339 |
| 340 filter_ = new PepperMessageFilter(); | 340 filter_ = new PepperMessageFilter(); |
| 341 process_->AddFilter(filter_.get()); | 341 process_->AddFilter(filter_.get()); |
| 342 process_->GetHost()->AddFilter(host_impl_->message_filter().get()); | 342 process_->GetHost()->AddFilter(host_impl_->message_filter().get()); |
| 343 #if defined(OS_WIN) | 343 #if defined(OS_WIN) |
| 344 process_->AddFilter(new DWriteFontProxyMessageFilter()); | 344 process_->AddFilter(new DWriteFontProxyMessageFilter()); |
| 345 #endif | 345 #endif |
| 346 | 346 |
| 347 GetContentClient()->browser()->DidCreatePpapiPlugin(host_impl_.get()); | 347 GetContentClient()->browser()->DidCreatePpapiPlugin(host_impl_.get()); |
| 348 | 348 |
| 349 // Only request network status updates if the plugin has dev permissions. | 349 // Only request network status updates if the plugin has dev permissions. |
| 350 if (permissions_.HasPermission(ppapi::PERMISSION_DEV)) | 350 if (permissions_.HasPermission(ppapi::PERMISSION_DEV)) |
| 351 network_observer_.reset(new PluginNetworkObserver(this)); | 351 network_observer_.reset(new PluginNetworkObserver(this)); |
| 352 } | 352 } |
| 353 | 353 |
| 354 PpapiPluginProcessHost::PpapiPluginProcessHost() : is_broker_(true) { | 354 PpapiPluginProcessHost::PpapiPluginProcessHost() : is_broker_(true) { |
| 355 process_.reset(new BrowserChildProcessHostImpl( | 355 process_.reset(new BrowserChildProcessHostImpl( |
| 356 PROCESS_TYPE_PPAPI_BROKER, this, kPluginMojoApplicationName)); | 356 PROCESS_TYPE_PPAPI_BROKER, this, kPluginServiceName)); |
| 357 | 357 |
| 358 ppapi::PpapiPermissions permissions; // No permissions. | 358 ppapi::PpapiPermissions permissions; // No permissions. |
| 359 // The plugin name, path and profile data directory shouldn't be needed for | 359 // The plugin name, path and profile data directory shouldn't be needed for |
| 360 // the broker. | 360 // the broker. |
| 361 host_impl_.reset(new BrowserPpapiHostImpl(this, permissions, | 361 host_impl_.reset(new BrowserPpapiHostImpl(this, permissions, |
| 362 std::string(), base::FilePath(), | 362 std::string(), base::FilePath(), |
| 363 base::FilePath(), | 363 base::FilePath(), |
| 364 false /* in_process */, | 364 false /* in_process */, |
| 365 false /* external_plugin */)); | 365 false /* external_plugin */)); |
| 366 } | 366 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // sent_requests_ queue should be the one that the plugin just created. | 559 // sent_requests_ queue should be the one that the plugin just created. |
| 560 Client* client = sent_requests_.front(); | 560 Client* client = sent_requests_.front(); |
| 561 sent_requests_.pop(); | 561 sent_requests_.pop(); |
| 562 | 562 |
| 563 const ChildProcessData& data = process_->GetData(); | 563 const ChildProcessData& data = process_->GetData(); |
| 564 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 564 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
| 565 data.id); | 565 data.id); |
| 566 } | 566 } |
| 567 | 567 |
| 568 } // namespace content | 568 } // namespace content |
| OLD | NEW |