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/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bit_cast.h" | 10 #include "base/bit_cast.h" |
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2969 // Save the original module and switch over to the new one now that this | 2969 // Save the original module and switch over to the new one now that this |
2970 // plugin is using the IPC-based proxy. | 2970 // plugin is using the IPC-based proxy. |
2971 original_module_ = module_; | 2971 original_module_ = module_; |
2972 module_ = module; | 2972 module_ = module; |
2973 | 2973 |
2974 // For NaCl instances, remember the NaCl plugin instance interface, so we | 2974 // For NaCl instances, remember the NaCl plugin instance interface, so we |
2975 // can shut it down by calling its DidDestroy in our Delete() method. | 2975 // can shut it down by calling its DidDestroy in our Delete() method. |
2976 original_instance_interface_.reset(instance_interface_.release()); | 2976 original_instance_interface_.reset(instance_interface_.release()); |
2977 | 2977 |
2978 base::Callback<const void*(const char*)> get_plugin_interface_func = | 2978 base::Callback<const void*(const char*)> get_plugin_interface_func = |
2979 base::Bind(&PluginModule::GetPluginInterface, module_.get()); | 2979 base::Bind(&PluginModule::GetPluginInterface, module_); |
2980 PPP_Instance_Combined* ppp_instance_combined = | 2980 PPP_Instance_Combined* ppp_instance_combined = |
2981 PPP_Instance_Combined::Create(get_plugin_interface_func); | 2981 PPP_Instance_Combined::Create(get_plugin_interface_func); |
2982 if (!ppp_instance_combined) { | 2982 if (!ppp_instance_combined) { |
2983 // The proxy must support at least one usable PPP_Instance interface. | 2983 // The proxy must support at least one usable PPP_Instance interface. |
2984 // While this could be a failure to implement the interface in the NaCl | 2984 // While this could be a failure to implement the interface in the NaCl |
2985 // module, it is more likely that the NaCl process has crashed. Either | 2985 // module, it is more likely that the NaCl process has crashed. Either |
2986 // way, report that module initialization failed. | 2986 // way, report that module initialization failed. |
2987 return PP_EXTERNAL_PLUGIN_ERROR_MODULE; | 2987 return PP_EXTERNAL_PLUGIN_ERROR_MODULE; |
2988 } | 2988 } |
2989 | 2989 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3444 const cc::TextureMailbox& mailbox) const { | 3444 const cc::TextureMailbox& mailbox) const { |
3445 auto it = | 3445 auto it = |
3446 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), | 3446 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), |
3447 [&mailbox](const TextureMailboxRefCount& ref_count) { | 3447 [&mailbox](const TextureMailboxRefCount& ref_count) { |
3448 return ref_count.first.mailbox() == mailbox.mailbox(); | 3448 return ref_count.first.mailbox() == mailbox.mailbox(); |
3449 }); | 3449 }); |
3450 return it != texture_ref_counts_.end(); | 3450 return it != texture_ref_counts_.end(); |
3451 } | 3451 } |
3452 | 3452 |
3453 } // namespace content | 3453 } // namespace content |
OLD | NEW |