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 "webkit/plugins/npapi/webplugin_delegate_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 bool should_load = PlatformInitialize(); | 97 bool should_load = PlatformInitialize(); |
98 | 98 |
99 plugin_url_ = url.spec(); | 99 plugin_url_ = url.spec(); |
100 | 100 |
101 return should_load; | 101 return should_load; |
102 } | 102 } |
103 | 103 |
104 void WebPluginDelegateImpl::DestroyInstance() { | 104 void WebPluginDelegateImpl::DestroyInstance() { |
105 if (instance_ && (instance_->npp()->ndata != NULL)) { | 105 if (instance_.get() && (instance_->npp()->ndata != NULL)) { |
106 // Shutdown all streams before destroying so that | 106 // Shutdown all streams before destroying so that |
107 // no streams are left "in progress". Need to do | 107 // no streams are left "in progress". Need to do |
108 // this before calling set_web_plugin(NULL) because the | 108 // this before calling set_web_plugin(NULL) because the |
109 // instance uses the helper to do the download. | 109 // instance uses the helper to do the download. |
110 instance_->CloseStreams(); | 110 instance_->CloseStreams(); |
111 | 111 |
112 window_.window = NULL; | 112 window_.window = NULL; |
113 if (creation_succeeded_ && | 113 if (creation_succeeded_ && |
114 !(quirks_ & PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY)) { | 114 !(quirks_ & PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY)) { |
115 instance_->NPP_SetWindow(&window_); | 115 instance_->NPP_SetWindow(&window_); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 resource_id, url, std::string(), notify_id); | 297 resource_id, url, std::string(), notify_id); |
298 } | 298 } |
299 | 299 |
300 WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient( | 300 WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient( |
301 unsigned long resource_id, int range_request_id) { | 301 unsigned long resource_id, int range_request_id) { |
302 return instance()->GetRangeRequest(range_request_id); | 302 return instance()->GetRangeRequest(range_request_id); |
303 } | 303 } |
304 | 304 |
305 } // namespace npapi | 305 } // namespace npapi |
306 } // namespace webkit | 306 } // namespace webkit |
OLD | NEW |