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/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_gamepad_host.h" | 8 #include "content/browser/renderer_host/pepper/pepper_gamepad_host.h" |
9 #include "ppapi/host/resource_host.h" | 9 #include "ppapi/host/resource_host.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost( | 24 scoped_ptr<ResourceHost> ContentBrowserPepperHostFactory::CreateResourceHost( |
25 ppapi::host::PpapiHost* host, | 25 ppapi::host::PpapiHost* host, |
26 const ppapi::proxy::ResourceMessageCallParams& params, | 26 const ppapi::proxy::ResourceMessageCallParams& params, |
27 PP_Instance instance, | 27 PP_Instance instance, |
28 const IPC::Message& message) { | 28 const IPC::Message& message) { |
29 DCHECK(host == host_->GetPpapiHost()); | 29 DCHECK(host == host_->GetPpapiHost()); |
30 | 30 |
31 // Make sure the plugin is giving us a valid instance for this resource. | 31 // Make sure the plugin is giving us a valid instance for this resource. |
32 /* TODO(brettw) make this work. The browser should be aware of all valid | |
33 instances. | |
34 if (!host_->IsValidInstance(instance)) | 32 if (!host_->IsValidInstance(instance)) |
35 return scoped_ptr<ResourceHost>(); | 33 return scoped_ptr<ResourceHost>(); |
36 */ | |
37 | 34 |
38 // Public interfaces with no permissions required. | 35 // Public interfaces with no permissions required. |
39 switch (message.type()) { | 36 switch (message.type()) { |
40 case PpapiHostMsg_Gamepad_Create::ID: | 37 case PpapiHostMsg_Gamepad_Create::ID: |
41 return scoped_ptr<ResourceHost>(new PepperGamepadHost( | 38 return scoped_ptr<ResourceHost>(new PepperGamepadHost( |
42 host_, instance, params.pp_resource())); | 39 host_, instance, params.pp_resource())); |
43 } | 40 } |
44 return scoped_ptr<ResourceHost>(); | 41 return scoped_ptr<ResourceHost>(); |
45 } | 42 } |
46 | 43 |
47 } // namespace content | 44 } // namespace content |
OLD | NEW |