| 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/plugin/webplugin_delegate_stub.h" | 5 #include "content/plugin/webplugin_delegate_stub.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 using webkit::npapi::WebPluginResourceClient; | 31 using webkit::npapi::WebPluginResourceClient; |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| 34 | 34 |
| 35 static void DestroyWebPluginAndDelegate( | 35 static void DestroyWebPluginAndDelegate( |
| 36 base::WeakPtr<NPObjectStub> scriptable_object, | 36 base::WeakPtr<NPObjectStub> scriptable_object, |
| 37 webkit::npapi::WebPluginDelegateImpl* delegate, | 37 webkit::npapi::WebPluginDelegateImpl* delegate, |
| 38 WebPlugin* webplugin) { | 38 WebPlugin* webplugin) { |
| 39 // The plugin may not expect us to try to release the scriptable object | 39 // The plugin may not expect us to try to release the scriptable object |
| 40 // after calling NPP_Destroy on the instance, so delete the stub now. | 40 // after calling NPP_Destroy on the instance, so delete the stub now. |
| 41 if (scriptable_object) | 41 if (scriptable_object.get()) |
| 42 scriptable_object->DeleteSoon(); | 42 scriptable_object->DeleteSoon(); |
| 43 // WebPlugin must outlive WebPluginDelegate. | 43 // WebPlugin must outlive WebPluginDelegate. |
| 44 if (delegate) | 44 if (delegate) |
| 45 delegate->PluginDestroyed(); | 45 delegate->PluginDestroyed(); |
| 46 | 46 |
| 47 delete webplugin; | 47 delete webplugin; |
| 48 } | 48 } |
| 49 | 49 |
| 50 WebPluginDelegateStub::WebPluginDelegateStub( | 50 WebPluginDelegateStub::WebPluginDelegateStub( |
| 51 const std::string& mime_type, int instance_id, PluginChannel* channel) : | 51 const std::string& mime_type, int instance_id, PluginChannel* channel) : |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 } | 392 } |
| 393 | 393 |
| 394 void WebPluginDelegateStub::OnHTTPRangeRequestReply( | 394 void WebPluginDelegateStub::OnHTTPRangeRequestReply( |
| 395 unsigned long resource_id, int range_request_id) { | 395 unsigned long resource_id, int range_request_id) { |
| 396 WebPluginResourceClient* resource_client = | 396 WebPluginResourceClient* resource_client = |
| 397 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); | 397 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); |
| 398 webplugin_->OnResourceCreated(resource_id, resource_client); | 398 webplugin_->OnResourceCreated(resource_id, resource_client); |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace content | 401 } // namespace content |
| OLD | NEW |