| 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/renderer_host/pepper/browser_ppapi_host_impl.h" | 5 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 7 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 8 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
| 9 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| 10 | 11 |
| 11 namespace content { | 12 namespace content { |
| 12 | 13 |
| 13 BrowserPpapiHostImpl::BrowserPpapiHostImpl( | 14 BrowserPpapiHostImpl::BrowserPpapiHostImpl( |
| 14 IPC::Sender* sender, | 15 IPC::Sender* sender, |
| 15 const ppapi::PpapiPermissions& permissions) | 16 const ppapi::PpapiPermissions& permissions) |
| 16 : ppapi_host_(sender, permissions), | 17 : ppapi_host_(sender, permissions), |
| 17 plugin_process_handle_(base::kNullProcessHandle) { | 18 plugin_process_handle_(base::kNullProcessHandle) { |
| 18 ppapi_host_.AddHostFactoryFilter(scoped_ptr<ppapi::host::HostFactory>( | 19 ppapi_host_.AddHostFactoryFilter(scoped_ptr<ppapi::host::HostFactory>( |
| 19 new ContentBrowserPepperHostFactory(this))); | 20 new ContentBrowserPepperHostFactory(this))); |
| 21 |
| 22 // TODO(brettw) bug 147507: Remove this log statement when we figure out why |
| 23 // permissions aren't hooked up properly. |
| 24 LOG(INFO) << "BrowserPpapiHostImpl::BrowserPpapiHostImpl " |
| 25 << "permissions = " << permissions.GetBits(); |
| 20 } | 26 } |
| 21 | 27 |
| 22 BrowserPpapiHostImpl::~BrowserPpapiHostImpl() { | 28 BrowserPpapiHostImpl::~BrowserPpapiHostImpl() { |
| 23 } | 29 } |
| 24 | 30 |
| 25 bool BrowserPpapiHostImpl::OnMessageReceived(const IPC::Message& msg) { | 31 bool BrowserPpapiHostImpl::OnMessageReceived(const IPC::Message& msg) { |
| 26 /* TODO(brettw) when we add messages, here, the code should look like this: | 32 /* TODO(brettw) when we add messages, here, the code should look like this: |
| 27 bool handled = true; | 33 bool handled = true; |
| 28 IPC_BEGIN_MESSAGE_MAP(BrowserPpapiHostImpl, msg) | 34 IPC_BEGIN_MESSAGE_MAP(BrowserPpapiHostImpl, msg) |
| 29 // Add necessary message handlers here. | 35 // Add necessary message handlers here. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void BrowserPpapiHostImpl::DeleteInstanceForView(PP_Instance instance) { | 84 void BrowserPpapiHostImpl::DeleteInstanceForView(PP_Instance instance) { |
| 79 InstanceToViewMap::iterator found = instance_to_view_.find(instance); | 85 InstanceToViewMap::iterator found = instance_to_view_.find(instance); |
| 80 if (found == instance_to_view_.end()) { | 86 if (found == instance_to_view_.end()) { |
| 81 NOTREACHED(); | 87 NOTREACHED(); |
| 82 return; | 88 return; |
| 83 } | 89 } |
| 84 instance_to_view_.erase(found); | 90 instance_to_view_.erase(found); |
| 85 } | 91 } |
| 86 | 92 |
| 87 } // namespace content | 93 } // namespace content |
| OLD | NEW |