Changeset 55432 in webkit
- Timestamp:
- Mar 2, 2010 3:13:51 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55430 r55432 1 2010-03-02 Mark Rowe <mrowe@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Bug 30348: Implement private mode for plug-ins on Windows 6 <http://webkit.org/b/30348> / <rdar://problem/7562261> 7 8 * platform/win/Skipped: Remove plugins/private-browsing-mode-2.html now that it passes. 9 1 10 2010-03-02 Alexey Proskuryakov <ap@apple.com> 2 11 -
trunk/LayoutTests/platform/win/Skipped
r55375 r55432 675 675 plugins/private-browsing-mode.html 676 676 677 # https://bugs.webkit.org/show_bug.cgi?id=33180678 plugins/private-browsing-mode-2.html679 680 677 # Skip these two failures I introduced this morning while I explore them. 681 678 http/tests/globalhistory/history-delegate-basic-visited-links.html -
trunk/WebCore/ChangeLog
r55431 r55432 1 2010-03-02 Mark Rowe <mrowe@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Bug 30348: Implement private mode for plug-ins on Windows 6 <http://webkit.org/b/30348> / <rdar://problem/7562261> 7 8 Rework PluginView::getValue and PluginView::getValueStatic to remove the amount of code that 9 was duplicated across platforms. getValue and getValueStatic now call in to platform-specific 10 variants that indicate whether they handled the query. If the query is not handled by the 11 platform-specific variants then the cross-platform handler has a chance to handle it. 12 13 * plugins/PluginView.cpp: 14 (WebCore::PluginView::getValueStatic): Give the platform-specific variant a chance to handle the 15 variable lookup. If it does not handle it, return an error. 16 (WebCore::PluginView::getValue): Give the platform-specific variant and platform-specific static 17 variant a chance to handle the variable lookup. If they do not handle it, apply the cross-platform 18 handler. At the moment the cross-platform code handles NPNVWindowNPObject, NPNVPluginElementNPObject, 19 and NPNVprivateModeBool as they have an identical implementation across ports. 20 * plugins/PluginView.h: 21 * plugins/PluginViewNone.cpp: 22 (WebCore::PluginView::platformGetValue): PluginViewNone does not handle any lookups. 23 (WebCore::PluginView::platformGetValueStatic): Ditto. 24 * plugins/gtk/PluginViewGtk.cpp: 25 (WebCore::PluginView::platformGetValueStatic): 26 (WebCore::PluginView::platformGetValue): 27 platform-independent implementation. 28 * plugins/mac/PluginViewMac.cpp: 29 (WebCore::PluginView::platformGetValueStatic): 30 (WebCore::PluginView::platformGetValue): 31 * plugins/qt/PluginViewQt.cpp: 32 (WebCore::PluginView::platformGetValueStatic): 33 (WebCore::PluginView::platformGetValue): Fix a bug noticed while updating this code. 34 The Qt implementation of the handler for NPNVToolkit was relying on case fall-through 35 to have some values handled by the static handler. When NPNVprivateModeBool was added 36 it was placed before the default case, interferring with this fall-through. It now 37 explicitly indicates in this situation that it was not handled. 38 * plugins/symbian/PluginViewSymbian.cpp: 39 (WebCore::PluginView::platformGetValueStatic): 40 (WebCore::PluginView::platformGetValue): 41 * plugins/win/PluginViewWin.cpp: 42 (WebCore::PluginView::platformGetValueStatic): 43 (WebCore::PluginView::platformGetValue): 44 1 45 2010-03-02 Anders Carlsson <andersca@apple.com> 2 46 -
trunk/WebCore/plugins/PluginView.cpp
r55128 r55432 1301 1301 #endif 1302 1302 1303 NPError PluginView::getValueStatic(NPNVariable variable, void* value) 1304 { 1305 LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data()); 1306 1307 NPError result; 1308 if (platformGetValueStatic(variable, value, &result)) 1309 return result; 1310 1311 return NPERR_GENERIC_ERROR; 1312 } 1313 1314 NPError PluginView::getValue(NPNVariable variable, void* value) 1315 { 1316 LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data()); 1317 1318 NPError result; 1319 if (platformGetValue(variable, value, &result)) 1320 return result; 1321 1322 if (platformGetValueStatic(variable, value, &result)) 1323 return result; 1324 1325 switch (variable) { 1326 #if ENABLE(NETSCAPE_PLUGIN_API) 1327 case NPNVWindowNPObject: { 1328 if (m_isJavaScriptPaused) 1329 return NPERR_GENERIC_ERROR; 1330 1331 NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject(); 1332 1333 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 1334 if (windowScriptObject) 1335 _NPN_RetainObject(windowScriptObject); 1336 1337 void** v = (void**)value; 1338 *v = windowScriptObject; 1339 1340 return NPERR_NO_ERROR; 1341 } 1342 1343 case NPNVPluginElementNPObject: { 1344 if (m_isJavaScriptPaused) 1345 return NPERR_GENERIC_ERROR; 1346 1347 NPObject* pluginScriptObject = 0; 1348 1349 if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag)) 1350 pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject(); 1351 1352 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 1353 if (pluginScriptObject) 1354 _NPN_RetainObject(pluginScriptObject); 1355 1356 void** v = (void**)value; 1357 *v = pluginScriptObject; 1358 1359 return NPERR_NO_ERROR; 1360 } 1361 #endif 1362 1363 case NPNVprivateModeBool: { 1364 Page* page = m_parentFrame->page(); 1365 if (!page) 1366 return NPERR_GENERIC_ERROR; 1367 *((NPBool*)value) = !page->settings() || page->settings()->privateBrowsingEnabled(); 1368 return NPERR_NO_ERROR; 1369 } 1370 1371 default: 1372 return NPERR_GENERIC_ERROR; 1373 } 1374 } 1375 1303 1376 } // namespace WebCore -
trunk/WebCore/plugins/PluginView.h
r55332 r55432 245 245 #endif 246 246 247 static bool platformGetValueStatic(NPNVariable variable, void* value, NPError* result); 248 bool platformGetValue(NPNVariable variable, void* value, NPError* result); 249 247 250 RefPtr<Frame> m_parentFrame; 248 251 RefPtr<PluginPackage> m_plugin; -
trunk/WebCore/plugins/PluginViewNone.cpp
r55128 r55432 68 68 } 69 69 70 NPError PluginView::getValue(NPNVariable, void*)70 bool PluginView::platformGetValue(NPNVariable, void*, NPError*) 71 71 { 72 return 0;72 return false; 73 73 } 74 74 75 75 #if ENABLE(NETSCAPE_PLUGIN_API) 76 NPError PluginView::getValueStatic(NPNVariable, void*)76 bool PluginView::platformGetValueStatic(NPNVariable, void*, NPError*) 77 77 { 78 return 0;78 return false; 79 79 } 80 80 #endif -
trunk/WebCore/plugins/gtk/PluginViewGtk.cpp
r55405 r55432 588 588 } 589 589 590 NPError PluginView::getValueStatic(NPNVariable variable, void* value) 591 { 592 LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data()); 593 590 bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result) 591 { 594 592 switch (variable) { 595 593 case NPNVToolkit: … … 599 597 *static_cast<uint32*>(value) = 0; 600 598 #endif 601 return NPERR_NO_ERROR; 599 *result = NPERR_NO_ERROR; 600 return true; 602 601 603 602 case NPNVSupportsXEmbedBool: … … 607 606 *static_cast<NPBool*>(value) = false; 608 607 #endif 609 return NPERR_NO_ERROR; 608 *result = NPERR_NO_ERROR; 609 return true; 610 610 611 611 case NPNVjavascriptEnabledBool: 612 612 *static_cast<NPBool*>(value) = true; 613 return NPERR_NO_ERROR; 613 *result = NPERR_NO_ERROR; 614 return true; 614 615 615 616 case NPNVSupportsWindowless: … … 619 620 *static_cast<NPBool*>(value) = false; 620 621 #endif 621 return NPERR_NO_ERROR; 622 *result = NPERR_NO_ERROR; 623 return true; 622 624 623 625 default: 624 return NPERR_GENERIC_ERROR; 625 } 626 } 627 628 NPError PluginView::getValue(NPNVariable variable, void* value) 629 { 630 LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data()); 631 626 return false; 627 } 628 } 629 630 bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result) 631 { 632 632 switch (variable) { 633 633 case NPNVxDisplay: … … 637 637 else 638 638 *(void **)value = (void *)GTK_XTBIN(platformPluginWidget())->xtclient.xtdisplay; 639 returnNPERR_NO_ERROR;639 *result = NPERR_NO_ERROR; 640 640 #else 641 return NPERR_GENERIC_ERROR; 642 #endif 641 *result = NPERR_GENERIC_ERROR; 642 #endif 643 return true; 643 644 644 645 #if defined(XP_UNIX) … … 647 648 *(void **)value = XtDisplayToApplicationContext (GTK_XTBIN(platformPluginWidget())->xtclient.xtdisplay); 648 649 649 returnNPERR_NO_ERROR;650 *result = NPERR_NO_ERROR; 650 651 } else 651 return NPERR_GENERIC_ERROR; 652 #endif 653 654 #if ENABLE(NETSCAPE_PLUGIN_API) 655 case NPNVWindowNPObject: { 656 if (m_isJavaScriptPaused) 657 return NPERR_GENERIC_ERROR; 658 659 NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject(); 660 661 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 662 if (windowScriptObject) 663 _NPN_RetainObject(windowScriptObject); 664 665 void** v = (void**)value; 666 *v = windowScriptObject; 667 668 return NPERR_NO_ERROR; 669 } 670 671 case NPNVPluginElementNPObject: { 672 if (m_isJavaScriptPaused) 673 return NPERR_GENERIC_ERROR; 674 675 NPObject* pluginScriptObject = 0; 676 677 if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag)) 678 pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject(); 679 680 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 681 if (pluginScriptObject) 682 _NPN_RetainObject(pluginScriptObject); 683 684 void** v = (void**)value; 685 *v = pluginScriptObject; 686 687 return NPERR_NO_ERROR; 688 } 652 *result = NPERR_GENERIC_ERROR; 653 return true; 689 654 #endif 690 655 … … 698 663 *w = GDK_WINDOW_HWND(m_parentFrame->view()->hostWindow()->platformPageClient()->window); 699 664 #endif 700 return NPERR_NO_ERROR; 665 *result = NPERR_NO_ERROR; 666 return true; 701 667 } 702 668 703 case NPNVprivateModeBool: { 704 Page* page = m_parentFrame->page(); 705 if (!page) 706 return NPERR_GENERIC_ERROR; 707 *((NPBool*)value) = !page->settings() || page->settings()->privateBrowsingEnabled(); 708 return NPERR_NO_ERROR; 709 } 710 711 default: 712 return getValueStatic(variable, value); 669 default: 670 return false; 713 671 } 714 672 } -
trunk/WebCore/plugins/mac/PluginViewMac.cpp
r55368 r55432 255 255 // Used before the plugin view has been initialized properly, and as a 256 256 // fallback for variables that do not require a view to resolve. 257 NPError PluginView::getValueStatic(NPNVariable variable, void* value) 258 { 259 LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data()); 260 257 bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result) 258 { 261 259 switch (variable) { 262 260 case NPNVToolkit: 263 261 *static_cast<uint32*>(value) = 0; 264 return NPERR_NO_ERROR; 262 *result = NPERR_NO_ERROR; 263 return true; 265 264 266 265 case NPNVjavascriptEnabledBool: 267 266 *static_cast<NPBool*>(value) = true; 268 return NPERR_NO_ERROR; 267 *result = NPERR_NO_ERROR; 268 return true; 269 269 270 270 #ifndef NP_NO_CARBON 271 271 case NPNVsupportsCarbonBool: 272 272 *static_cast<NPBool*>(value) = true; 273 return NPERR_NO_ERROR; 273 *result = NPERR_NO_ERROR; 274 return true; 274 275 275 276 #endif 276 277 case NPNVsupportsCocoaBool: 277 278 *static_cast<NPBool*>(value) = false; 278 return NPERR_NO_ERROR; 279 *result = NPERR_NO_ERROR; 280 return true; 279 281 280 282 // CoreGraphics is the only drawing model we support 281 283 case NPNVsupportsCoreGraphicsBool: 282 284 *static_cast<NPBool*>(value) = true; 283 return NPERR_NO_ERROR; 285 *result = NPERR_NO_ERROR; 286 return true; 284 287 285 288 #ifndef NP_NO_QUICKDRAW … … 290 293 case NPNVsupportsCoreAnimationBool: 291 294 *static_cast<NPBool*>(value) = false; 292 return NPERR_NO_ERROR; 295 *result = NPERR_NO_ERROR; 296 return true; 293 297 294 298 default: 295 return NPERR_GENERIC_ERROR;299 return false; 296 300 } 297 301 } 298 302 299 303 // Used only for variables that need a view to resolve 300 NPError PluginView::getValue(NPNVariable variable, void* value) 301 { 302 LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data()); 303 304 switch (variable) { 305 case NPNVWindowNPObject: { 306 if (m_isJavaScriptPaused) 307 return NPERR_GENERIC_ERROR; 308 309 NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject(); 310 311 // Return value is expected to be retained, as described in 312 // <http://www.mozilla.org/projects/plugin/npruntime.html> 313 if (windowScriptObject) 314 _NPN_RetainObject(windowScriptObject); 315 316 void** v = (void**)value; 317 *v = windowScriptObject; 318 319 return NPERR_NO_ERROR; 320 } 321 322 case NPNVPluginElementNPObject: { 323 if (m_isJavaScriptPaused) 324 return NPERR_GENERIC_ERROR; 325 326 NPObject* pluginScriptObject = 0; 327 328 if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag)) 329 pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject(); 330 331 // Return value is expected to be retained, as described in 332 // <http://www.mozilla.org/projects/plugin/npruntime.html> 333 if (pluginScriptObject) 334 _NPN_RetainObject(pluginScriptObject); 335 336 void** v = (void**)value; 337 *v = pluginScriptObject; 338 339 return NPERR_NO_ERROR; 340 } 341 342 default: 343 return getValueStatic(variable, value); 344 } 345 346 } 304 bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* error) 305 { 306 return false; 307 } 308 347 309 void PluginView::setParent(ScrollView* parent) 348 310 { -
trunk/WebCore/plugins/qt/PluginViewQt.cpp
r55358 r55432 554 554 } 555 555 556 NPError PluginView::getValueStatic(NPNVariable variable, void* value) 557 { 558 LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data()); 559 556 bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result) 557 { 560 558 switch (variable) { 561 559 case NPNVToolkit: 562 560 *static_cast<uint32*>(value) = 0; 563 return NPERR_NO_ERROR; 561 *result = NPERR_NO_ERROR; 562 return true; 564 563 565 564 case NPNVSupportsXEmbedBool: 566 565 *static_cast<NPBool*>(value) = true; 567 return NPERR_NO_ERROR; 566 *result = NPERR_NO_ERROR; 567 return true; 568 568 569 569 case NPNVjavascriptEnabledBool: 570 570 *static_cast<NPBool*>(value) = true; 571 return NPERR_NO_ERROR; 571 *result = NPERR_NO_ERROR; 572 return true; 572 573 573 574 case NPNVSupportsWindowless: 574 575 *static_cast<NPBool*>(value) = true; 575 return NPERR_NO_ERROR; 576 *result = NPERR_NO_ERROR; 577 return true; 576 578 577 579 default: 578 return NPERR_GENERIC_ERROR; 579 } 580 } 581 582 NPError PluginView::getValue(NPNVariable variable, void* value) 583 { 584 LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data()); 585 580 return false; 581 } 582 } 583 584 bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result) 585 { 586 586 switch (variable) { 587 587 case NPNVxDisplay: 588 588 *(void **)value = QX11Info::display(); 589 return NPERR_NO_ERROR; 589 *result = NPERR_NO_ERROR; 590 return true; 590 591 591 592 case NPNVxtAppContext: 592 return NPERR_GENERIC_ERROR; 593 594 #if ENABLE(NETSCAPE_PLUGIN_API) 595 case NPNVWindowNPObject: { 596 if (m_isJavaScriptPaused) 597 return NPERR_GENERIC_ERROR; 598 599 NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject(); 600 601 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 602 if (windowScriptObject) 603 _NPN_RetainObject(windowScriptObject); 604 605 void** v = (void**)value; 606 *v = windowScriptObject; 607 608 return NPERR_NO_ERROR; 609 } 610 611 case NPNVPluginElementNPObject: { 612 if (m_isJavaScriptPaused) 613 return NPERR_GENERIC_ERROR; 614 615 NPObject* pluginScriptObject = 0; 616 617 if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag)) 618 pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject(); 619 620 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 621 if (pluginScriptObject) 622 _NPN_RetainObject(pluginScriptObject); 623 624 void** v = (void**)value; 625 *v = pluginScriptObject; 626 627 return NPERR_NO_ERROR; 628 } 629 #endif 593 *result = NPERR_GENERIC_ERROR; 594 return true; 630 595 631 596 case NPNVnetscapeWindow: { … … 633 598 QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient(); 634 599 *((XID *)w) = client ? client->ownerWidget()->window()->winId() : 0; 635 return NPERR_NO_ERROR; 600 *result = NPERR_NO_ERROR; 601 return true; 636 602 } 637 603 … … 639 605 if (m_plugin->quirks().contains(PluginQuirkRequiresGtkToolKit)) { 640 606 *((uint32 *)value) = 2; 641 return NPERR_NO_ERROR; 607 *result = NPERR_NO_ERROR; 608 return true; 642 609 } 643 644 case NPNVprivateModeBool: { 645 Page* page = m_parentFrame->page(); 646 if (!page) 647 return NPERR_GENERIC_ERROR; 648 *((NPBool*)value) = !page->settings() || page->settings()->privateBrowsingEnabled(); 649 return NPERR_NO_ERROR; 650 } 651 // fall through 610 return false; 611 652 612 default: 653 return getValueStatic(variable, value);613 return false; 654 614 } 655 615 } -
trunk/WebCore/plugins/symbian/PluginViewSymbian.cpp
r54235 r55432 308 308 } 309 309 310 NPError PluginView::getValueStatic(NPNVariable variable, void* value) 311 { 312 LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data()); 313 310 bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result) 311 { 314 312 switch (variable) { 315 313 case NPNVjavascriptEnabledBool: 316 314 *static_cast<NPBool*>(value) = true; 317 return NPERR_NO_ERROR; 315 *result = NPERR_NO_ERROR; 316 return true; 318 317 319 318 case NPNVSupportsWindowless: 320 319 *static_cast<NPBool*>(value) = true; 321 return NPERR_NO_ERROR; 320 *result = NPERR_NO_ERROR; 321 return true; 322 322 323 323 default: 324 return NPERR_GENERIC_ERROR; 325 } 326 } 327 328 NPError PluginView::getValue(NPNVariable variable, void* value) 329 { 330 LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data()); 331 332 switch (variable) { 333 case NPNVWindowNPObject: { 334 if (m_isJavaScriptPaused) 335 return NPERR_GENERIC_ERROR; 336 337 NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject(); 338 339 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 340 if (windowScriptObject) 341 _NPN_RetainObject(windowScriptObject); 342 343 void** v = (void**)value; 344 *v = windowScriptObject; 345 346 return NPERR_NO_ERROR; 347 } 348 349 case NPNVPluginElementNPObject: { 350 if (m_isJavaScriptPaused) 351 return NPERR_GENERIC_ERROR; 352 353 NPObject* pluginScriptObject = 0; 354 355 if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag)) 356 pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject(); 357 358 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html> 359 if (pluginScriptObject) 360 _NPN_RetainObject(pluginScriptObject); 361 362 void** v = (void**)value; 363 *v = pluginScriptObject; 364 365 return NPERR_NO_ERROR; 366 } 367 default: 368 return getValueStatic(variable, value); 369 } 324 return false; 325 } 326 } 327 328 bool PluginView::platformGetValue(NPNVariable, void*, NPError*) 329 { 330 return false; 370 331 } 371 332 -
trunk/WebCore/plugins/win/PluginViewWin.cpp
r54503 r55432 27 27 28 28 #include "config.h" 29 30 29 #include "PluginView.h" 31 30 32 31 #include "BitmapImage.h" 33 #if !PLATFORM(WX)34 #include "BitmapInfo.h"35 #endif36 32 #include "Bridge.h" 37 33 #include "Document.h" … … 39 35 #include "Element.h" 40 36 #include "EventNames.h" 37 #include "FocusController.h" 38 #include "Frame.h" 39 #include "FrameLoadRequest.h" 41 40 #include "FrameLoader.h" 42 #include "FrameLoadRequest.h"43 41 #include "FrameTree.h" 44 #include "Frame.h"45 42 #include "FrameView.h" 46 43 #include "GraphicsContext.h" 44 #include "HTMLNames.h" 45 #include "HTMLPlugInElement.h" 47 46 #include "HostWindow.h" 48 47 #include "Image.h" 49 #include "HTMLNames.h" 50 #include "HTMLPlugInElement.h" 48 #include "JSDOMBinding.h" 51 49 #include "JSDOMWindow.h" 52 50 #include "KeyboardEvent.h" … … 54 52 #include "MouseEvent.h" 55 53 #include "Page.h" 56 #include "FocusController.h"57 54 #include "PlatformMouseEvent.h" 55 #include "PluginDatabase.h" 56 #include "PluginDebug.h" 57 #include "PluginMainThreadScheduler.h" 58 58 #include "PluginMessageThrottlerWin.h" 59 59 #include "PluginPackage.h" 60 #include "PluginMainThreadScheduler.h"61 60 #include "RenderWidget.h" 62 #include "JSDOMBinding.h"63 61 #include "ScriptController.h" 64 #include "PluginDatabase.h"65 #include "PluginDebug.h"66 #include "PluginPackage.h"67 62 #include "Settings.h" 68 63 #include "c_instance.h" … … 72 67 #include <runtime/JSValue.h> 73 68 #include <wtf/ASCIICType.h> 69 70 #if !PLATFORM(WX) 71 #include "BitmapInfo.h" 72 #endif 74 73 75 74 #if OS(WINCE) … … 868 867 } 869 868 870 NPError PluginView::getValueStatic(NPNVariable variable, void* value) 871 { 872 LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data()); 873 874 return NPERR_GENERIC_ERROR; 875 } 876 877 NPError PluginView::getValue(NPNVariable variable, void* value) 878 { 879 LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data()); 880 869 bool PluginView::platformGetValueStatic(NPNVariable, void*, NPError*) 870 { 871 return false; 872 } 873 874 bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result) 875 { 881 876 switch (variable) { 882 #if ENABLE(NETSCAPE_PLUGIN_API)883 case NPNVWindowNPObject: {884 if (m_isJavaScriptPaused)885 return NPERR_GENERIC_ERROR;886 887 NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();888 889 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>890 if (windowScriptObject)891 _NPN_RetainObject(windowScriptObject);892 893 void** v = (void**)value;894 *v = windowScriptObject;895 896 return NPERR_NO_ERROR;897 }898 899 case NPNVPluginElementNPObject: {900 if (m_isJavaScriptPaused)901 return NPERR_GENERIC_ERROR;902 903 NPObject* pluginScriptObject = 0;904 905 if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))906 pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();907 908 // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>909 if (pluginScriptObject)910 _NPN_RetainObject(pluginScriptObject);911 912 void** v = (void**)value;913 *v = pluginScriptObject;914 915 return NPERR_NO_ERROR;916 }917 #endif918 919 877 case NPNVnetscapeWindow: { 920 878 HWND* w = reinterpret_cast<HWND*>(value); 921 922 879 *w = windowHandleForPageClient(parent() ? parent()->hostWindow()->platformPageClient() : 0); 923 924 return NPERR_NO_ERROR;880 *result = NPERR_NO_ERROR; 881 return true; 925 882 } 926 883 927 884 case NPNVSupportsWindowless: { 928 NPBool *result = reinterpret_cast<NPBool*>(value); 929 930 *result = TRUE; 931 932 return NPERR_NO_ERROR; 885 NPBool* flag = reinterpret_cast<NPBool*>(value); 886 *flag = TRUE; 887 *result = NPERR_NO_ERROR; 888 return true; 933 889 } 934 890 935 936 return NPERR_GENERIC_ERROR;891 default: 892 return false; 937 893 } 938 894 }
Note: See TracChangeset
for help on using the changeset viewer.