Changeset 55433 in webkit
- Timestamp:
- Mar 2, 2010 3:13:57 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55432 r55433 1 2010-03-02 Mark Rowe <mrowe@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Bug 35576: WebKit should tell plug-in instances when private browsing state changes 6 <http://webkit.org/b/35576> 7 8 * platform/win/Skipped: Remove plugins/private-browsing-mode.html now that it passes. 9 1 10 2010-03-02 Mark Rowe <mrowe@apple.com> 2 11 -
trunk/LayoutTests/platform/win/Skipped
r55432 r55433 672 672 fast/dom/Window/slow-unload-handler-only-frame-is-stopped.html 673 673 674 # <https://bugs.webkit.org/show_bug.cgi?id=30348>675 plugins/private-browsing-mode.html676 677 674 # Skip these two failures I introduced this morning while I explore them. 678 675 http/tests/globalhistory/history-delegate-basic-visited-links.html -
trunk/WebCore/ChangeLog
r55432 r55433 1 2010-03-02 Mark Rowe <mrowe@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Bug 35576: WebKit should tell plug-in instances when private browsing state changes 6 <http://webkit.org/b/35576> 7 8 Notify plug-in instances when the private browsing state changes to match the behavior of the 9 Mac plug-in code. 10 11 * page/Page.cpp: 12 (WebCore::Page::privateBrowsingStateChanged): Walk the frame tree and notify each PluginView that 13 the private browsing state has changed. 14 * page/Page.h: 15 * page/Settings.cpp: 16 (WebCore::Settings::setPrivateBrowsingEnabled): Notify the page that the private browsing state 17 has changed. 18 * plugins/PluginView.cpp: 19 (WebCore::PluginView::privateBrowsingStateChanged): Notify the plug-in instance of the new private 20 browsing state. 21 * plugins/PluginView.h: 22 1 23 2010-03-02 Mark Rowe <mrowe@apple.com> 2 24 -
trunk/WebCore/page/Page.cpp
r55375 r55433 53 53 #include "PluginData.h" 54 54 #include "PluginHalter.h" 55 #include "PluginView.h" 55 56 #include "ProgressTracker.h" 56 57 #include "RenderWidget.h" … … 776 777 #endif 777 778 779 void Page::privateBrowsingStateChanged() 780 { 781 bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled(); 782 783 // Collect the PluginViews in to a vector to ensure that action the plug-in takes 784 // from below privateBrowsingStateChanged does not affect their lifetime. 785 786 Vector<RefPtr<PluginView>, 32> pluginViews; 787 for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { 788 FrameView* view = frame->view(); 789 if (!view) 790 return; 791 792 const HashSet<RefPtr<Widget> >* children = view->children(); 793 ASSERT(children); 794 795 HashSet<RefPtr<Widget> >::const_iterator end = children->end(); 796 for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) { 797 Widget* widget = (*it).get(); 798 if (!widget->isPluginView()) 799 continue; 800 pluginViews.append(static_cast<PluginView*>(widget)); 801 } 802 } 803 804 for (size_t i = 0; i < pluginViews.size(); i++) 805 pluginViews[i]->privateBrowsingStateChanged(privateBrowsingEnabled); 806 } 807 778 808 void Page::pluginAllowedRunTimeChanged() 779 809 { -
trunk/WebCore/page/Page.h
r54849 r55433 198 198 const String& userStyleSheet() const; 199 199 200 void privateBrowsingStateChanged(); 201 200 202 void didStartPlugin(HaltablePlugin*); 201 203 void didStopPlugin(HaltablePlugin*); -
trunk/WebCore/page/Settings.cpp
r55387 r55433 278 278 void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) 279 279 { 280 if (m_privateBrowsingEnabled == privateBrowsingEnabled) 281 return; 282 280 283 m_privateBrowsingEnabled = privateBrowsingEnabled; 284 m_page->privateBrowsingStateChanged(); 281 285 } 282 286 -
trunk/WebCore/plugins/PluginView.cpp
r55432 r55433 1374 1374 } 1375 1375 1376 void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled) 1377 { 1378 NPP_SetValueProcPtr setValue = m_plugin->pluginFuncs()->setvalue; 1379 if (!setValue) 1380 return; 1381 1382 PluginView::setCurrentPluginView(this); 1383 JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); 1384 setCallingPlugin(true); 1385 NPBool value = privateBrowsingEnabled; 1386 setValue(m_instance, NPNVprivateModeBool, &value); 1387 setCallingPlugin(false); 1388 PluginView::setCurrentPluginView(0); 1389 } 1390 1376 1391 } // namespace WebCore -
trunk/WebCore/plugins/PluginView.h
r55432 r55433 157 157 void setJavaScriptPaused(bool); 158 158 159 void privateBrowsingStateChanged(bool); 160 159 161 void disconnectStream(PluginStream*); 160 162 void streamDidFinishLoading(PluginStream* stream) { disconnectStream(stream); } -
trunk/WebKitTools/ChangeLog
r55415 r55433 1 2010-03-02 Mark Rowe <mrowe@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Bug 35576: WebKit should tell plug-in instances when private browsing state changes 6 <http://webkit.org/b/35576> 7 8 TestNetscapePlugin is another bit of plug-in code where copy-paste was heavily used 9 when porting. Update the Windows and UNIX implementations of NPP_New and NPP_SetValue 10 to provide the expected behavior related to NPNVprivateModeBool. Hopefully this code 11 duplication can be cleaned up in the future. 12 13 * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp: 14 (webkit_test_plugin_new_instance): 15 (webkit_test_plugin_set_value): 16 * DumpRenderTree/win/TestNetscapePlugin/main.cpp: 17 (NPP_New): 18 (NPP_SetValue): 19 1 20 2010-03-02 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 21 -
trunk/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
r51044 r55433 59 59 if (browser->version >= 14) { 60 60 PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); 61 instance->pdata = obj; 61 62 62 63 for (int i = 0; i < argc; i++) { … … 87 88 obj->testWindowOpen = TRUE; 88 89 } 89 instance->pdata = obj; 90 91 browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode); 90 92 } 91 93 … … 283 285 284 286 static NPError 285 webkit_test_plugin_set_value(NPP /*instance*/, NPNVariable /*variable*/, void* /*value*/) 286 { 287 return NPERR_NO_ERROR; 287 webkit_test_plugin_set_value(NPP instance, NPNVariable variable, void* value) 288 { 289 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); 290 291 switch (variable) { 292 case NPNVprivateModeBool: 293 obj->cachedPrivateBrowsingMode = *(NPBool*)value; 294 return NPERR_NO_ERROR; 295 default: 296 return NPERR_GENERIC_ERROR; 297 } 288 298 } 289 299 -
trunk/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
r54614 r55433 90 90 if (browser->version >= 14) { 91 91 PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); 92 92 instance->pdata = obj; 93 93 94 for (int16 i = 0; i < argc; i++) { 94 95 if (_stricmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad) … … 109 110 obj->testWindowOpen = TRUE; 110 111 } 111 112 instance->pdata = obj;112 113 browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode); 113 114 } 114 115 … … 239 240 NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) 240 241 { 241 return NPERR_GENERIC_ERROR; 242 } 242 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); 243 244 switch (variable) { 245 case NPNVprivateModeBool: 246 obj->cachedPrivateBrowsingMode = *(NPBool*)value; 247 return NPERR_NO_ERROR; 248 default: 249 return NPERR_GENERIC_ERROR; 250 } 251 }
Note: See TracChangeset
for help on using the changeset viewer.