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.get()) | 41 if (scriptable_object) |
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 | 388 |
389 void WebPluginDelegateStub::OnHTTPRangeRequestReply( | 389 void WebPluginDelegateStub::OnHTTPRangeRequestReply( |
390 unsigned long resource_id, int range_request_id) { | 390 unsigned long resource_id, int range_request_id) { |
391 WebPluginResourceClient* resource_client = | 391 WebPluginResourceClient* resource_client = |
392 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); | 392 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); |
393 webplugin_->OnResourceCreated(resource_id, resource_client); | 393 webplugin_->OnResourceCreated(resource_id, resource_client); |
394 } | 394 } |
395 | 395 |
396 } // namespace content | 396 } // namespace content |
OLD | NEW |