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_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 scoped_ptr<ppapi::host::ResourceHost>(loader_host)); | 1349 scoped_ptr<ppapi::host::ResourceHost>(loader_host)); |
1350 DCHECK(pending_host_id); | 1350 DCHECK(pending_host_id); |
1351 ppapi::URLResponseInfoData data = | 1351 ppapi::URLResponseInfoData data = |
1352 DataFromWebURLResponse(pp_instance, response); | 1352 DataFromWebURLResponse(pp_instance, response); |
1353 | 1353 |
1354 if (host_impl->in_process_router()) { | 1354 if (host_impl->in_process_router()) { |
1355 // Running in-process, we can just create the resource and call the | 1355 // Running in-process, we can just create the resource and call the |
1356 // PPP_Instance function directly. | 1356 // PPP_Instance function directly. |
1357 scoped_refptr<ppapi::proxy::URLLoaderResource> loader_resource( | 1357 scoped_refptr<ppapi::proxy::URLLoaderResource> loader_resource( |
1358 new ppapi::proxy::URLLoaderResource( | 1358 new ppapi::proxy::URLLoaderResource( |
1359 host_impl->in_process_router()->GetPluginConnection(), | 1359 host_impl->in_process_router()->GetPluginConnection(pp_instance), |
1360 pp_instance, pending_host_id, data)); | 1360 pp_instance, pending_host_id, data)); |
1361 | 1361 |
1362 PP_Resource loader_pp_resource = loader_resource->GetReference(); | 1362 PP_Resource loader_pp_resource = loader_resource->GetReference(); |
1363 if (!instance->instance_interface()->HandleDocumentLoad( | 1363 if (!instance->instance_interface()->HandleDocumentLoad( |
1364 instance->pp_instance(), loader_pp_resource)) | 1364 instance->pp_instance(), loader_pp_resource)) |
1365 loader_resource->Close(); | 1365 loader_resource->Close(); |
1366 // We don't pass a ref into the plugin, if it wants one, it will have taken | 1366 // We don't pass a ref into the plugin, if it wants one, it will have taken |
1367 // an additional one. | 1367 // an additional one. |
1368 ppapi::PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource( | 1368 ppapi::PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource( |
1369 loader_pp_resource); | 1369 loader_pp_resource); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1712 should_close_source); | 1712 should_close_source); |
1713 } | 1713 } |
1714 | 1714 |
1715 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const { | 1715 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const { |
1716 RendererPpapiHostImpl* host = | 1716 RendererPpapiHostImpl* host = |
1717 RendererPpapiHostImpl::GetForPPInstance(instance); | 1717 RendererPpapiHostImpl::GetForPPInstance(instance); |
1718 return host && host->IsRunningInProcess(); | 1718 return host && host->IsRunningInProcess(); |
1719 } | 1719 } |
1720 | 1720 |
1721 } // namespace content | 1721 } // namespace content |
OLD | NEW |