OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } | 279 } |
280 ATLASSERT(np_object); | 280 ATLASSERT(np_object); |
281 | 281 |
282 scriptable_object_ = browser_proxy_->GetDispatchObject(np_object); | 282 scriptable_object_ = browser_proxy_->GetDispatchObject(np_object); |
283 | 283 |
284 NPBrowserProxy::GetBrowserFunctions()->releaseobject(np_object); | 284 NPBrowserProxy::GetBrowserFunctions()->releaseobject(np_object); |
285 | 285 |
286 return true; | 286 return true; |
287 } | 287 } |
288 | 288 |
| 289 bool NPPluginProxy::SetWindow(const NPWindow& window) { |
| 290 if (plugin_funcs_.setwindow != NULL && |
| 291 NPERR_NO_ERROR != plugin_funcs_.setwindow( |
| 292 GetNPP(), |
| 293 const_cast<NPWindow*>(&window))) { |
| 294 plugin_funcs_.destroy(GetNPP(), NULL); |
| 295 NP_Shutdown_(); |
| 296 ATLASSERT(false && "Unknown failure re-setting plugin window."); |
| 297 return false; |
| 298 } |
| 299 return true; |
| 300 } |
| 301 |
289 void NPPluginProxy::TearDown() { | 302 void NPPluginProxy::TearDown() { |
290 // Block until all stream operations requested by this plug-in have | 303 // Block until all stream operations requested by this plug-in have |
291 // completed. | 304 // completed. |
292 HRESULT hr; | 305 HRESULT hr; |
293 std::vector<HANDLE> stream_handles; | 306 std::vector<HANDLE> stream_handles; |
294 for (StreamOpArray::size_type x = 0; x < active_stream_ops_.size(); ++x) { | 307 for (StreamOpArray::size_type x = 0; x < active_stream_ops_.size(); ++x) { |
295 // Request that the stream finish early - so that large file transfers do | 308 // Request that the stream finish early - so that large file transfers do |
296 // not block leaving the page. | 309 // not block leaving the page. |
297 hr = active_stream_ops_[x]->RequestCancellation(); | 310 hr = active_stream_ops_[x]->RequestCancellation(); |
298 ATLASSERT(SUCCEEDED(hr) && | 311 ATLASSERT(SUCCEEDED(hr) && |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // Load and initialize the plug-in with the current window settings. | 436 // Load and initialize the plug-in with the current window settings. |
424 scoped_ptr<NPPluginProxy> plugin_proxy(new NPPluginProxy); | 437 scoped_ptr<NPPluginProxy> plugin_proxy(new NPPluginProxy); |
425 if (!plugin_proxy->MapEntryPoints(np_plugin)) { | 438 if (!plugin_proxy->MapEntryPoints(np_plugin)) { |
426 FreeLibrary(np_plugin); | 439 FreeLibrary(np_plugin); |
427 return E_FAIL; | 440 return E_FAIL; |
428 } | 441 } |
429 | 442 |
430 *proxy_instance = plugin_proxy.release(); | 443 *proxy_instance = plugin_proxy.release(); |
431 return S_OK; | 444 return S_OK; |
432 } | 445 } |
OLD | NEW |