From 5431006e7c73098c5b612b7ebae508f373de2a5a Mon Sep 17 00:00:00 2001 From: Dorian Date: Mon, 9 Nov 2015 23:07:22 +0100 Subject: [PATCH] Update for Gecko 38 / MSVC 2013 --- k-meleon/KMeleon.sln | 462 +- k-meleon/KMeleon10.opensdf | Bin 16 -> 0 bytes k-meleon/app/BrowserFrm.cpp | 2 +- k-meleon/app/BrowserGlue.cpp | 73 +- k-meleon/app/BrowserImpl.cpp | 12 +- k-meleon/app/BrowserImplWebPrgrsLstnr.cpp | 1 + k-meleon/app/BrowserViewUtils.cpp | 2 +- k-meleon/app/BrowserWindow.cpp | 84 +- k-meleon/app/BrowserWindow.h | 25 +- k-meleon/app/Components.cpp | 1 + k-meleon/app/FavIconList.cpp | 10 +- k-meleon/app/HiddenWnd.cpp | 2 + k-meleon/app/IBrowserFrameGlue.h | 4 +- k-meleon/app/KMeleon.vcxproj | 6 +- k-meleon/app/KMeleonConst.h | 6 +- k-meleon/app/KmAbout.cpp | 8 +- k-meleon/app/KmAppInfo.cpp | 39 +- k-meleon/app/KmFileLocProvider.cpp | 2 +- k-meleon/app/KmImage.cpp | 24 +- k-meleon/app/KmImage.h | 4 +- k-meleon/app/KmInstaller.h | 2 +- k-meleon/app/KmMenu.cpp | 118 +- k-meleon/app/MfcEmbed.cpp | 16 +- k-meleon/app/MfcEmbed.rc | 10 +- k-meleon/app/MostRecentUrls.cpp | 4 +- k-meleon/app/MozUtils.cpp | 42 +- k-meleon/app/MozUtils.h | 10 +- k-meleon/app/NSSDialogs.cpp | 8 +- k-meleon/app/Plugins.cpp | 2 +- k-meleon/app/PrintProgressDialog.h | 1 + k-meleon/app/ProfileMgr.cpp | 1 + k-meleon/app/PromptService.cpp | 73 +- k-meleon/app/PromptService.h | 4 +- k-meleon/app/SaveAsHandler.cpp | 6 +- k-meleon/app/StdAfx.h | 102 +- k-meleon/app/TooltipsProvider.h | 1 - k-meleon/app/UnknownContentTypeHandler.cpp | 9 +- k-meleon/app/UnknownContentTypeHandler.h | 1 + k-meleon/app/VisualStylesXP.h | 734 +-- k-meleon/kplugins/bmpmenu/bmpmenu.vcxproj | 4 +- k-meleon/kplugins/bookmarks/bookmarks.vcxproj | 4 +- k-meleon/kplugins/favorites/favorites.vcxproj | 4 +- .../kplugins/fullscreen/fullscreen.vcxproj | 8 +- k-meleon/kplugins/gestures/gestures.vcxproj | 4 +- k-meleon/kplugins/hotlist/hotlist.vcxproj | 4 +- k-meleon/kplugins/jsbridge/JSBridge.vcxproj | 4 +- k-meleon/kplugins/jsbridge/jscomp.cpp | 9 + k-meleon/kplugins/jsbridge/jscomp.h | 8 +- k-meleon/kplugins/jsbridge/jsplugin.cpp | 2 +- .../kplugins/jsbridge/nsGenericFactory.cpp | 2 +- k-meleon/kplugins/login/login.vcxproj | 4 +- k-meleon/kplugins/login/mozilla.cpp | 10 +- k-meleon/kplugins/login/mozilla.h | 10 +- k-meleon/kplugins/macros2/macros.vcxproj | 4 +- k-meleon/kplugins/privacy/privacy.vcxproj | 200 +- .../kplugins/rebar_menu/rebarmenu.vcxproj | 4 +- k-meleon/kplugins/sessions/sessions.vcxproj | 4 +- k-meleon/kplugins/spellcheck/spellcheck.cpp | 13 +- .../kplugins/spellcheck/spellcheck.vcxproj | 8 +- k-meleon/kplugins/toolbars/toolbars.vcxproj | 4 +- k-meleon/mozilla.patch | 4426 ++++------------- 61 files changed, 2117 insertions(+), 4534 deletions(-) delete mode 100644 k-meleon/KMeleon10.opensdf diff --git a/k-meleon/KMeleon.sln b/k-meleon/KMeleon.sln index bbdeec2a..209db75e 100644 --- a/k-meleon/KMeleon.sln +++ b/k-meleon/KMeleon.sln @@ -1,293 +1,169 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "k-meleon", "KMeleon.vcproj", "{A1E2BBD2-452C-41F6-A64A-9476398A17DA}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Layers", "layers\Layers.vcproj", "{A893706A-93AF-4905-B9B9-125F9F961CF2}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bmpmenu", "bmp_menu\bmp_menu.vcproj", "{F2E464B0-F87F-4482-B32D-031B63E681E2}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "external", "External\external.vcproj", "{802755E1-6059-4C25-BB24-48CC17D12254}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fullscreen", "fullscreen\fullscreen.vcproj", "{014A6ED5-5295-44BF-97B1-5569A8C2A7F3}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "history", "history\history.vcproj", "{9C40A520-37BA-4997-BC72-4EE98E32513A}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loader", "loader\loader.vcproj", "{DF7D017C-AE43-428E-A575-A329D951529F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "macros", "macros\macros.vcproj", "{8E2AA109-176D-4DCC-81B3-078AFD3A5138}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bookmarks", "ns_bookmarks\ns_bookmarks.vcproj", "{E32EA49A-59D4-4898-805F-1732B2F4D302}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hotlist", "op_hotlist\op_hotlist.vcproj", "{553F5B8A-CB70-4766-9EFC-222748AAA006}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rebarmenu", "rebar_menu\rebar_menu.vcproj", "{839F0F46-8C0A-425D-B70A-40A1D8ACBE90}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toolbars", "toolbars\toolbars.vcproj", "{97C153A5-A4F6-4AD7-971B-F6C747558AC4}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "privacy", "privacy\privacy.vcproj", "{F80DCDF9-D001-47F7-97D5-26EF62BF91AF}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gestures", "gestures\gestures.vcproj", "{2E6C70BF-E9CA-416A-B341-2B8550919D9E}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "favorites", "ie_favorites\favorites2.vcproj", "{3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sessions", "sessions\sessions.vcproj", "{43FF5741-2BA4-4191-A0E3-DB8BC27685CB}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "macros2", "macros2\macros2.vcproj", "{CE210F14-2644-487C-86CA-1E2CB2E04490}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSBridge", "JSBridge\JSBridge.vcproj", "{5F7A1684-E791-4F70-A24F-FC6726273512}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug Unicode = Debug Unicode - Release = Release - Release MFC Static = Release MFC Static - Release MFC Static Unicode = Release MFC Static Unicode - Release Unicode = Release Unicode - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Debug.ActiveCfg = Debug|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Debug.Build.0 = Debug|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release.ActiveCfg = Release|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release.Build.0 = Release|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release MFC Static.ActiveCfg = Release MFC Static|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release MFC Static.Build.0 = Release MFC Static|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release MFC Static Unicode.ActiveCfg = Release MFC Static Unicode|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release MFC Static Unicode.Build.0 = Release MFC Static Unicode|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release Unicode.ActiveCfg = Release Unicode|Win32 - {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release Unicode.Build.0 = Release Unicode|Win32 - {A893706A-93AF-4905-B9B9-125F9F961CF2}.Debug.ActiveCfg = Debug|Win32 - {A893706A-93AF-4905-B9B9-125F9F961CF2}.Debug Unicode.ActiveCfg = Debug|Win32 - {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release.ActiveCfg = Release|Win32 - {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release MFC Static.ActiveCfg = Release|Win32 - {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release Unicode.ActiveCfg = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Debug.ActiveCfg = Debug|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Debug.Build.0 = Debug|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Debug Unicode.ActiveCfg = Debug|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Debug Unicode.Build.0 = Debug|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release.ActiveCfg = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release.Build.0 = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release MFC Static.ActiveCfg = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release MFC Static.Build.0 = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release MFC Static Unicode.Build.0 = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release Unicode.ActiveCfg = Release|Win32 - {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release Unicode.Build.0 = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Debug.ActiveCfg = Debug|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Debug.Build.0 = Debug|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Debug Unicode.ActiveCfg = Debug|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Debug Unicode.Build.0 = Debug|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release.ActiveCfg = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release.Build.0 = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release MFC Static.ActiveCfg = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release MFC Static.Build.0 = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release MFC Static Unicode.Build.0 = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release Unicode.ActiveCfg = Release|Win32 - {802755E1-6059-4C25-BB24-48CC17D12254}.Release Unicode.Build.0 = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Debug.ActiveCfg = Debug|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Debug.Build.0 = Debug|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Debug Unicode.ActiveCfg = Debug|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Debug Unicode.Build.0 = Debug|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release.ActiveCfg = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release.Build.0 = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release MFC Static.ActiveCfg = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release MFC Static.Build.0 = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release MFC Static Unicode.Build.0 = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release Unicode.ActiveCfg = Release|Win32 - {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release Unicode.Build.0 = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Debug.ActiveCfg = Debug|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Debug.Build.0 = Debug|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Debug Unicode.ActiveCfg = Debug|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Debug Unicode.Build.0 = Debug|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release.ActiveCfg = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release.Build.0 = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release MFC Static.ActiveCfg = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release MFC Static.Build.0 = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release MFC Static Unicode.Build.0 = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release Unicode.ActiveCfg = Release|Win32 - {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release Unicode.Build.0 = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Debug.ActiveCfg = Debug|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Debug.Build.0 = Debug|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Debug Unicode.ActiveCfg = Debug|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Debug Unicode.Build.0 = Debug|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release.ActiveCfg = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release.Build.0 = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static.ActiveCfg = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static.Build.0 = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static Unicode.Build.0 = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release Unicode.ActiveCfg = Release|Win32 - {DF7D017C-AE43-428E-A575-A329D951529F}.Release Unicode.Build.0 = Release|Win32 - {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Debug.ActiveCfg = Debug|Win32 - {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Debug Unicode.ActiveCfg = Debug|Win32 - {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release.ActiveCfg = Release|Win32 - {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release MFC Static.ActiveCfg = Release|Win32 - {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release Unicode.ActiveCfg = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Debug.ActiveCfg = Debug|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Debug.Build.0 = Debug|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Debug Unicode.ActiveCfg = Debug|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Debug Unicode.Build.0 = Debug|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release.ActiveCfg = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release.Build.0 = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release MFC Static.ActiveCfg = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release MFC Static.Build.0 = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release MFC Static Unicode.Build.0 = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release Unicode.ActiveCfg = Release|Win32 - {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release Unicode.Build.0 = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Debug.ActiveCfg = Debug|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Debug.Build.0 = Debug|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Debug Unicode.ActiveCfg = Debug|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Debug Unicode.Build.0 = Debug|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release.ActiveCfg = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release.Build.0 = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release MFC Static.ActiveCfg = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release MFC Static.Build.0 = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release MFC Static Unicode.Build.0 = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release Unicode.ActiveCfg = Release|Win32 - {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release Unicode.Build.0 = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Debug.ActiveCfg = Debug|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Debug.Build.0 = Debug|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Debug Unicode.ActiveCfg = Debug|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Debug Unicode.Build.0 = Debug|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release.ActiveCfg = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release.Build.0 = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release MFC Static.ActiveCfg = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release MFC Static.Build.0 = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release MFC Static Unicode.Build.0 = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release Unicode.ActiveCfg = Release|Win32 - {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release Unicode.Build.0 = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Debug.ActiveCfg = Debug|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Debug.Build.0 = Debug|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Debug Unicode.ActiveCfg = Debug|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Debug Unicode.Build.0 = Debug|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release.ActiveCfg = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release.Build.0 = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release MFC Static.ActiveCfg = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release MFC Static.Build.0 = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release MFC Static Unicode.Build.0 = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release Unicode.ActiveCfg = Release|Win32 - {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release Unicode.Build.0 = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Debug.ActiveCfg = Debug|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Debug.Build.0 = Debug|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Debug Unicode.ActiveCfg = Debug|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Debug Unicode.Build.0 = Debug|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release.ActiveCfg = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release.Build.0 = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release MFC Static.ActiveCfg = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release MFC Static.Build.0 = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release MFC Static Unicode.Build.0 = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release Unicode.ActiveCfg = Release|Win32 - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release Unicode.Build.0 = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Debug.ActiveCfg = Debug|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Debug.Build.0 = Debug|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Debug Unicode.ActiveCfg = Debug|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Debug Unicode.Build.0 = Debug|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release.ActiveCfg = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release.Build.0 = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release MFC Static.ActiveCfg = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release MFC Static.Build.0 = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release MFC Static Unicode.Build.0 = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release Unicode.ActiveCfg = Release|Win32 - {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release Unicode.Build.0 = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Debug.ActiveCfg = Debug|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Debug.Build.0 = Debug|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Debug Unicode.ActiveCfg = Debug|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Debug Unicode.Build.0 = Debug|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release.ActiveCfg = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release.Build.0 = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release MFC Static.ActiveCfg = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release MFC Static.Build.0 = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release MFC Static Unicode.Build.0 = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release Unicode.ActiveCfg = Release|Win32 - {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release Unicode.Build.0 = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Debug.ActiveCfg = Debug|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Debug.Build.0 = Debug|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Debug Unicode.ActiveCfg = Debug Unicode|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Debug Unicode.Build.0 = Debug Unicode|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release.ActiveCfg = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release.Build.0 = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release MFC Static.ActiveCfg = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release MFC Static.Build.0 = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release MFC Static Unicode.Build.0 = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release Unicode.ActiveCfg = Release|Win32 - {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release Unicode.Build.0 = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Debug.ActiveCfg = Debug|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Debug.Build.0 = Debug|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Debug Unicode.ActiveCfg = Debug|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Debug Unicode.Build.0 = Debug|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release.ActiveCfg = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release.Build.0 = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release MFC Static.ActiveCfg = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release MFC Static.Build.0 = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release MFC Static Unicode.Build.0 = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release Unicode.ActiveCfg = Release|Win32 - {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release Unicode.Build.0 = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Debug.ActiveCfg = Debug|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Debug.Build.0 = Debug|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Debug Unicode.ActiveCfg = Debug|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Debug Unicode.Build.0 = Debug|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release.ActiveCfg = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release.Build.0 = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release MFC Static.ActiveCfg = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release MFC Static.Build.0 = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release MFC Static Unicode.ActiveCfg = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release MFC Static Unicode.Build.0 = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release Unicode.ActiveCfg = Release|Win32 - {5F7A1684-E791-4F70-A24F-FC6726273512}.Release Unicode.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "k-meleon", "KMeleon.vcproj", "{A1E2BBD2-452C-41F6-A64A-9476398A17DA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Layers", "layers\Layers.vcproj", "{A893706A-93AF-4905-B9B9-125F9F961CF2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bmpmenu", "bmp_menu\bmp_menu.vcproj", "{F2E464B0-F87F-4482-B32D-031B63E681E2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "external", "External\external.vcproj", "{802755E1-6059-4C25-BB24-48CC17D12254}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fullscreen", "fullscreen\fullscreen.vcproj", "{014A6ED5-5295-44BF-97B1-5569A8C2A7F3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "history", "history\history.vcproj", "{9C40A520-37BA-4997-BC72-4EE98E32513A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loader", "loader\loader.vcxproj", "{DF7D017C-AE43-428E-A575-A329D951529F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "macros", "macros\macros.vcproj", "{8E2AA109-176D-4DCC-81B3-078AFD3A5138}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bookmarks", "ns_bookmarks\ns_bookmarks.vcproj", "{E32EA49A-59D4-4898-805F-1732B2F4D302}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hotlist", "op_hotlist\op_hotlist.vcproj", "{553F5B8A-CB70-4766-9EFC-222748AAA006}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rebarmenu", "rebar_menu\rebar_menu.vcproj", "{839F0F46-8C0A-425D-B70A-40A1D8ACBE90}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toolbars", "toolbars\toolbars.vcproj", "{97C153A5-A4F6-4AD7-971B-F6C747558AC4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "privacy", "privacy\privacy.vcproj", "{F80DCDF9-D001-47F7-97D5-26EF62BF91AF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gestures", "gestures\gestures.vcproj", "{2E6C70BF-E9CA-416A-B341-2B8550919D9E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "favorites", "ie_favorites\favorites2.vcproj", "{3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sessions", "sessions\sessions.vcproj", "{43FF5741-2BA4-4191-A0E3-DB8BC27685CB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "macros2", "macros2\macros2.vcproj", "{CE210F14-2644-487C-86CA-1E2CB2E04490}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSBridge", "JSBridge\JSBridge.vcproj", "{5F7A1684-E791-4F70-A24F-FC6726273512}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Unicode|Win32 = Debug Unicode|Win32 + Debug|Win32 = Debug|Win32 + Release MFC Static Unicode|Win32 = Release MFC Static Unicode|Win32 + Release MFC Static|Win32 = Release MFC Static|Win32 + Release Unicode|Win32 = Release Unicode|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 + {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Debug|Win32.ActiveCfg = Debug|Win32 + {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release MFC Static Unicode|Win32.ActiveCfg = Release MFC Static Unicode|Win32 + {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release MFC Static|Win32.ActiveCfg = Release MFC Static|Win32 + {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 + {A1E2BBD2-452C-41F6-A64A-9476398A17DA}.Release|Win32.ActiveCfg = Release|Win32 + {A893706A-93AF-4905-B9B9-125F9F961CF2}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {A893706A-93AF-4905-B9B9-125F9F961CF2}.Debug|Win32.ActiveCfg = Debug|Win32 + {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {A893706A-93AF-4905-B9B9-125F9F961CF2}.Release|Win32.ActiveCfg = Release|Win32 + {F2E464B0-F87F-4482-B32D-031B63E681E2}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {F2E464B0-F87F-4482-B32D-031B63E681E2}.Debug|Win32.ActiveCfg = Debug|Win32 + {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {F2E464B0-F87F-4482-B32D-031B63E681E2}.Release|Win32.ActiveCfg = Release|Win32 + {802755E1-6059-4C25-BB24-48CC17D12254}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {802755E1-6059-4C25-BB24-48CC17D12254}.Debug|Win32.ActiveCfg = Debug|Win32 + {802755E1-6059-4C25-BB24-48CC17D12254}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {802755E1-6059-4C25-BB24-48CC17D12254}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {802755E1-6059-4C25-BB24-48CC17D12254}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {802755E1-6059-4C25-BB24-48CC17D12254}.Release|Win32.ActiveCfg = Release|Win32 + {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Debug|Win32.ActiveCfg = Debug|Win32 + {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {014A6ED5-5295-44BF-97B1-5569A8C2A7F3}.Release|Win32.ActiveCfg = Release|Win32 + {9C40A520-37BA-4997-BC72-4EE98E32513A}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {9C40A520-37BA-4997-BC72-4EE98E32513A}.Debug|Win32.ActiveCfg = Debug|Win32 + {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {9C40A520-37BA-4997-BC72-4EE98E32513A}.Release|Win32.ActiveCfg = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Debug Unicode|Win32.Build.0 = Debug|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Debug|Win32.ActiveCfg = Debug|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Debug|Win32.Build.0 = Debug|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static Unicode|Win32.Build.0 = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release MFC Static|Win32.Build.0 = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release Unicode|Win32.Build.0 = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release|Win32.ActiveCfg = Release|Win32 + {DF7D017C-AE43-428E-A575-A329D951529F}.Release|Win32.Build.0 = Release|Win32 + {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Debug|Win32.ActiveCfg = Debug|Win32 + {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {8E2AA109-176D-4DCC-81B3-078AFD3A5138}.Release|Win32.ActiveCfg = Release|Win32 + {E32EA49A-59D4-4898-805F-1732B2F4D302}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {E32EA49A-59D4-4898-805F-1732B2F4D302}.Debug|Win32.ActiveCfg = Debug|Win32 + {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {E32EA49A-59D4-4898-805F-1732B2F4D302}.Release|Win32.ActiveCfg = Release|Win32 + {553F5B8A-CB70-4766-9EFC-222748AAA006}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {553F5B8A-CB70-4766-9EFC-222748AAA006}.Debug|Win32.ActiveCfg = Debug|Win32 + {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {553F5B8A-CB70-4766-9EFC-222748AAA006}.Release|Win32.ActiveCfg = Release|Win32 + {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Debug|Win32.ActiveCfg = Debug|Win32 + {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {839F0F46-8C0A-425D-B70A-40A1D8ACBE90}.Release|Win32.ActiveCfg = Release|Win32 + {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Debug|Win32.ActiveCfg = Debug|Win32 + {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {97C153A5-A4F6-4AD7-971B-F6C747558AC4}.Release|Win32.ActiveCfg = Release|Win32 + {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Debug|Win32.ActiveCfg = Debug|Win32 + {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {F80DCDF9-D001-47F7-97D5-26EF62BF91AF}.Release|Win32.ActiveCfg = Release|Win32 + {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Debug|Win32.ActiveCfg = Debug|Win32 + {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {2E6C70BF-E9CA-416A-B341-2B8550919D9E}.Release|Win32.ActiveCfg = Release|Win32 + {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Debug|Win32.ActiveCfg = Debug|Win32 + {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {3632B1A3-8D3C-468B-8AA7-1BAC8A367ED5}.Release|Win32.ActiveCfg = Release|Win32 + {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 + {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Debug|Win32.ActiveCfg = Debug|Win32 + {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {43FF5741-2BA4-4191-A0E3-DB8BC27685CB}.Release|Win32.ActiveCfg = Release|Win32 + {CE210F14-2644-487C-86CA-1E2CB2E04490}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {CE210F14-2644-487C-86CA-1E2CB2E04490}.Debug|Win32.ActiveCfg = Debug|Win32 + {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {CE210F14-2644-487C-86CA-1E2CB2E04490}.Release|Win32.ActiveCfg = Release|Win32 + {5F7A1684-E791-4F70-A24F-FC6726273512}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {5F7A1684-E791-4F70-A24F-FC6726273512}.Debug|Win32.ActiveCfg = Debug|Win32 + {5F7A1684-E791-4F70-A24F-FC6726273512}.Release MFC Static Unicode|Win32.ActiveCfg = Release|Win32 + {5F7A1684-E791-4F70-A24F-FC6726273512}.Release MFC Static|Win32.ActiveCfg = Release|Win32 + {5F7A1684-E791-4F70-A24F-FC6726273512}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {5F7A1684-E791-4F70-A24F-FC6726273512}.Release|Win32.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/k-meleon/KMeleon10.opensdf b/k-meleon/KMeleon10.opensdf deleted file mode 100644 index c801343bc44307d9641de1cf8e5f8d1506d23c56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16 XcmZ=^$Y&^G$Ye-l$YWq&aAW`g8S(<3 diff --git a/k-meleon/app/BrowserFrm.cpp b/k-meleon/app/BrowserFrm.cpp index bd2e13cd..15ab61c9 100644 --- a/k-meleon/app/BrowserFrm.cpp +++ b/k-meleon/app/BrowserFrm.cpp @@ -1269,7 +1269,7 @@ void CBrowserFrame::OnUpdateToggleToolbarLock(CCmdUI* pCmdUI) BOOL CALLBACK EnumToolbar(HWND hwnd, LPARAM lParam) { TCHAR pszName[20]; - GetClassName(hwnd, pszName, 20); + GetClassNameW(hwnd, pszName, 20); if ( GetParent(hwnd) == GetParent((HWND)lParam) && _tcscmp(TOOLBARCLASSNAME, pszName) == 0 && ( (GetWindowLong(hwnd, GWL_STYLE) & CCS_BOTTOM) == CCS_BOTTOM)) { diff --git a/k-meleon/app/BrowserGlue.cpp b/k-meleon/app/BrowserGlue.cpp index 965dc005..d91b5001 100644 --- a/k-meleon/app/BrowserGlue.cpp +++ b/k-meleon/app/BrowserGlue.cpp @@ -35,7 +35,6 @@ #include "nsIMutableArray.h" #include "nsISSLStatus.h" #include "nsIDialogParamBlock.h" -#include "nsICertOverrideService.h" #include "nsIX509CertDB.h" #include "nsIDOMEventTarget.h" @@ -239,7 +238,7 @@ void CBrowserGlue::SetVisibility(bool aVisibility) mpBrowserFrame->ShowWindow(SW_SHOW); // pThis->SetActiveWindow(); - mpBrowserFrame->UpdateWindow(); + //mpBrowserFrame->UpdateWindow(); } else { @@ -324,9 +323,19 @@ void CBrowserGlue::PopupBlocked(const char* uri) if (!theApp.preferences.GetBool("browser.popups.showPopupBlocker", PR_TRUE) || !mPopupBlockedHost.IsEmpty()) return; - - USES_CONVERSION; - mPopupBlockedHost = A2CT(uri); + + if (!*uri) { + // XXX Which is obviously not always true + nsCOMPtr uri; + mpBrowserView->GetBrowserWrapper()->GetCurrentURI(getter_AddRefs(uri)); + nsCString host; + uri->GetHost(host); + mPopupBlockedHost = NSCStringToCString(host); + } + else { + USES_CONVERSION; + mPopupBlockedHost = A2CT(uri); + } if (mpBrowserFrame->GetActiveView() == mpBrowserView) mpBrowserFrame->UpdatePopupNotification(mPopupBlockedHost); } @@ -483,18 +492,32 @@ CBrowserWrapper* CBrowserGlue::ReuseWindow(BOOL useCurrent) #include "nsISSLStatus.h" #include "nsIDialogParamBlock.h" #include "nsICertOverrideService.h" -#include "nsIRecentBadCertsService.h" +#include "nsISSLStatusProvider.h" +#include "nsISecureBrowserUI.h" +#include "nsIChannel.h" bool CBrowserGlue::performXULCommand(LPCWSTR id, LPCTSTR siteUri) { if (wcscmp(id, L"addCertificateExceptionButton") == 0) { - nsCOMPtr certDB = do_GetService("@mozilla.org/security/x509certdb;1"); - if (!certDB) return false; - nsCOMPtr uri; - //::NewURI(getter_AddRefs(uri), CStringToNSString(siteUri)); mpBrowserView->GetBrowserWrapper()->GetCurrentURI(getter_AddRefs(uri)); + + nsCOMPtr docShell = mpBrowserView->GetBrowserWrapper()->GetDocShell(); + NS_ENSURE_TRUE(docShell, FALSE); + + nsCOMPtr channel; + docShell->GetFailedChannel(getter_AddRefs(channel)); + NS_ENSURE_TRUE(channel, FALSE); + + nsCOMPtr secinfo; + channel->GetSecurityInfo(getter_AddRefs(secinfo)); + nsCOMPtr SSLProvider = do_QueryInterface(secinfo); + NS_ENSURE_TRUE(SSLProvider, FALSE); + + nsCOMPtr certStatus; + SSLProvider->GetSSLStatus(getter_AddRefs(certStatus)); + if (!certStatus) return FALSE; PRInt32 port; nsCString host; @@ -505,14 +528,6 @@ bool CBrowserGlue::performXULCommand(LPCWSTR id, LPCTSTR siteUri) CString hostAndPort; hostAndPort.Format(_T("%s:%d"), NSCStringToCString(host), port); - nsCOMPtr recentCertsSvc; - certDB->GetRecentBadCerts(false, getter_AddRefs(recentCertsSvc)); - if (!recentCertsSvc) return false; - - nsCOMPtr certStatus; - recentCertsSvc->GetRecentBadCert(CStringToNSString(hostAndPort), getter_AddRefs(certStatus)); - if (!certStatus) return false; - int32_t certFailureFlags = 0; bool isDomainMismatch, isInvalidTime, isUntrusted; certStatus->GetIsDomainMismatch(&isDomainMismatch); @@ -548,9 +563,6 @@ bool CBrowserGlue::performXULCommand(LPCWSTR id, LPCTSTR siteUri) if (wcscmp(id, L"vieshit") == 0) { - nsCOMPtr certDB = do_GetService("@mozilla.org/security/x509certdb;1"); - if (!certDB) return false; - nsCOMPtr uri; mpBrowserView->GetBrowserWrapper()->GetCurrentURI(getter_AddRefs(uri)); @@ -564,13 +576,22 @@ bool CBrowserGlue::performXULCommand(LPCWSTR id, LPCTSTR siteUri) CString hostAndPort; hostAndPort.Format(_T("%s:%d"), NSCStringToCString(host), port); - nsCOMPtr recentCertsSvc; - certDB->GetRecentBadCerts(false, getter_AddRefs(recentCertsSvc)); - if (!recentCertsSvc) return false; + + nsCOMPtr docShell = mpBrowserView->GetBrowserWrapper()->GetDocShell(); + NS_ENSURE_TRUE(docShell, FALSE); + + nsCOMPtr channel; + docShell->GetFailedChannel(getter_AddRefs(channel)); + NS_ENSURE_TRUE(channel, FALSE); + + nsCOMPtr secinfo; + channel->GetSecurityInfo(getter_AddRefs(secinfo)); + nsCOMPtr SSLProvider = do_QueryInterface(secinfo); + NS_ENSURE_TRUE(SSLProvider, FALSE); nsCOMPtr certStatus; - recentCertsSvc->GetRecentBadCert(CStringToNSString(hostAndPort), getter_AddRefs(certStatus)); - if (!certStatus) return false; + SSLProvider->GetSSLStatus(getter_AddRefs(certStatus)); + if (!certStatus) return FALSE; nsCOMPtr cert; certStatus->GetServerCert(getter_AddRefs(cert)); diff --git a/k-meleon/app/BrowserImpl.cpp b/k-meleon/app/BrowserImpl.cpp index 89957fdc..0807cca5 100644 --- a/k-meleon/app/BrowserImpl.cpp +++ b/k-meleon/app/BrowserImpl.cpp @@ -74,7 +74,6 @@ #include "MozUtils.h" #include "nsIDOMEvent.h" -#include "nsIDOMPopupBlockedEvent.h" #include "nsIDOMMouseEvent.h" #include "nsIDOMKeyEvent.h" #include "nsIDOMEventTarget.h" @@ -82,14 +81,12 @@ #include "nsIDOMEventTarget.h" #include "nsIDOMLocation.h" #include "nsPIDOMWindow.h" - #include "nsIScriptSecurityManager.h" - +#include "nsIDOMHTMLDocument.h" #ifdef USE_WINDOW_PROVIDER #include "nsIBrowserDOMWindow.h" #endif -#include "jsapi.h" #include "BrowserFrm.h" // XXXXX #include "BrowserView.h" @@ -911,7 +908,8 @@ NS_IMETHODIMP CBrowserImpl::HandleEvent(nsIDOMEvent *aEvent) if (type.Equals(NS_LITERAL_STRING("DOMPopupBlocked"))) { - nsCOMPtr popupEvent = do_QueryInterface(aEvent); + // Can't include the popup event class anymore + /* nsCOMPtr popupEvent = do_QueryInterface(aEvent); NS_ENSURE_TRUE (popupEvent, NS_ERROR_FAILURE); nsCOMPtr uri; @@ -934,9 +932,9 @@ NS_IMETHODIMP CBrowserImpl::HandleEvent(nsIDOMEvent *aEvent) nsCString host; rv = uri->GetHost(host); NS_ENSURE_SUCCESS (rv, rv); - NS_ENSURE_TRUE (host.Length(), NS_OK); + NS_ENSURE_TRUE (host.Length(), NS_OK);*/ - m_pBrowserFrameGlue->PopupBlocked(host.get()); + m_pBrowserFrameGlue->PopupBlocked(""); return NS_OK; } diff --git a/k-meleon/app/BrowserImplWebPrgrsLstnr.cpp b/k-meleon/app/BrowserImplWebPrgrsLstnr.cpp index 05de41f0..2ea2484e 100644 --- a/k-meleon/app/BrowserImplWebPrgrsLstnr.cpp +++ b/k-meleon/app/BrowserImplWebPrgrsLstnr.cpp @@ -36,6 +36,7 @@ #include "IBrowserFrameGlue.h" #include "nsIRequest.h" #include "nsIChannel.h" +#include "nsIWebProgress.h" //***************************************************************************** // CBrowserImpl::nsIWebProgressListener Implementation diff --git a/k-meleon/app/BrowserViewUtils.cpp b/k-meleon/app/BrowserViewUtils.cpp index d3ad252d..1e53840f 100644 --- a/k-meleon/app/BrowserViewUtils.cpp +++ b/k-meleon/app/BrowserViewUtils.cpp @@ -135,7 +135,7 @@ BOOL CBrowserView::OpenViewSourceWindow(BOOL frame) persist->SetPersistFlags( nsIWebBrowserPersist::PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION| nsIWebBrowserPersist::PERSIST_FLAGS_REPLACE_EXISTING_FILES); - rv = persist->SaveURI(srcURI, cacheDescriptor, referrer, nullptr, nullptr, nfile, nullptr); + rv = persist->SaveURI(srcURI, cacheDescriptor, referrer, 0, nullptr, nullptr, nfile, nullptr); if (NS_FAILED(rv)) { persist->SetProgressListener(nullptr); return FALSE; diff --git a/k-meleon/app/BrowserWindow.cpp b/k-meleon/app/BrowserWindow.cpp index 337c4055..a804c27e 100644 --- a/k-meleon/app/BrowserWindow.cpp +++ b/k-meleon/app/BrowserWindow.cpp @@ -27,20 +27,20 @@ #include "mfcembed.h" #include "Utils.h" +#include "nsIBaseWindow.h" #include "nsIWidget.h" #include "nsISHistory.h" #include "nsISHEntry.h" #include "nsIDOMHTMLFrameSetElement.h" #include "nsIDocShellTreeItem.h" +#include "nsIWebBrowserFocus.h" #include "nsIContentViewer.h" -#include "nsIMarkupDocumentViewer.h" #include "nsIDocCharset.h" #include "nsISelection.h" #include "nsISHistoryInternal.h" #include "nsIDOMText.h" #include "nsIDOMNodeList.h" -#include "nsIDOMHTMLScriptElement.h" #include "nsIDOMWindowCollection.h" #include "nsIWebPageDescriptor.h" #include "nsIDocShell.h" @@ -54,14 +54,17 @@ #include "nsICertificateDialogs.h" #include "nsIScriptSecurityManager.h" +#include "nsIDOMHTMLDocument.h" #include "nsIDOMHTMLTextAreaElement.h" - +#include "nsIDOMHTMLScriptElement.h" #include "nsIDOMHTMLInputElement.h" #include "nsIDOMHTMLEmbedElement.h" #include "nsIDOMHTMLObjectElement.h" #include "nsIDOMHTMLButtonElement.h" #include "nsIDOMHTMLSelectElement.h" #include "nsITypeAheadFind.h" +#include "nsIWebBrowserFind.h" + //#include "nsIFocusController.h" //#include "nsIDOMNSHTMLDocument.h" @@ -82,7 +85,9 @@ #include "nsIDOMWindowCollection.h" #include "nsPIDOMWindow.h" #include "nsIFocusManager.h" -#include "nsIScriptContext.h" +#include "nsIDocument.h" +#include "nsIPrintSettings.h" +#include "nsIScrollable.h" static const PRUnichar kSpan[] = L"span"; static const PRUnichar kStyle[] = L"style"; @@ -124,6 +129,9 @@ void CBrowserWrapper::SetBrowserFrameGlue(PBROWSERFRAMEGLUE pBrowserFrameGlue) // mpBrowserImpl->Init(pBrowserFrameGlue, mWebBrowser); } +#include "nsIXPConnect.h" +#include "jsfriendapi.h" +#include "nsJSPrincipals.h" BOOL CBrowserWrapper::CreateBrowser(CWnd* parent, uint32_t chromeFlags) { mChromeContent = chromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME; @@ -208,15 +216,23 @@ BOOL CBrowserWrapper::CreateBrowser(CWnd* parent, uint32_t chromeFlags) do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); if (ssm) { // Sometimes this happens really early See bug 793370. nsCOMPtr principal; - ssm->GetSubjectPrincipal(getter_AddRefs(principal)); - if (!principal) { + nsCOMPtr xpconnect = do_GetService("@mozilla.org/js/xpc/XPConnect;1"); + JSContext* cx = xpconnect->GetCurrentJSContext(); + if (cx) { + JSCompartment *compartment = js::GetContextCompartment(cx); + if (compartment) { + JSPrincipals *principals = JS_GetCompartmentPrincipals(compartment); + principal = static_cast(principals); + } + } + if (!principal && chromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME) { ssm->GetSystemPrincipal(getter_AddRefs(principal)); } rv = GetDocShell()->CreateAboutBlankContentViewer(principal); NS_ENSURE_SUCCESS(rv, FALSE); - //nsCOMPtr doc = do_GetInterface(GetDocShell()); - //NS_ENSURE_TRUE(!!doc, NS_ERROR_FAILURE); - //doc->SetIsInitialDocument(true); + nsCOMPtr doc = do_GetInterface(GetDocShell()); + NS_ENSURE_TRUE(!!doc, FALSE); + doc->SetIsInitialDocument(true); } } @@ -506,23 +522,19 @@ BOOL CBrowserWrapper::GetCharset(char* aCharset) if (NS_FAILED(result) || !contentViewer) return FALSE; - nsCOMPtr mdv = do_QueryInterface(contentViewer,&result); - if (NS_FAILED(result) || !mdv) - return FALSE; - nsCString mCharset; - result = mdv->GetForceCharacterSet(mCharset); - + result = contentViewer->GetForceCharacterSet(mCharset); + if (NS_FAILED(result) || mCharset.IsEmpty() ) { - + // If no forced charset look for the document charset nsCString charset; DocShell->GetCharset(charset); if (charset.IsEmpty()) { // If no document charset use default - result = mdv->GetHintCharacterSet(mCharset); + result = contentViewer->GetHintCharacterSet(mCharset); } else { @@ -546,13 +558,9 @@ BOOL CBrowserWrapper::ForceCharset(const char *aCharSet) if (NS_FAILED(result) || !contentViewer) return FALSE; - nsCOMPtr mdv = do_QueryInterface(contentViewer,&result); - if (NS_FAILED(result) || !mdv) - return FALSE; - nsCString mCharset; mCharset = aCharSet; - result = mdv->SetForceCharacterSet(mCharset); + result = contentViewer->SetForceCharacterSet(mCharset); if (NS_SUCCEEDED(result)) mWebNav->Reload(nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE); @@ -574,10 +582,10 @@ BOOL CBrowserWrapper::ScrollBy(int32_t dx, int32_t dy) } NS_ENSURE_TRUE(dom, FALSE); - return dom->ScrollBy (dx, dy); + return NS_SUCCEEDED(dom->ScrollBy (dx, dy)); } -already_AddRefed CBrowserWrapper::GetMarkupViewer() +already_AddRefed CBrowserWrapper::GetContentViewer() { nsresult rv; nsCOMPtr docShell = GetDocShell(); @@ -587,15 +595,12 @@ already_AddRefed CBrowserWrapper::GetMarkupViewer() rv = docShell->GetContentViewer(getter_AddRefs(contentViewer)); NS_ENSURE_SUCCESS(rv, NULL); - nsCOMPtr _markupViewer = do_QueryInterface(contentViewer, &rv); - NS_ENSURE_SUCCESS(rv, NULL); - - return _markupViewer.forget(); + return contentViewer.forget(); } BOOL CBrowserWrapper::SetFullZoom(float textzoom) { - nsCOMPtr markupViewer = GetMarkupViewer(); + nsCOMPtr markupViewer = GetContentViewer(); NS_ENSURE_TRUE(markupViewer, FALSE); nsresult rv = markupViewer->SetFullZoom(textzoom); return NS_SUCCEEDED(rv); @@ -603,7 +608,7 @@ BOOL CBrowserWrapper::SetFullZoom(float textzoom) float CBrowserWrapper::GetFullZoom() { - nsCOMPtr markupViewer = GetMarkupViewer(); + nsCOMPtr markupViewer = GetContentViewer(); NS_ENSURE_TRUE(markupViewer, FALSE); float textzoom; nsresult rv = markupViewer->GetFullZoom(&textzoom); @@ -970,13 +975,6 @@ BOOL CBrowserWrapper::InjectCSS(const wchar_t* userStyleSheet) return _InjectCSS(dom, userStyleSheet); } -#include "nsIXPConnect.h" -#include "nsIScriptObjectPrincipal.h" -#include "mozilla/dom/ScriptSettings.h" -#include "nsIJSContextStack.h" -#include "jsapi.h" -#include "mozilla\dom\ScriptSettings.h" - BOOL CBrowserWrapper::InjectJS(const wchar_t* userScript, CString& result, bool bTopWindow) { nsresult rv; @@ -1127,7 +1125,6 @@ BOOL CBrowserWrapper::GetSelection(CString& aSelText) void CBrowserWrapper::SetVisible(BOOL aVisible) { mWebBrowser->SetIsActive(aVisible); - TRACE2("Set Active Browser %u for window %s\n", aVisible, (LPCTSTR)GetTitle()); } struct PRThread; @@ -1156,16 +1153,17 @@ NS_IMPL_ISUPPORTS(focusActive, nsIRunnable) return mFocus->Activate(); } -#include "nsIPresShell.h" +//XXX Can't be included anymore, the focus patch can't work. +//#include "nsIPresShell.h" void CBrowserWrapper::SetActive(BOOL aActive) { NS_ENSURE_TRUE(mWebBrowserFocus, ); TRACE2("Set Focus Active Browser %u for window %s\n", aActive, (LPCTSTR)GetTitle()); if (aActive) { - nsCOMPtr presShell; + //nsCOMPtr presShell; nsCOMPtr docShell = GetDocShell(); - if (docShell) presShell = docShell->GetPresShell(); - if (!presShell) { + //if (docShell) presShell = docShell->GetPresShell(); + if (!docShell) { // Setting the focus later because this does not work on new tab // mWebBrowserFocus->Activate(); nsCOMPtr tm = do_GetService("@mozilla.org/thread-manager;1"); @@ -1715,7 +1713,7 @@ BOOL CBrowserWrapper::_Save(nsIURI* aURI, handler->SetTempFile(file); persist->SetProgressListener(handler); - rv = persist->SaveURI(aURI, aDescriptor, aReferrer, nullptr, nullptr, file, nullptr); + rv = persist->SaveURI(aURI, aDescriptor, aReferrer, 0, nullptr, nullptr, file, nullptr); if (NS_FAILED(rv)) persist->SetProgressListener(nullptr); } diff --git a/k-meleon/app/BrowserWindow.h b/k-meleon/app/BrowserWindow.h index 02d6c412..2c8896bc 100644 --- a/k-meleon/app/BrowserWindow.h +++ b/k-meleon/app/BrowserWindow.h @@ -23,14 +23,19 @@ class nsIX509Cert; #include "IBrowserFrameGlue.h" #include "nsICommandManager.h" -#include "nsIPrintSettings.h" -#include "nsIWebBrowserFind.h" +#include "nsIClipboardCommands.h" +#include "nsIDocShell.h" #include "nsIWebNavigation.h" -#include "nsIWebBrowserFocus.h" #include "nsIWebBrowser.h" -#include "nsIMarkupDocumentViewer.h" +#include "nsIWebBrowserFocus.h" +#include "nsIWebBrowserPrint.h" +#include "nsIBaseWindow.h" + + class nsITypeAheadFind; class nsIDOMKeyEvent; +class nsIPrintSettings; +class nsIWebBrowserFocus; class CBrowserImpl; @@ -76,7 +81,7 @@ public: void SetBrowserGlue(PBROWSERGLUE pBrowserGlue); void SetChromeMask(INT mask) { mChromeMask = mask; } void SetPositionAndSize(int x, int y, int cx, int cy) { - if (mBaseWindow) mBaseWindow->SetPositionAndSize(0, 0, cx, cy, PR_TRUE); + if (mBaseWindow) mBaseWindow->SetPositionAndSize(0, 0, cx, cy, true); } void ShowScrollbars(BOOL visible); BOOL ScrollBy(int32_t dx, int32_t dy); @@ -84,7 +89,7 @@ public: void GoBack() { if (mWebNav) mWebNav->GoBack(); } void GoForward() { if (mWebNav) mWebNav->GoForward(); } void Stop() { if(mWebNav) mWebNav->Stop(nsIWebNavigation::STOP_ALL); } - + bool SetScrollPosition(POINT scroll) { nsCOMPtr dom; @@ -339,7 +344,7 @@ public: return isPreview; } - already_AddRefed GetMarkupViewer(); + already_AddRefed GetContentViewer(); BOOL SetFullZoom(float textzoom); float GetFullZoom(); BOOL ChangeFullZoom(int change); @@ -380,6 +385,8 @@ public: bool TypeAheadFind(nsIDOMKeyEvent* keyEvent); void EndTypeAheadFind(); nsString mSearchString; + BOOL GetCertificate(nsIX509Cert** certificate); + nsIDocShell* GetDocShell(); /* void SetMatchCase(BOOL); void SetWrapAround(BOOL); wchar_t* GetSearchString(); @@ -396,11 +403,9 @@ private: BOOL _GetSelection(nsIDOMWindow* dom, nsAString& aSelText); BOOL _InjectCSS(nsIDOMWindow* dom, const wchar_t* userStyleSheet); BOOL _Highlight(nsIDOMWindow* dom, const PRUnichar* backcolor, const PRUnichar* word, BOOL matchCase); - BOOL _Save(nsIURI* aURI, nsIDOMDocument* aDocument, LPCTSTR filename, nsIURI* aReferrer, nsISupports* aDescriptor); - BOOL GetCertificate(nsIX509Cert** certificate); + BOOL _Save(nsIURI* aURI, nsIDOMDocument* aDocument, LPCTSTR filename, nsIURI* aReferrer, nsISupports* aDescriptor); bool CheckNode(nsIDOMElement* elem); - nsIDocShell* GetDocShell(); #ifndef FINDBAR_USE_TYPEAHEAD void CollapseSelToStartInFrame(nsIDOMWindow* dom); diff --git a/k-meleon/app/Components.cpp b/k-meleon/app/Components.cpp index d86ca8c0..3a51475e 100644 --- a/k-meleon/app/Components.cpp +++ b/k-meleon/app/Components.cpp @@ -58,6 +58,7 @@ static const mozilla::Module::CIDEntry kBrowserAppCIDs[] = { static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { {NS_PROMPTSERVICE_CONTRACTID, &kNS_PROMPTSERVICE_CID}, + {NS_CONTENT_PERMISSION_PROMPT_CONTRACTID, &kNS_PROMPTSERVICE_CID }, {"@mozilla.org/prompter;1", &kNS_PROMPTSERVICE_CID}, //{NS_HELPERAPPLAUNCHERDLG_CONTRACTID, &kNS_UNKNOWNCONTENTTYPEHANDLER_CID}, {"@mozilla.org/uriloader/content-handler;1?type=application/k-skin", &kNS_UNKNOWNCONTENTTYPEHANDLER_CID}, diff --git a/k-meleon/app/FavIconList.cpp b/k-meleon/app/FavIconList.cpp index af2847ca..642e8910 100644 --- a/k-meleon/app/FavIconList.cpp +++ b/k-meleon/app/FavIconList.cpp @@ -44,10 +44,10 @@ class iconCallback: public nsIFaviconDataCallback { public: NS_DECL_ISUPPORTS - NS_DECL_NSIFAVICONDATACALLBACK + NS_DECL_NSIFAVICONDATACALLBACK - iconCallback(CFavIconList* favList, nsIURI* icon, nsIURI* page) : - mFavList(favList), mIconURI(icon), mPageURI(page) {} + iconCallback(CFavIconList* favList, nsIURI* icon, nsIURI* page) : + mFavList(favList), mIconURI(icon), mPageURI(page) {} private: ~iconCallback() {}; @@ -60,7 +60,7 @@ protected: NS_IMPL_ISUPPORTS(iconCallback, nsIFaviconDataCallback) - NS_IMETHODIMP iconCallback::OnComplete(nsIURI *aFaviconURI, uint32_t aDataLen, const uint8_t *aData, const nsACString & aMimeType) +NS_IMETHODIMP iconCallback::OnComplete(nsIURI *aFaviconURI, uint32_t aDataLen, const uint8_t *aData, const nsACString & aMimeType) { if (mPageURI) { nsCOMPtr hostUri; @@ -350,7 +350,7 @@ int CFavIconList::GetIcon(nsIURI *aURI, nsIURI* aPageURI, BOOL download) USES_CONVERSION; if (download) { - nsRefPtr ic = new iconCallback(this, aURI, aPageURI); + iconCallback* ic = new iconCallback(this, aURI, aPageURI); nsCOMPtr afis = GetIconService(); if (!afis) return FALSE; nsresult rv = afis->SetAndFetchFaviconForPage(aPageURI, aURI, false, nsIFaviconService::FAVICON_LOAD_NON_PRIVATE, ic); diff --git a/k-meleon/app/HiddenWnd.cpp b/k-meleon/app/HiddenWnd.cpp index e1480595..f22a4a97 100644 --- a/k-meleon/app/HiddenWnd.cpp +++ b/k-meleon/app/HiddenWnd.cpp @@ -347,6 +347,8 @@ LRESULT CHiddenWnd::OnDeferSaveAs(WPARAM wParam, LPARAM lParam) return NS_SUCCEEDED(rv); } +#include "nsXULAppAPI.h" +extern XRE_TermEmbeddingType XRE_TermEmbedding; void CHiddenWnd::OnEndSession(BOOL bEnding) { if (!bEnding) return; diff --git a/k-meleon/app/IBrowserFrameGlue.h b/k-meleon/app/IBrowserFrameGlue.h index 83b40a8d..4583d157 100644 --- a/k-meleon/app/IBrowserFrameGlue.h +++ b/k-meleon/app/IBrowserFrameGlue.h @@ -146,7 +146,7 @@ struct IBrowserFrameGlue { virtual void GetBrowserFrameVisibility(PRBool *aVisible) = 0; // ContextMenu Related Methods - virtual void ShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aInfo) = 0; + virtual void ShowContextMenu(UINT aContextFlags) = 0; //Prompt Related Methods virtual HWND GetBrowserFrameNativeWnd() = 0; @@ -185,7 +185,7 @@ struct IBrowserFrameGlue { virtual void SetFocus(); \ virtual void FocusAvailable(PRBool *aFocusAvail); \ virtual void GetBrowserFrameVisibility(PRBool *aVisible); \ - virtual void ShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aInfo); \ + virtual void ShowContextMenu(UINT aContextFlags); \ virtual HWND GetBrowserFrameNativeWnd(); \ virtual void ShowTooltip(PRInt32 x, PRInt32 y, const TCHAR *text); \ virtual BOOL FocusNextElement(); \ diff --git a/k-meleon/app/KMeleon.vcxproj b/k-meleon/app/KMeleon.vcxproj index 938d314e..8b2c97bc 100644 --- a/k-meleon/app/KMeleon.vcxproj +++ b/k-meleon/app/KMeleon.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -23,7 +23,7 @@ Application true - v100 + v120 Unicode Dynamic @@ -33,6 +33,7 @@ true Unicode Dynamic + v120 Application @@ -40,6 +41,7 @@ true Unicode Static + v120 diff --git a/k-meleon/app/KMeleonConst.h b/k-meleon/app/KMeleonConst.h index 377b4981..f3d02c51 100644 --- a/k-meleon/app/KMeleonConst.h +++ b/k-meleon/app/KMeleonConst.h @@ -17,10 +17,10 @@ */ -#define KMELEON_VERSION 0x02020005 +#define KMELEON_VERSION 0x02030002 #define MOZILLA_BUILDID 20140105 -#define KMELEON_BUILDID 7501 -#define KMELEON_UVERSION 75.1 +#define KMELEON_BUILDID 7600 +#define KMELEON_UVERSION 76.0 #define KMELEON_UUID {944df56f-c0ec-4d7b-94b6-f625c8cc96ea} #define WM_DEFERSHOW WM_USER + 200 diff --git a/k-meleon/app/KmAbout.cpp b/k-meleon/app/KmAbout.cpp index ef628915..6af462ac 100644 --- a/k-meleon/app/KmAbout.cpp +++ b/k-meleon/app/KmAbout.cpp @@ -71,7 +71,7 @@ static nsAutoCString } NS_IMETHODIMP - KmAbout::NewChannel(nsIURI *aURI, nsIChannel **result) +KmAbout::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel **result) { NS_ENSURE_ARG_POINTER(aURI); NS_ASSERTION(result, "must not be null"); @@ -115,3 +115,9 @@ KmAbout::GetURIFlags(nsIURI *aURI, uint32_t *result) return NS_ERROR_ILLEGAL_VALUE; } + +NS_IMETHODIMP +KmAbout::GetIndexedDBOriginPostfix(class nsIURI *,class nsAString &) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} \ No newline at end of file diff --git a/k-meleon/app/KmAppInfo.cpp b/k-meleon/app/KmAppInfo.cpp index 0247a43f..f2ad35ea 100644 --- a/k-meleon/app/KmAppInfo.cpp +++ b/k-meleon/app/KmAppInfo.cpp @@ -24,6 +24,7 @@ #include "MfcEmbed.h" #include "nsAppShellCID.h" #include "nsIAppShellService.h" +#include "nsXULAppAPI.h" NS_IMPL_ISUPPORTS(KmAppInfo, nsIXULAppInfo, nsIXULRuntime, nsIAppStartup, nsIAppStartup2) @@ -218,18 +219,36 @@ NS_IMETHODIMP KmAppInfo::GetLastRunCrashID(nsAString & aLastRunCrashID) return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP KmAppInfo::GetBrowserTabsRemote(bool *aBrowserTabsRemote) +NS_IMETHODIMP KmAppInfo::GetBrowserTabsRemoteAutostart(bool *aBrowserTabsRemote) { *aBrowserTabsRemote = false; return NS_OK; } +/* readonly attribute boolean accessibilityEnabled; */ +NS_IMETHODIMP KmAppInfo::GetAccessibilityEnabled(bool *aAccessibilityEnabled) +{ + *aAccessibilityEnabled = false; + return NS_OK; +} + NS_IMETHODIMP KmAppInfo::GetDefaultUpdateChannel(nsACString & aDefaultUpdateChannel) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP KmAppInfo::GetDistributionID(nsACString & aDistributionID) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP KmAppInfo::GetKeyboardMayHaveIME(bool *ime) +{ + *ime = true; + return NS_OK; +} + +NS_IMETHODIMP KmAppInfo::GetIsOfficial(bool *) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -389,4 +408,20 @@ NS_IMETHODIMP KmAppInfo::ProcessNativeEvent(void* aMsg) ::DispatchMessage(msg); } return NS_OK; -} \ No newline at end of file +} + +#include "nsIAccessibilityService.h" +NS_IMETHODIMP KmAppInfo::GetAccessibilityIsUIA(bool *aAccessibilityIsUIA) +{ + *aAccessibilityIsUIA = false; +#if defined(ACCESSIBILITY) && defined(XP_WIN) + nsCOMPtr serv = do_GetService("@mozilla.org/accessibilityService;1"); + // This is the same check the a11y service does to identify uia clients. + if (serv != nullptr && + (::GetModuleHandleW(L"uiautomation") || + ::GetModuleHandleW(L"uiautomationcore"))) { + *aAccessibilityIsUIA = true; + } +#endif + return NS_OK; +} diff --git a/k-meleon/app/KmFileLocProvider.cpp b/k-meleon/app/KmFileLocProvider.cpp index ef6caf51..d6011360 100644 --- a/k-meleon/app/KmFileLocProvider.cpp +++ b/k-meleon/app/KmFileLocProvider.cpp @@ -40,7 +40,7 @@ #define XP_WIN #endif -#include "nsAppDirectoryServiceDefs.h" +#include "nsXULAppAPI.h" #include "nsDirectoryServiceDefs.h" #include "nsILocalFile.h" #include "nsIProperties.h" diff --git a/k-meleon/app/KmImage.cpp b/k-meleon/app/KmImage.cpp index f6269b57..4c7d2996 100644 --- a/k-meleon/app/KmImage.cpp +++ b/k-meleon/app/KmImage.cpp @@ -22,16 +22,28 @@ #include "imgILoader.h" #include "imgIContainer.h" -#include "gfxUtils.h" -#include "MozUtils.h" -#include "kmeleon_plugin.h" +//#include "gfxUtils.h" bool IsComCtl6() { static int isv6 = -1; if (isv6 != -1) return isv6; - DWORD maj,min; - AtlGetCommCtrlVersion(&maj, &min); - isv6 = maj >= 6; + HMODULE hComCtlDll = LoadLibrary(_T("comctl32.dll")); + if (!hComCtlDll) return isv6 = 0; + + typedef HRESULT (CALLBACK *PFNDLLGETVERSION)(DLLVERSIONINFO*); + PFNDLLGETVERSION pfnDllGetVersion = (PFNDLLGETVERSION)GetProcAddress(hComCtlDll, "DllGetVersion"); + if (!pfnDllGetVersion) + isv6 = 0; + else { + DLLVERSIONINFO dvi = {0}; + dvi.cbSize = sizeof(dvi); + + HRESULT hRes = (*pfnDllGetVersion)(&dvi); + isv6 = SUCCEEDED(hRes) && dvi.dwMajorVersion >= 6; + } + + FreeLibrary(hComCtlDll); + if (!isv6) { HMODULE hntdll = GetModuleHandle(L"ntdll.dll"); if (hntdll && GetProcAddress(hntdll, "wine_get_version")) diff --git a/k-meleon/app/KmImage.h b/k-meleon/app/KmImage.h index 8573acea..af9d563a 100644 --- a/k-meleon/app/KmImage.h +++ b/k-meleon/app/KmImage.h @@ -44,9 +44,9 @@ public: NS_ENSURE_SUCCESS(rv, false); nsImageObserver* obs = new nsImageObserver(observer); - return NS_SUCCEEDED(loader->LoadImageXPCOM(imgUri, nullptr, nullptr, + return NS_SUCCEEDED(loader->LoadImageXPCOM(imgUri, nullptr, nullptr, NS_LITERAL_STRING(""), nullptr, nullptr, obs, nullptr, nsIRequest::LOAD_BYPASS_CACHE, - nullptr, nullptr, getter_AddRefs(obs->mRequest))); + nullptr, 0, getter_AddRefs(obs->mRequest))); } protected: diff --git a/k-meleon/app/KmInstaller.h b/k-meleon/app/KmInstaller.h index cb34fb67..128074cf 100644 --- a/k-meleon/app/KmInstaller.h +++ b/k-meleon/app/KmInstaller.h @@ -58,7 +58,7 @@ public: persist->SetPersistFlags( nsIWebBrowserPersist::PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION| nsIWebBrowserPersist::PERSIST_FLAGS_REPLACE_EXISTING_FILES); - nsresult rv = persist->SaveURI(uri, nullptr, nullptr, nullptr, nullptr, mFile, nullptr); + nsresult rv = persist->SaveURI(uri, nullptr, nullptr, 0, nullptr, nullptr, mFile, nullptr); if (NS_FAILED(rv)) { persist->SetProgressListener(nullptr); return rv; diff --git a/k-meleon/app/KmMenu.cpp b/k-meleon/app/KmMenu.cpp index f9eade25..7e0a21ae 100644 --- a/k-meleon/app/KmMenu.cpp +++ b/k-meleon/app/KmMenu.cpp @@ -189,90 +189,6 @@ BOOL KmMenu::Build() return TRUE; } -HRESULT Create32BitHBITMAP(HDC hdc, const SIZE *psize, __deref_opt_out void **ppvBits, __out HBITMAP* phBmp) -{ - *phBmp = NULL; - - BITMAPINFO bmi; - SecureZeroMemory(&bmi, sizeof(bmi)); - bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biCompression = BI_RGB; - - bmi.bmiHeader.biWidth = psize->cx; - bmi.bmiHeader.biHeight = psize->cy; - bmi.bmiHeader.biBitCount = 32; - - HDC hdcUsed = hdc ? hdc : GetDC(NULL); - if (hdcUsed) - { - *phBmp = CreateDIBSection(hdcUsed, &bmi, DIB_RGB_COLORS, ppvBits, NULL, 0); - if (hdc != hdcUsed) - { - ReleaseDC(NULL, hdcUsed); - } - } - return (NULL == *phBmp) ? E_OUTOFMEMORY : S_OK; -} - -HBITMAP IconToBitmap(HIMAGELIST il, int idx) { - - IWICImagingFactory *pFactory; - - HRESULT hr = CoCreateInstance(CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pFactory)); - - HICON hicon = ImageList_ExtractIcon(0,il,idx); - HBITMAP hbmp = NULL; - if (SUCCEEDED(hr)) - - { - - IWICBitmap *pBitmap; - - hr = pFactory->CreateBitmapFromHICON(hicon, &pBitmap); - - if (SUCCEEDED(hr)) - - { - - UINT cx, cy; - - hr = pBitmap->GetSize(&cx, &cy); - - if (SUCCEEDED(hr)) - - { - - const SIZE sizIcon = { (int)cx, -(int)cy }; - - BYTE *pbBuffer; - - hr = Create32BitHBITMAP(NULL, &sizIcon, reinterpret_cast(&pbBuffer), &hbmp); - - if (SUCCEEDED(hr)) - - { - - const UINT cbStride = cx * sizeof(DWORD); - - const UINT cbBuffer = cy * cbStride; - - hr = pBitmap->CopyPixels(NULL, cbStride, cbBuffer, pbBuffer); - - } - - } - - pBitmap->Release(); - - } - - pFactory->Release(); - - } - return hbmp; -} - BOOL KmMenu::Build(CMenu &menu, int before) { BOOL wasSeparator = TRUE; @@ -290,8 +206,6 @@ BOOL KmMenu::Build(CMenu &menu, int before) case MenuPopup: // Popup Menu label = A2CT(item.label); popup = theApp.menus.GetMenu(label); - - if (popup) { menu.InsertMenu(before, MF_POPUP, (UINT)popup->m_hMenu, theApp.lang.Translate(label)); @@ -374,19 +288,12 @@ BOOL KmMenu::Build(CMenu &menu, int before) break; } - case MenuSeparator: {// Separator + case MenuSeparator: // Separator if (wasSeparator || (i == mMenuDef.GetCount()-1)) break; menu.InsertMenu(before, MF_SEPARATOR); - /*MENUITEMINFO mi = {0}; - mi.cbSize = sizeof(mi); - mi.fMask = MIIM_DATA | MIIM_TYPE; - mi.dwItemData = (ULONG_PTR)&item; - mi.fType = MF_SEPARATOR | MF_OWNERDRAW; - menu.InsertMenuItem(before, &mi, TRUE); */ wasSeparator = TRUE; //LOG_1("Added Separator", 0); break; - } case MenuPlugin: { char *plugin, *parameter; @@ -443,28 +350,7 @@ BOOL KmMenu::Build(CMenu &menu, int before) mi.dwItemData = 0;//(ULONG_PTR)&item;//(ULONG_PTR)_wcsdup((LPCTSTR)pTranslated); menu.SetMenuItemInfo(item.command, &mi); } - - - - /* - int idx = theApp.skin.GetIconIndex(item.command); - HIMAGELIST il = theApp.skin.GetIconList(); - - - MENUITEMINFO mi = {0}; - mi.cbSize = sizeof(mi); - mi.fMask = MIIM_CHECKMARKS; - //mi.dwItemData = (ULONG_PTR)&item; - //mi.hbmpChecked = mi.hbmpUnchecked = IconToBitmap(il, idx); - //mi.hbmpItem = IconToBitmap(il, idx); - KmImage img; - img.LoadFromIcon(ImageList_ExtractIcon(0,il,idx)); - //img.LoadIndexedFromSkin(L"menu3.png[0]",16,16); - mi.hbmpChecked = mi.hbmpUnchecked = img.GetHBitmap(); - //mi.fType = MF_STRING | MF_OWNERDRAW; - //mi.wID = item.command; - UINT toto = menu.SetMenuItemInfo(item.command, &mi); - UINT tata = GetLastError();*/ + //LOG_2("Added menu item %s with command %d", _label, item.command); wasSeparator = FALSE; break; diff --git a/k-meleon/app/MfcEmbed.cpp b/k-meleon/app/MfcEmbed.cpp index 4822f9c5..450494d2 100644 --- a/k-meleon/app/MfcEmbed.cpp +++ b/k-meleon/app/MfcEmbed.cpp @@ -66,11 +66,14 @@ #include #include +#include "nsXULAppAPI.h" +#include "nsXPCOMGlue.h" #include "nsIIOService.h" #include "nsIWindowWatcher.h" #include "nsIChromeRegistry.h" #include "nsIAppStartup.h" #include "nsToolkitCompsCID.h" +#include "nsIObserverService.h" #include static UINT WM_POSTEVENT = RegisterWindowMessage(_T("XPCOM_PostEvent")); @@ -579,8 +582,16 @@ BOOL CMfcEmbedApp::InitInstance() #ifdef _DEBUG ShowDebugConsole(); _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG); #endif + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + CWinApp::InitInstance(); AfxOleInit(); @@ -1102,7 +1113,7 @@ void CMfcEmbedApp::OnToggleOffline() void CMfcEmbedApp::OnToggleJS() { - bool enable = !preferences.GetBool("javascript.enabled", 1); + int enable = !preferences.GetBool("javascript.enabled", 1); preferences.SetBool("javascript.enabled", enable); CBrowserFrame* pBrowserFrame = NULL; @@ -1637,6 +1648,7 @@ CString CMfcEmbedApp::GetFolder(FolderType folder) #include "nsIFileProtocolHandler.h" #include "nsIRDFContainer.h" #include "nsIRDFRemoteDataSource.h" +#include "nsDirectoryServiceUtils.h" void CMfcEmbedApp::CheckProfileVersion() { @@ -1866,7 +1878,7 @@ BOOL CMfcEmbedApp::PumpMessage2(UINT filter) { _AFX_THREAD_STATE *pState = AfxGetThreadState(); - if (!::GetMessage(&(pState->m_msgCur), NULL, NULL, filter)) + if (!::GetMessageW(&(pState->m_msgCur), NULL, NULL, filter)) { #ifdef _DEBUG TRACE(traceAppMsg, 1, "CWinThread::PumpMessage - Received WM_QUIT.\n"); diff --git a/k-meleon/app/MfcEmbed.rc b/k-meleon/app/MfcEmbed.rc index 9902409d..906fde78 100644 --- a/k-meleon/app/MfcEmbed.rc +++ b/k-meleon/app/MfcEmbed.rc @@ -733,7 +733,7 @@ BEGIN LTEXT "Issued On",IDC_STATIC,16,184,34,8 LTEXT "Expires On",IDC_STATIC,16,196,36,8 LTEXT "SHA1 Fingerprint",IDC_STATIC,16,226,55,8 - LTEXT "MD5 Fingerprint",IDC_STATIC,16,238,52,8 + LTEXT "SHA256",IDC_STATIC,16,238,52,8 EDITTEXT IDC_EDIT_CN,100,61,162,12,ES_AUTOHSCROLL | ES_READONLY EDITTEXT IDC_EDIT_O2,100,141,162,12,ES_AUTOHSCROLL | ES_READONLY EDITTEXT IDC_EDIT_O,100,73,162,12,ES_AUTOHSCROLL | ES_READONLY @@ -815,8 +815,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 75,1,0,0 - PRODUCTVERSION 75,1,0,0 + FILEVERSION 76,0,0,0 + PRODUCTVERSION 76,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -833,11 +833,11 @@ BEGIN BEGIN VALUE "CompanyName", "http://kmeleonbrowser.org/" VALUE "FileDescription", "K-Meleon Web Browser" - VALUE "FileVersion", "75.1.0.0" + VALUE "FileVersion", "76.0.0.0" VALUE "LegalCopyright", "Copyright (C) 2001-2015" VALUE "OriginalFilename", "k-meleon.exe" VALUE "ProductName", "K-Meleon" - VALUE "ProductVersion", "75.1.0.0" + VALUE "ProductVersion", "76.0.0.0" END END BLOCK "VarFileInfo" diff --git a/k-meleon/app/MostRecentUrls.cpp b/k-meleon/app/MostRecentUrls.cpp index 59e8e00a..5cb1d760 100644 --- a/k-meleon/app/MostRecentUrls.cpp +++ b/k-meleon/app/MostRecentUrls.cpp @@ -18,11 +18,9 @@ */ #include "StdAfx.h" -#include "nsIFile.h" -#include "nsILocalFile.h" -#include "nsAppDirectoryServiceDefs.h" #include "MostRecentUrls.h" #include "MfcEmbed.h" + extern CMfcEmbedApp theApp; CMostRecentUrls::CMostRecentUrls() diff --git a/k-meleon/app/MozUtils.cpp b/k-meleon/app/MozUtils.cpp index c8dda00f..60a1cd6f 100644 --- a/k-meleon/app/MozUtils.cpp +++ b/k-meleon/app/MozUtils.cpp @@ -1,13 +1,8 @@ #include "stdafx.h" -#include "MozUtils.h" #include "nsIWindowWatcher.h" #include "nsIIOService.h" - #include "nsDirectoryServiceUtils.h" - -#include "nsIDOMHTMLImageElement.h" -#include "nsIDOMHTMLInputElement.h" -#include "nsIDOMHTMLObjectElement.h" +#include "nsIDocShell.h" #include "nsIDOMCSSPrimitiveValue.h" #include "nsIDOMCSSStyleDeclaration.h" @@ -15,6 +10,10 @@ #include "nsIDOMCharacterData.h" +#include "nsIDOMHTMLDocument.h" +#include "nsIDOMHTMLImageElement.h" +#include "nsIDOMHTMLInputElement.h" +#include "nsIDOMHTMLObjectElement.h" #include "nsIDOMHTMLAreaElement.h" #include "nsIDOMHTMLLinkElement.h" #include "nsIDOMHTMLAnchorElement.h" @@ -585,8 +584,11 @@ BOOL LogMessage(const char* category, const char* message, const char* file, uin CString GetSearchURL(LPCTSTR query) { nsCOMPtr fixup(do_GetService("@mozilla.org/docshell/urifixup;1")); + nsCOMPtr iuri; + if (!iuri) return _T(""); + nsCOMPtr uri; - fixup->KeywordToURI(CStringToNSCString(query), nullptr, getter_AddRefs(uri)); + iuri->GetFixedURI(getter_AddRefs(uri)); if (!uri) return _T(""); nsCString spec; @@ -672,6 +674,8 @@ bool ZipExtractFiles(nsIFile* zipFile, nsIFile* folder) #include "mozilla/dom/ScriptSettings.h" #include "nsIJSContextStack.h" #include "jsapi.h" +#include "js/GCAPI.h" +#include "jsfriendapi.h" bool InjectJS(nsIDOMWindow* dom, const wchar_t* userScript, CString& result) { @@ -717,19 +721,33 @@ bool InjectJS(nsIDOMWindow* dom, const wchar_t* userScript, CString& result) nsCOMPtr scriptContext = global->GetContext(); NS_ENSURE_TRUE(scriptContext, FALSE); + NS_AUTO_POPUP_STATE_PUSHER popup(piWin, openAllowed); + JSContext* cx = scriptContext->GetNativeContext(); if (!cx) return FALSE; + JS::Rooted _globalJSObject(JS_GetRuntime(cx), innerGlobal->GetGlobalJSObject()); NS_ENSURE_SUCCESS(cs->Push(cx), FALSE); JSAutoRequest ar(cx); - JSAutoCompartment ac(cx, scriptContext->GetWindowProxy()); + JSAutoNullableCompartment ac(cx, _globalJSObject); + + docShell->NotifyJSRunToCompletionStart(); + JS::Rooted globalJSObject(cx, innerGlobal->GetGlobalJSObject()); JS::Rooted v (cx, JS::UndefinedValue()); - JS_EvaluateUCScript(cx, globalJSObject, userScript, wcslen(userScript), "kmeleon", 0, &v); - - if (!v.isObject() && v.toString()) - result = NSStringToCString(nsString(JS_GetStringCharsZ(cx, v.toString()))); + JS::CompileOptions opts(cx); + opts.setFileAndLine("kmeleon", 0); + opts.setNoScriptRval(false); + JS::Evaluate(cx, globalJSObject, opts, userScript, wcslen(userScript), &v); + ::JS_ReportPendingException(cx); + if (v.isString() && !v.isObject()) { + JSString* str = v.toString(); + size_t l = JS_GetStringLength(str); + js::CopyStringChars(cx, result.GetBufferSetLength(l + 1), str, l); + result.SetAt(l, 0); + } cs->Pop(nullptr); + docShell->NotifyJSRunToCompletionStop(); return TRUE; } diff --git a/k-meleon/app/MozUtils.h b/k-meleon/app/MozUtils.h index de7011cb..8c61da89 100644 --- a/k-meleon/app/MozUtils.h +++ b/k-meleon/app/MozUtils.h @@ -2,8 +2,10 @@ #ifndef __MOZUTILS_H__ #define __MOZUTILS_H__ -inline nsString CStringToNSString(LPCTSTR aStr); -inline nsCString CStringToNSCString(LPCTSTR aStr); +#include "stdafx.h" + +nsString CStringToNSString(LPCTSTR aStr); +nsCString CStringToNSCString(LPCTSTR aStr); nsCString CStringToNSUTF8String(LPCTSTR aStr); //__forceinline PRUnichar* CStringToPRUnichar(LPCTSTR aStr) @@ -12,9 +14,9 @@ nsCString CStringToNSUTF8String(LPCTSTR aStr); #define CStringToPRUnichar(str) CT2W(str) CString PRUnicharToCString(const PRUnichar* str); -inline CString NSStringToCString(const nsString& aStr); +CString NSStringToCString(const nsString& aStr); CString NSUTF8StringToCString(const nsCString& aStr); -inline CString NSCStringToCString(const nsCString& aStr); +CString NSCStringToCString(const nsCString& aStr); bool ZipExtractFiles(nsIFile* zipFile, nsIFile* dir); nsresult NewURI(nsIURI **result, const nsACString &spec); diff --git a/k-meleon/app/NSSDialogs.cpp b/k-meleon/app/NSSDialogs.cpp index d506fa41..817cb7db 100644 --- a/k-meleon/app/NSSDialogs.cpp +++ b/k-meleon/app/NSSDialogs.cpp @@ -260,7 +260,7 @@ NS_IMETHODIMP CNSSDialogs::ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cer cert->GetSha1Fingerprint (value); viewCertGeneral.m_csSHA1 = W2CT(value.get()); - cert->GetMd5Fingerprint (value); + cert->GetSha256Fingerprint (value); viewCertGeneral.m_csMD5 = W2CT(value.get()); viewCert.m_psh.dwFlags |= PSH_NOAPPLYNOW; @@ -820,10 +820,8 @@ BOOL CViewCertDetailsPage::OnInitDialog() if (displayVal.IsEmpty()) { - char *title; - cert->GetWindowTitle(&title); - displayVal = A2W(title); - nsMemory::Free(title); + nsString title; + cert->GetWindowTitle(displayVal); } nsIX509Cert *pCert = cert; diff --git a/k-meleon/app/Plugins.cpp b/k-meleon/app/Plugins.cpp index 0c37b26d..bc8545d4 100644 --- a/k-meleon/app/Plugins.cpp +++ b/k-meleon/app/Plugins.cpp @@ -2072,7 +2072,7 @@ public: nsCString spec; if (uri) uri->GetSpec(spec); CAutoPtr path(EncodeUTF8(wpath)); - mProc(spec.get(), path, result, mData); + mProc(spec.get(), path, (int)result, mData); delete this; } }; diff --git a/k-meleon/app/PrintProgressDialog.h b/k-meleon/app/PrintProgressDialog.h index 38bcff0a..928887cf 100644 --- a/k-meleon/app/PrintProgressDialog.h +++ b/k-meleon/app/PrintProgressDialog.h @@ -9,6 +9,7 @@ #include "resource.h" #include "nsIWebProgressListener.h" class nsIWebBrowser; +class nsIPrintSettings; ///////////////////////////////////////////////////////////////////////////// // CPrintProgressDialog dialog diff --git a/k-meleon/app/ProfileMgr.cpp b/k-meleon/app/ProfileMgr.cpp index 25155b72..00d5679c 100644 --- a/k-meleon/app/ProfileMgr.cpp +++ b/k-meleon/app/ProfileMgr.cpp @@ -25,6 +25,7 @@ #include "kmeleon_plugin.h" // Mozilla Includes #include "nsIToolkitProfileService.h" +#include "nsXULAppAPI.h" // Constants #define kRegistryGlobalPrefsSubtreeString (nsString(L"global-prefs")) diff --git a/k-meleon/app/PromptService.cpp b/k-meleon/app/PromptService.cpp index c4769146..9425dd2f 100644 --- a/k-meleon/app/PromptService.cpp +++ b/k-meleon/app/PromptService.cpp @@ -52,7 +52,7 @@ extern CWnd* CWndForDOMWindow(nsIDOMWindow *aWindow); //***************************************************************************** -NS_IMPL_ISUPPORTS(CPromptService, nsIPromptFactory, nsIPrompt, nsIAuthPrompt, nsIPromptService) +NS_IMPL_ISUPPORTS(CPromptService, nsIPromptFactory, nsIPrompt, nsIAuthPrompt, nsIPromptService, nsIContentPermissionPrompt) //NS_IMPL_ISUPPORTS1(CPromptService, nsIPromptService/*, nsINonBlockingAlertService*/) CPromptService::CPromptService() @@ -663,6 +663,77 @@ CPromptService::ShowNonBlockingAlert(nsIDOMWindow *aParent, return result ? NS_OK : NS_ERROR_FAILURE; } */ +#include "nsIArray.h" +#include "nsIPrincipal.h" +#include "nsIPermissionManager.h" +#include "nsIScriptGlobalObject.h" +#include "nsPIDOMWindow.h" +#include "nsIDocShell.h" +#include "nsIScriptContext.h" + +NS_IMETHODIMP CPromptService::Prompt(nsIContentPermissionRequest *request) +{ + nsCOMPtr perm; + nsCOMPtr types; + request->GetTypes(getter_AddRefs(types)); + NS_ENSURE_TRUE(types, NS_ERROR_FAILURE); + + types->QueryElementAt(0, NS_ICONTENTPERMISSIONTYPE_IID, getter_AddRefs(perm)); + NS_ENSURE_TRUE(perm, NS_ERROR_FAILURE); + + nsCString type; + nsDependentCString permType; + perm->GetType(type); + if (type.Compare("geolocation") == 0) + permType.Assign("geo"); + else + permType.Assign(type); + + nsCOMPtr principal; + request->GetPrincipal(getter_AddRefs(principal)); + NS_ENSURE_TRUE(principal, NS_ERROR_FAILURE); + + nsCOMPtr uri; + principal->GetURI(getter_AddRefs(uri)); + NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE); + + nsCOMPtr permManager = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID); + NS_ENSURE_TRUE(permManager, NS_ERROR_FAILURE); + + uint32_t result; + nsresult rv = permManager->TestExactPermissionFromPrincipal(principal, permType.get(), &result); + if (NS_FAILED(rv) || result == nsIPermissionManager::DENY_ACTION) { + return NS_ERROR_FAILURE; + } + + if (NS_FAILED(rv) || result == nsIPermissionManager::ALLOW_ACTION) { + + nsCOMPtr dom; + request->GetWindow(getter_AddRefs(dom)); + NS_ENSURE_TRUE(dom, NS_ERROR_FAILURE); + + nsCOMPtr piWin(do_QueryInterface(dom)); + if (!piWin) return NS_ERROR_FAILURE; + nsIDocShell* docShell = piWin->GetDocShell(); + if (!docShell) return NS_ERROR_FAILURE; + + nsCOMPtr global = docShell->GetScriptGlobalObject(); + NS_ENSURE_TRUE(global, NS_ERROR_FAILURE); + + nsPIDOMWindow *innerWin = piWin->GetCurrentInnerWindow(); + nsCOMPtr innerGlobal = do_QueryInterface(innerWin); + nsCOMPtr scriptContext = global->GetContext(); + NS_ENSURE_TRUE(scriptContext, NS_ERROR_FAILURE); + + JSContext* cx = scriptContext->GetNativeContext(); + JS::Rooted v(cx, JS::UndefinedValue()); + request->Allow(v); + return NS_OK; + } + + return NS_ERROR_NOT_IMPLEMENTED; +} + //***************************************************************************** // CPromptServiceFactory //***************************************************************************** diff --git a/k-meleon/app/PromptService.h b/k-meleon/app/PromptService.h index a7633829..ae9262f9 100644 --- a/k-meleon/app/PromptService.h +++ b/k-meleon/app/PromptService.h @@ -35,6 +35,7 @@ class nsIFactory; #include "nsIPromptService.h" #include "nsIAuthPrompt.h" #include "nsIAuthPrompt2.h" +#include "nsIContentPermissionPrompt.h" #include "nsIWindowWatcher.h" #include "nsEmbedCID.h" @@ -44,7 +45,7 @@ class nsIFactory; static NS_DEFINE_CID(kPromptServiceCID, NS_PROMPTSERVICE_CID); class CPromptService: public nsIPromptFactory, public nsIPromptService, public nsIPrompt, - public nsIAuthPrompt2, public nsIAuthPrompt + public nsIAuthPrompt2, public nsIAuthPrompt, public nsIContentPermissionPrompt { public: CPromptService(); @@ -56,6 +57,7 @@ public: NS_DECL_NSIPROMPTSERVICE NS_DECL_NSIAUTHPROMPT NS_DECL_NSIAUTHPROMPT2 + NS_DECL_NSICONTENTPERMISSIONPROMPT // NS_DECL_NSINONBLOCKINGALERTSERVICE protected: diff --git a/k-meleon/app/SaveAsHandler.cpp b/k-meleon/app/SaveAsHandler.cpp index 64edaa4d..d56cb9cf 100644 --- a/k-meleon/app/SaveAsHandler.cpp +++ b/k-meleon/app/SaveAsHandler.cpp @@ -11,7 +11,7 @@ extern CMfcEmbedApp theApp; #include "nsIHttpChannel.h" #include "nsIStandardURL.h" #include "nsIURL.h" - +#include "nsIDOMHTMLDocument.h" #include "UnknownContentTypeHandler.h" #include "nsCWebBrowserPersist.h" @@ -357,7 +357,7 @@ NS_IMETHODIMP CSaveAsHandler::DownloadTo(nsString& aFilename, BOOL isHTML, BOOL CProgressDialog *progress = new CProgressDialog(FALSE); progress->InitPersist(mRealURI, file, persist, TRUE); //persist->SetProgressListener(progress); - rv = persist->SaveURI(mRealURI, nullptr, mReferrer, nullptr, nullptr, file, nullptr); + rv = persist->SaveURI(mRealURI, nullptr, mReferrer, 0, nullptr, nullptr, file, nullptr); if (NS_FAILED(rv)) { //Remove cycling reference, avoid leaking persist->SetProgressListener(nullptr); progress->Close(); @@ -399,7 +399,7 @@ NS_IMETHODIMP CSaveAsHandler::DownloadTo(nsString& aFilename, BOOL isHTML, BOOL rv = persist->SaveDocument(mDocument, file, dataFolder, mContentType.get(), 0, 0); } else - rv = persist->SaveURI(mURL, mDescriptor, mReferrer, nullptr, nullptr, file, nullptr); + rv = persist->SaveURI(mURL, mDescriptor, mReferrer, 0, nullptr, nullptr, file, nullptr); } return rv; } diff --git a/k-meleon/app/StdAfx.h b/k-meleon/app/StdAfx.h index 5ff039dc..99340727 100644 --- a/k-meleon/app/StdAfx.h +++ b/k-meleon/app/StdAfx.h @@ -64,6 +64,8 @@ #define NS_ARRAY_LENGTH(array_) \ (sizeof(array_)/sizeof(array_[0])) + +#include #include // MFC core and standard components #include // MFC extensions #include // Classes MFC Automation @@ -80,6 +82,7 @@ #undef min #undef max +#include #ifdef _UNICODE #if defined _M_IX86 @@ -95,97 +98,40 @@ #undef DEBUG #endif -#define XP_WIN #define XPCOM_GLUE -#define MOZILLA_STRICT_API #define INTERNAL_SIDEBAR #define INTERNAL_SITEICONS +#include "js-config.h" +#include "nsCOMPtr.h" +#include "nsIURI.h" +#include "nsIFile.h" +#include "nsMemory.h" +#include "nsNetCID.h" +#include "nsEmbedCID.h" +#include "nsIObserver.h" +#include "nsEmbedString.h" +#include "nsWeakReference.h" +#include "nsIWindowCreator.h" +#include "nsIInterfaceRequestor.h" +#include "nsServiceManagerUtils.h" +#include "nsComponentManagerUtils.h" +#include "nsIInterfaceRequestorUtils.h" +#include "nsAppDirectoryServiceDefs.h" -// docshell: -#include "nsIDocShell.h" +#if defined(THERECANBENODEBUG) +#define DEBUG +#endif -// dom: #include "nsIDOMNode.h" #include "nsIDOMWindow.h" -#include "nsIDOMDocument.h" #include "nsIDOMElement.h" -#include "nsIDOMHTMLDocument.h" - -/* -#include "nsIDOMWindowCollection.h" -#include "nsIDOMHTMLAnchorElement.h" -#include "nsIDOMHTMLImageElement.h" -#include "nsIWebNavigation.h" -#include "nsIDocShellTreeOwner.h" -#include "nsIDocShellTreeItem.h" -#include "nsIDOMHTMLFrameSetElement.h" -*/ - -// embed_base: -#include "nsIWindowCreator.h" - -// necko: -//#include "nsIPrompt.h" -#include "nsIURI.h" - -// nkcache: -#include "nsICacheService.h" - -#include "nsXULAppAPI.h" -#include "nsXPCOMGlue.h" -#include "nsCOMPtr.h" -#include "nsAppDirectoryServiceDefs.h" -#include "nsProfileDirServiceProvider.h" - -// string: -#include "nsEmbedString.h" - -// uriloader: -#include "nsIWebProgress.h" -#include "nsIWebProgressListener2.h" - -// wallet: -//#include "nsIWalletService.h" +#include "nsIDOMDocument.h" -// webBrowser_core: #include "nsIWebBrowser.h" #include "nsIWebBrowserChrome.h" -#include "nsIContextMenuListener2.h" -#include "nsIWebBrowserPrint.h" - -#include "nsCWebBrowser.h" - -// webbrowserpersist: -#include "nsIWebBrowserPersist.h" - -// webshell: -#include "nsIClipboardCommands.h" - -// widget: -/* -#include "nsIBaseWindow.h" -#include "nsWidgetsCID.h" -#include "nsIFilePicker.h" -#include "nsIWidget.h"*/ - -// xpcom: -#include "nsCOMPtr.h" -#include "nsWeakReference.h" - -#include "nsIInterfaceRequestor.h" -#include "nsIServiceManager.h" -#include "nsError.h" -#include "imgIContainer.h" -#include "nsAppDirectoryServiceDefs.h" -#include "nsIObserver.h" -#include "nsIObserverService.h" -#include "nsMemory.h" -#include "nsServiceManagerUtils.h" -#include "nsComponentManagerUtils.h" -#include "nsNetCID.h" -#include "nsIInterfaceRequestorUtils.h" +#include "nsIWebProgressListener.h" // nspr: diff --git a/k-meleon/app/TooltipsProvider.h b/k-meleon/app/TooltipsProvider.h index 5858d2fe..f6086d8c 100644 --- a/k-meleon/app/TooltipsProvider.h +++ b/k-meleon/app/TooltipsProvider.h @@ -34,7 +34,6 @@ public: // ctor/dtor CTooltipTextProvider() { - NS_INIT_ISUPPORTS(); } virtual ~CTooltipTextProvider() { } diff --git a/k-meleon/app/UnknownContentTypeHandler.cpp b/k-meleon/app/UnknownContentTypeHandler.cpp index 30bb76fd..7c521be2 100644 --- a/k-meleon/app/UnknownContentTypeHandler.cpp +++ b/k-meleon/app/UnknownContentTypeHandler.cpp @@ -215,7 +215,7 @@ NS_IMETHODIMP CUnknownContentTypeHandler::PromptForSaveToFileAsync(nsIHelperAppL { return NS_ERROR_NOT_IMPLEMENTED; } - +#if 0 // prompt the user for a file name to save the unknown content to as instructed NS_IMETHODIMP CUnknownContentTypeHandler::PromptForSaveToFile(nsIHelperAppLauncher *aLauncher, nsISupports *aWindowContext, const PRUnichar * aDefaultFile, const PRUnichar * aSuggestedFileExtension, bool aForcePrompt, nsIFile * *aNewFile) @@ -410,6 +410,7 @@ NS_IMETHODIMP #endif } +#endif CString CUnknownContentTypeHandler::GetTypeName() { @@ -549,7 +550,6 @@ be able to do some better stuff. We need an implementation that supports: NS_IMPL_ISUPPORTS(CProgressDialog, nsITransfer, nsIWebProgressListener2, nsIWebProgressListener, nsISupportsWeakReference) CProgressDialog::CProgressDialog(BOOL bAuto) { - NS_INIT_ISUPPORTS(); //mObserver = NULL; mCancelable = nullptr; @@ -1289,6 +1289,11 @@ NS_IMETHODIMP CProgressDialog::OnRefreshAttempted(nsIWebProgress *aWebProgress, return NS_ERROR_NOT_IMPLEMENTED; } +NS_IMETHODIMP CProgressDialog::SetRedirects(class nsIArray *) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + void CProgressDialog::OnOK() { // Prevent the window to close when hitting return diff --git a/k-meleon/app/UnknownContentTypeHandler.h b/k-meleon/app/UnknownContentTypeHandler.h index 61720a2e..ca54b559 100644 --- a/k-meleon/app/UnknownContentTypeHandler.h +++ b/k-meleon/app/UnknownContentTypeHandler.h @@ -53,6 +53,7 @@ protected: #include "resource.h" #include "nsITransfer.h" +class nsIWebBrowserPersist; class CProgressDialog : public CDialog, public nsITransfer, diff --git a/k-meleon/app/VisualStylesXP.h b/k-meleon/app/VisualStylesXP.h index 60912ead..6bc2977a 100644 --- a/k-meleon/app/VisualStylesXP.h +++ b/k-meleon/app/VisualStylesXP.h @@ -1,367 +1,367 @@ -#ifndef _VISUALSTYLE_XP_H_ -#define _VISUALSTYLE_XP_H_ - -#pragma once - -#include -#include -//#include - -class CVisualStylesXP -{ -private: - HMODULE m_hThemeDll; - void* GetProc(LPCSTR szProc, void* pfnFail); - - typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList); - static HTHEME OpenThemeDataFail(HWND , LPCWSTR ) - {return NULL;} - - typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme); - static HRESULT CloseThemeDataFail(HTHEME) - {return E_FAIL;} - - typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); - static HRESULT DrawThemeBackgroundFail(HTHEME, HDC, int, int, const RECT *, const RECT *) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, - DWORD dwTextFlags2, const RECT *pRect); - static HRESULT DrawThemeTextFail(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT*) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDCONTENTRECT)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pBoundingRect, - RECT *pContentRect); - static HRESULT GetThemeBackgroundContentRectFail(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pBoundingRect, - RECT *pContentRect) - {return E_FAIL;} - typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDEXTENT)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pContentRect, - RECT *pExtentRect); - static HRESULT GetThemeBackgroundExtentFail(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pContentRect, - RECT *pExtentRect) - {return E_FAIL;} - - typedef HRESULT(__stdcall *PFNGETTHEMEPARTSIZE)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz); - static HRESULT GetThemePartSizeFail(HTHEME, HDC, int, int, RECT *, enum THEMESIZE, SIZE *) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMETEXTEXTENT)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, - DWORD dwTextFlags, const RECT *pBoundingRect, - RECT *pExtentRect); - static HRESULT GetThemeTextExtentFail(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, - DWORD dwTextFlags, const RECT *pBoundingRect, - RECT *pExtentRect) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMETEXTMETRICS)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, TEXTMETRIC* ptm); - static HRESULT GetThemeTextMetricsFail(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, TEXTMETRIC* ptm) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDREGION)(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion); - static HRESULT GetThemeBackgroundRegionFail(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNHITTESTTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn, - POINT ptTest, WORD *pwHitTestCode); - static HRESULT HitTestThemeBackgroundFail(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn, - POINT ptTest, WORD *pwHitTestCode) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNDRAWTHEMEEDGE)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, - const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect); - static HRESULT DrawThemeEdgeFail(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, - const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNDRAWTHEMEICON)(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); - static HRESULT DrawThemeIconFail(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex) - {return E_FAIL;} - - typedef BOOL (__stdcall *PFNISTHEMEPARTDEFINED)(HTHEME hTheme, int iPartId, - int iStateId); - static BOOL IsThemePartDefinedFail(HTHEME hTheme, int iPartId, - int iStateId) - {return FALSE;} - - typedef BOOL (__stdcall *PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(HTHEME hTheme, - int iPartId, int iStateId); - static BOOL IsThemeBackgroundPartiallyTransparentFail(HTHEME hTheme, - int iPartId, int iStateId) - {return FALSE;} - - typedef HRESULT (__stdcall *PFNGETTHEMECOLOR)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, COLORREF *pColor); - static HRESULT GetThemeColorFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, COLORREF *pColor) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEMETRIC)(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, int *piVal); - static HRESULT GetThemeMetricFail(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, int *piVal) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMESTRING)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars); - static HRESULT GetThemeStringFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEBOOL)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, BOOL *pfVal); - static HRESULT GetThemeBoolFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, BOOL *pfVal) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEINT)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, int *piVal); - static HRESULT GetThemeIntFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, int *piVal) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEENUMVALUE)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, int *piVal); - static HRESULT GetThemeEnumValueFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, int *piVal) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEPOSITION)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, POINT *pPoint); - static HRESULT GetThemePositionFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, POINT *pPoint) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEFONT)(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, LOGFONT *pFont); - static HRESULT GetThemeFontFail(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, LOGFONT *pFont) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMERECT)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, RECT *pRect); - static HRESULT GetThemeRectFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, RECT *pRect) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEMARGINS)(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, RECT *prc, MARGINS *pMargins); - static HRESULT GetThemeMarginsFail(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, RECT *prc, MARGINS *pMargins) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEINTLIST)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, INTLIST *pIntList); - static HRESULT GetThemeIntListFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, INTLIST *pIntList) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEPROPERTYORIGIN)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin); - static HRESULT GetThemePropertyOriginFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNSETWINDOWTHEME)(HWND hwnd, LPCWSTR pszSubAppName, - LPCWSTR pszSubIdList); - static HRESULT SetWindowThemeFail(HWND hwnd, LPCWSTR pszSubAppName, - LPCWSTR pszSubIdList) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEFILENAME)(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars); - static HRESULT GetThemeFilenameFail(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars) - {return E_FAIL;} - - typedef COLORREF (__stdcall *PFNGETTHEMESYSCOLOR)(HTHEME hTheme, int iColorId); - static COLORREF GetThemeSysColorFail(HTHEME hTheme, int iColorId) - {return RGB(255,255,255);} - - typedef HBRUSH (__stdcall *PFNGETTHEMESYSCOLORBRUSH)(HTHEME hTheme, int iColorId); - static HBRUSH GetThemeSysColorBrushFail(HTHEME hTheme, int iColorId) - {return NULL;} - - typedef BOOL (__stdcall *PFNGETTHEMESYSBOOL)(HTHEME hTheme, int iBoolId); - static BOOL GetThemeSysBoolFail(HTHEME hTheme, int iBoolId) - {return FALSE;} - - typedef int (__stdcall *PFNGETTHEMESYSSIZE)(HTHEME hTheme, int iSizeId); - static int GetThemeSysSizeFail(HTHEME hTheme, int iSizeId) - {return 0;} - - typedef HRESULT (__stdcall *PFNGETTHEMESYSFONT)(HTHEME hTheme, int iFontId, LOGFONT *plf); - static HRESULT GetThemeSysFontFail(HTHEME hTheme, int iFontId, LOGFONT *plf) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMESYSSTRING)(HTHEME hTheme, int iStringId, - LPWSTR pszStringBuff, int cchMaxStringChars); - static HRESULT GetThemeSysStringFail(HTHEME hTheme, int iStringId, - LPWSTR pszStringBuff, int cchMaxStringChars) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMESYSINT)(HTHEME hTheme, int iIntId, int *piValue); - static HRESULT GetThemeSysIntFail(HTHEME hTheme, int iIntId, int *piValue) - {return E_FAIL;} - - typedef BOOL (__stdcall *PFNISTHEMEACTIVE)(); - static BOOL IsThemeActiveFail() - {return FALSE;} - - typedef BOOL(__stdcall *PFNISAPPTHEMED)(); - static BOOL IsAppThemedFail() - {return FALSE;} - - typedef HTHEME (__stdcall *PFNGETWINDOWTHEME)(HWND hwnd); - static HTHEME GetWindowThemeFail(HWND hwnd) - {return NULL;} - - typedef HRESULT (__stdcall *PFNENABLETHEMEDIALOGTEXTURE)(HWND hwnd, DWORD dwFlags); - static HRESULT EnableThemeDialogTextureFail(HWND hwnd, DWORD dwFlags) - {return E_FAIL;} - - typedef BOOL (__stdcall *PFNISTHEMEDIALOGTEXTUREENABLED)(HWND hwnd); - static BOOL IsThemeDialogTextureEnabledFail(HWND hwnd) - {return FALSE;} - - typedef DWORD (__stdcall *PFNGETTHEMEAPPPROPERTIES)(); - static DWORD GetThemeAppPropertiesFail() - {return 0;} - - typedef void (__stdcall *PFNSETTHEMEAPPPROPERTIES)(DWORD dwFlags); - static void SetThemeAppPropertiesFail(DWORD dwFlags) - {return;} - - typedef HRESULT (__stdcall *PFNGETCURRENTTHEMENAME)( - LPWSTR pszThemeFileName, int cchMaxNameChars, - LPWSTR pszColorBuff, int cchMaxColorChars, - LPWSTR pszSizeBuff, int cchMaxSizeChars); - static HRESULT GetCurrentThemeNameFail( - LPWSTR pszThemeFileName, int cchMaxNameChars, - LPWSTR pszColorBuff, int cchMaxColorChars, - LPWSTR pszSizeBuff, int cchMaxSizeChars) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNGETTHEMEDOCUMENTATIONPROPERTY)(LPCWSTR pszThemeName, - LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars); - static HRESULT GetThemeDocumentationPropertyFail(LPCWSTR pszThemeName, - LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hwnd, HDC hdc, RECT* prc); - static HRESULT DrawThemeParentBackgroundFail(HWND hwnd, HDC hdc, RECT* prc) - {return E_FAIL;} - - typedef HRESULT (__stdcall *PFNENABLETHEMING)(BOOL fEnable); - static HRESULT EnableThemingFail(BOOL fEnable) - {return E_FAIL;} -public: - HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList); - HRESULT CloseThemeData(HTHEME hTheme); - HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); - HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, - DWORD dwTextFlags2, const RECT *pRect); - HRESULT GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pBoundingRect, - RECT *pContentRect); - HRESULT GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pContentRect, - RECT *pExtentRect); - HRESULT GetThemePartSize(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz); - HRESULT GetThemeTextExtent(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, - DWORD dwTextFlags, const RECT *pBoundingRect, - RECT *pExtentRect); - HRESULT GetThemeTextMetrics(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, TEXTMETRIC* ptm); - HRESULT GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, - int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion); - HRESULT HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn, - POINT ptTest, WORD *pwHitTestCode); - HRESULT DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, - const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect); - HRESULT DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); - BOOL IsThemePartDefined(HTHEME hTheme, int iPartId, - int iStateId); - BOOL IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, - int iPartId, int iStateId); - HRESULT GetThemeColor(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, COLORREF *pColor); - HRESULT GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, int *piVal); - HRESULT GetThemeString(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars); - HRESULT GetThemeBool(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, BOOL *pfVal); - HRESULT GetThemeInt(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, int *piVal); - HRESULT GetThemeEnumValue(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, int *piVal); - HRESULT GetThemePosition(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, POINT *pPoint); - HRESULT GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, LOGFONT *pFont); - HRESULT GetThemeRect(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, RECT *pRect); - HRESULT GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, int iPropId, RECT *prc, MARGINS *pMargins); - HRESULT GetThemeIntList(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, INTLIST *pIntList); - HRESULT GetThemePropertyOrigin(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin); - HRESULT SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, - LPCWSTR pszSubIdList); - HRESULT GetThemeFilename(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars); - COLORREF GetThemeSysColor(HTHEME hTheme, int iColorId); - HBRUSH GetThemeSysColorBrush(HTHEME hTheme, int iColorId); - BOOL GetThemeSysBool(HTHEME hTheme, int iBoolId); - int GetThemeSysSize(HTHEME hTheme, int iSizeId); - HRESULT GetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONT *plf); - HRESULT GetThemeSysString(HTHEME hTheme, int iStringId, - LPWSTR pszStringBuff, int cchMaxStringChars); - HRESULT GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue); - BOOL IsThemeActive(); - BOOL IsAppThemed(); - HTHEME GetWindowTheme(HWND hwnd); - HRESULT EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags); - BOOL IsThemeDialogTextureEnabled(HWND hwnd); - DWORD GetThemeAppProperties(); - void SetThemeAppProperties(DWORD dwFlags); - HRESULT GetCurrentThemeName( - LPWSTR pszThemeFileName, int cchMaxNameChars, - LPWSTR pszColorBuff, int cchMaxColorChars, - LPWSTR pszSizeBuff, int cchMaxSizeChars); - HRESULT GetThemeDocumentationProperty(LPCWSTR pszThemeName, - LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars); - HRESULT DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc); - HRESULT EnableTheming(BOOL fEnable); -public: - CVisualStylesXP(void); - ~CVisualStylesXP(void); -}; - -extern CVisualStylesXP g_xpStyle; - -#endif +#ifndef _VISUALSTYLE_XP_H_ +#define _VISUALSTYLE_XP_H_ + +#pragma once + +#include +//#include +#include + +class CVisualStylesXP +{ +private: + HMODULE m_hThemeDll; + void* GetProc(LPCSTR szProc, void* pfnFail); + + typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList); + static HTHEME OpenThemeDataFail(HWND , LPCWSTR ) + {return NULL;} + + typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme); + static HRESULT CloseThemeDataFail(HTHEME) + {return E_FAIL;} + + typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); + static HRESULT DrawThemeBackgroundFail(HTHEME, HDC, int, int, const RECT *, const RECT *) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, + DWORD dwTextFlags2, const RECT *pRect); + static HRESULT DrawThemeTextFail(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT*) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDCONTENTRECT)(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pBoundingRect, + RECT *pContentRect); + static HRESULT GetThemeBackgroundContentRectFail(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pBoundingRect, + RECT *pContentRect) + {return E_FAIL;} + typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDEXTENT)(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pContentRect, + RECT *pExtentRect); + static HRESULT GetThemeBackgroundExtentFail(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pContentRect, + RECT *pExtentRect) + {return E_FAIL;} + + typedef HRESULT(__stdcall *PFNGETTHEMEPARTSIZE)(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz); + static HRESULT GetThemePartSizeFail(HTHEME, HDC, int, int, RECT *, enum THEMESIZE, SIZE *) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMETEXTEXTENT)(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, + DWORD dwTextFlags, const RECT *pBoundingRect, + RECT *pExtentRect); + static HRESULT GetThemeTextExtentFail(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, + DWORD dwTextFlags, const RECT *pBoundingRect, + RECT *pExtentRect) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMETEXTMETRICS)(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, TEXTMETRIC* ptm); + static HRESULT GetThemeTextMetricsFail(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, TEXTMETRIC* ptm) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDREGION)(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion); + static HRESULT GetThemeBackgroundRegionFail(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNHITTESTTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn, + POINT ptTest, WORD *pwHitTestCode); + static HRESULT HitTestThemeBackgroundFail(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn, + POINT ptTest, WORD *pwHitTestCode) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNDRAWTHEMEEDGE)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, + const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect); + static HRESULT DrawThemeEdgeFail(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, + const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNDRAWTHEMEICON)(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); + static HRESULT DrawThemeIconFail(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex) + {return E_FAIL;} + + typedef BOOL (__stdcall *PFNISTHEMEPARTDEFINED)(HTHEME hTheme, int iPartId, + int iStateId); + static BOOL IsThemePartDefinedFail(HTHEME hTheme, int iPartId, + int iStateId) + {return FALSE;} + + typedef BOOL (__stdcall *PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(HTHEME hTheme, + int iPartId, int iStateId); + static BOOL IsThemeBackgroundPartiallyTransparentFail(HTHEME hTheme, + int iPartId, int iStateId) + {return FALSE;} + + typedef HRESULT (__stdcall *PFNGETTHEMECOLOR)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, COLORREF *pColor); + static HRESULT GetThemeColorFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, COLORREF *pColor) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEMETRIC)(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, int *piVal); + static HRESULT GetThemeMetricFail(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, int *piVal) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMESTRING)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars); + static HRESULT GetThemeStringFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEBOOL)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, BOOL *pfVal); + static HRESULT GetThemeBoolFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, BOOL *pfVal) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEINT)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, int *piVal); + static HRESULT GetThemeIntFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, int *piVal) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEENUMVALUE)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, int *piVal); + static HRESULT GetThemeEnumValueFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, int *piVal) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEPOSITION)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, POINT *pPoint); + static HRESULT GetThemePositionFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, POINT *pPoint) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEFONT)(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, LOGFONT *pFont); + static HRESULT GetThemeFontFail(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, LOGFONT *pFont) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMERECT)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, RECT *pRect); + static HRESULT GetThemeRectFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, RECT *pRect) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEMARGINS)(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, RECT *prc, MARGINS *pMargins); + static HRESULT GetThemeMarginsFail(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, RECT *prc, MARGINS *pMargins) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEINTLIST)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, INTLIST *pIntList); + static HRESULT GetThemeIntListFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, INTLIST *pIntList) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEPROPERTYORIGIN)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin); + static HRESULT GetThemePropertyOriginFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNSETWINDOWTHEME)(HWND hwnd, LPCWSTR pszSubAppName, + LPCWSTR pszSubIdList); + static HRESULT SetWindowThemeFail(HWND hwnd, LPCWSTR pszSubAppName, + LPCWSTR pszSubIdList) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEFILENAME)(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars); + static HRESULT GetThemeFilenameFail(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars) + {return E_FAIL;} + + typedef COLORREF (__stdcall *PFNGETTHEMESYSCOLOR)(HTHEME hTheme, int iColorId); + static COLORREF GetThemeSysColorFail(HTHEME hTheme, int iColorId) + {return RGB(255,255,255);} + + typedef HBRUSH (__stdcall *PFNGETTHEMESYSCOLORBRUSH)(HTHEME hTheme, int iColorId); + static HBRUSH GetThemeSysColorBrushFail(HTHEME hTheme, int iColorId) + {return NULL;} + + typedef BOOL (__stdcall *PFNGETTHEMESYSBOOL)(HTHEME hTheme, int iBoolId); + static BOOL GetThemeSysBoolFail(HTHEME hTheme, int iBoolId) + {return FALSE;} + + typedef int (__stdcall *PFNGETTHEMESYSSIZE)(HTHEME hTheme, int iSizeId); + static int GetThemeSysSizeFail(HTHEME hTheme, int iSizeId) + {return 0;} + + typedef HRESULT (__stdcall *PFNGETTHEMESYSFONT)(HTHEME hTheme, int iFontId, LOGFONT *plf); + static HRESULT GetThemeSysFontFail(HTHEME hTheme, int iFontId, LOGFONT *plf) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMESYSSTRING)(HTHEME hTheme, int iStringId, + LPWSTR pszStringBuff, int cchMaxStringChars); + static HRESULT GetThemeSysStringFail(HTHEME hTheme, int iStringId, + LPWSTR pszStringBuff, int cchMaxStringChars) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMESYSINT)(HTHEME hTheme, int iIntId, int *piValue); + static HRESULT GetThemeSysIntFail(HTHEME hTheme, int iIntId, int *piValue) + {return E_FAIL;} + + typedef BOOL (__stdcall *PFNISTHEMEACTIVE)(); + static BOOL IsThemeActiveFail() + {return FALSE;} + + typedef BOOL(__stdcall *PFNISAPPTHEMED)(); + static BOOL IsAppThemedFail() + {return FALSE;} + + typedef HTHEME (__stdcall *PFNGETWINDOWTHEME)(HWND hwnd); + static HTHEME GetWindowThemeFail(HWND hwnd) + {return NULL;} + + typedef HRESULT (__stdcall *PFNENABLETHEMEDIALOGTEXTURE)(HWND hwnd, DWORD dwFlags); + static HRESULT EnableThemeDialogTextureFail(HWND hwnd, DWORD dwFlags) + {return E_FAIL;} + + typedef BOOL (__stdcall *PFNISTHEMEDIALOGTEXTUREENABLED)(HWND hwnd); + static BOOL IsThemeDialogTextureEnabledFail(HWND hwnd) + {return FALSE;} + + typedef DWORD (__stdcall *PFNGETTHEMEAPPPROPERTIES)(); + static DWORD GetThemeAppPropertiesFail() + {return 0;} + + typedef void (__stdcall *PFNSETTHEMEAPPPROPERTIES)(DWORD dwFlags); + static void SetThemeAppPropertiesFail(DWORD dwFlags) + {return;} + + typedef HRESULT (__stdcall *PFNGETCURRENTTHEMENAME)( + LPWSTR pszThemeFileName, int cchMaxNameChars, + LPWSTR pszColorBuff, int cchMaxColorChars, + LPWSTR pszSizeBuff, int cchMaxSizeChars); + static HRESULT GetCurrentThemeNameFail( + LPWSTR pszThemeFileName, int cchMaxNameChars, + LPWSTR pszColorBuff, int cchMaxColorChars, + LPWSTR pszSizeBuff, int cchMaxSizeChars) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNGETTHEMEDOCUMENTATIONPROPERTY)(LPCWSTR pszThemeName, + LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars); + static HRESULT GetThemeDocumentationPropertyFail(LPCWSTR pszThemeName, + LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hwnd, HDC hdc, RECT* prc); + static HRESULT DrawThemeParentBackgroundFail(HWND hwnd, HDC hdc, RECT* prc) + {return E_FAIL;} + + typedef HRESULT (__stdcall *PFNENABLETHEMING)(BOOL fEnable); + static HRESULT EnableThemingFail(BOOL fEnable) + {return E_FAIL;} +public: + HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList); + HRESULT CloseThemeData(HTHEME hTheme); + HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); + HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, + DWORD dwTextFlags2, const RECT *pRect); + HRESULT GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pBoundingRect, + RECT *pContentRect); + HRESULT GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pContentRect, + RECT *pExtentRect); + HRESULT GetThemePartSize(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz); + HRESULT GetThemeTextExtent(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, + DWORD dwTextFlags, const RECT *pBoundingRect, + RECT *pExtentRect); + HRESULT GetThemeTextMetrics(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, TEXTMETRIC* ptm); + HRESULT GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, + int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion); + HRESULT HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn, + POINT ptTest, WORD *pwHitTestCode); + HRESULT DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, + const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect); + HRESULT DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); + BOOL IsThemePartDefined(HTHEME hTheme, int iPartId, + int iStateId); + BOOL IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, + int iPartId, int iStateId); + HRESULT GetThemeColor(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, COLORREF *pColor); + HRESULT GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, int *piVal); + HRESULT GetThemeString(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars); + HRESULT GetThemeBool(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, BOOL *pfVal); + HRESULT GetThemeInt(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, int *piVal); + HRESULT GetThemeEnumValue(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, int *piVal); + HRESULT GetThemePosition(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, POINT *pPoint); + HRESULT GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, LOGFONT *pFont); + HRESULT GetThemeRect(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, RECT *pRect); + HRESULT GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, int iPropId, RECT *prc, MARGINS *pMargins); + HRESULT GetThemeIntList(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, INTLIST *pIntList); + HRESULT GetThemePropertyOrigin(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin); + HRESULT SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, + LPCWSTR pszSubIdList); + HRESULT GetThemeFilename(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars); + COLORREF GetThemeSysColor(HTHEME hTheme, int iColorId); + HBRUSH GetThemeSysColorBrush(HTHEME hTheme, int iColorId); + BOOL GetThemeSysBool(HTHEME hTheme, int iBoolId); + int GetThemeSysSize(HTHEME hTheme, int iSizeId); + HRESULT GetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONT *plf); + HRESULT GetThemeSysString(HTHEME hTheme, int iStringId, + LPWSTR pszStringBuff, int cchMaxStringChars); + HRESULT GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue); + BOOL IsThemeActive(); + BOOL IsAppThemed(); + HTHEME GetWindowTheme(HWND hwnd); + HRESULT EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags); + BOOL IsThemeDialogTextureEnabled(HWND hwnd); + DWORD GetThemeAppProperties(); + void SetThemeAppProperties(DWORD dwFlags); + HRESULT GetCurrentThemeName( + LPWSTR pszThemeFileName, int cchMaxNameChars, + LPWSTR pszColorBuff, int cchMaxColorChars, + LPWSTR pszSizeBuff, int cchMaxSizeChars); + HRESULT GetThemeDocumentationProperty(LPCWSTR pszThemeName, + LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars); + HRESULT DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc); + HRESULT EnableTheming(BOOL fEnable); +public: + CVisualStylesXP(void); + ~CVisualStylesXP(void); +}; + +extern CVisualStylesXP g_xpStyle; + +#endif diff --git a/k-meleon/kplugins/bmpmenu/bmpmenu.vcxproj b/k-meleon/kplugins/bmpmenu/bmpmenu.vcxproj index 2b0c87ef..d0770146 100644 --- a/k-meleon/kplugins/bmpmenu/bmpmenu.vcxproj +++ b/k-meleon/kplugins/bmpmenu/bmpmenu.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,12 +20,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/bookmarks/bookmarks.vcxproj b/k-meleon/kplugins/bookmarks/bookmarks.vcxproj index f7ef9dd2..12088e3f 100644 --- a/k-meleon/kplugins/bookmarks/bookmarks.vcxproj +++ b/k-meleon/kplugins/bookmarks/bookmarks.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -36,12 +36,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/favorites/favorites.vcxproj b/k-meleon/kplugins/favorites/favorites.vcxproj index a082f1f1..77c394e9 100644 --- a/k-meleon/kplugins/favorites/favorites.vcxproj +++ b/k-meleon/kplugins/favorites/favorites.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -39,12 +39,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/fullscreen/fullscreen.vcxproj b/k-meleon/kplugins/fullscreen/fullscreen.vcxproj index c1ae2a18..2a6cf4a8 100644 --- a/k-meleon/kplugins/fullscreen/fullscreen.vcxproj +++ b/k-meleon/kplugins/fullscreen/fullscreen.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -33,12 +33,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 @@ -76,7 +78,7 @@ $(IntDir)$(TargetName).pdb $(IntDir)$(TargetName).lib ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) - xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + nss3.lib;mozjs.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -100,7 +102,7 @@ $(IntDir)$(TargetName).pdb $(IntDir)$(TargetName).lib ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) - xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + nss3.lib;mozjs.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/k-meleon/kplugins/gestures/gestures.vcxproj b/k-meleon/kplugins/gestures/gestures.vcxproj index 1e493d15..01e05bf9 100644 --- a/k-meleon/kplugins/gestures/gestures.vcxproj +++ b/k-meleon/kplugins/gestures/gestures.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -23,12 +23,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/hotlist/hotlist.vcxproj b/k-meleon/kplugins/hotlist/hotlist.vcxproj index 42789d4c..c853c806 100644 --- a/k-meleon/kplugins/hotlist/hotlist.vcxproj +++ b/k-meleon/kplugins/hotlist/hotlist.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -33,12 +33,14 @@ DynamicLibrary true MultiByte + v120 DynamicLibrary false true MultiByte + v120 diff --git a/k-meleon/kplugins/jsbridge/JSBridge.vcxproj b/k-meleon/kplugins/jsbridge/JSBridge.vcxproj index 900956a2..42c897a4 100644 --- a/k-meleon/kplugins/jsbridge/JSBridge.vcxproj +++ b/k-meleon/kplugins/jsbridge/JSBridge.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,12 +25,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/jsbridge/jscomp.cpp b/k-meleon/kplugins/jsbridge/jscomp.cpp index 85149fb4..676d9df4 100644 --- a/k-meleon/kplugins/jsbridge/jscomp.cpp +++ b/k-meleon/kplugins/jsbridge/jscomp.cpp @@ -4,6 +4,14 @@ #include #include #include + +#define MOZILLA_STRICT_API +#define XPCOM_GLUE +#include +#include +#include +#include +#include #include #include #include @@ -11,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/k-meleon/kplugins/jsbridge/jscomp.h b/k-meleon/kplugins/jsbridge/jscomp.h index db04ce6b..ed558e8a 100644 --- a/k-meleon/kplugins/jsbridge/jscomp.h +++ b/k-meleon/kplugins/jsbridge/jscomp.h @@ -1,15 +1,9 @@ -#define MOZILLA_STRICT_API -#define XPCOM_GLUE -#include "xpcom-config.h" -#include -#include -#include #include "nsIJSBridge.h" -#include "nsIObserver.h" #include "nsEmbedString.h" #include "nsCOMArray.h" #include #include +class nsIObserver; #define JSBRIDGE_CID { 0x842170a0, 0x5210, 0x11db, { 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66}} static NS_DEFINE_CID(kJSBridgeCID, JSBRIDGE_CID); diff --git a/k-meleon/kplugins/jsbridge/jsplugin.cpp b/k-meleon/kplugins/jsbridge/jsplugin.cpp index aef8c8f4..9a27a317 100644 --- a/k-meleon/kplugins/jsbridge/jsplugin.cpp +++ b/k-meleon/kplugins/jsbridge/jsplugin.cpp @@ -59,7 +59,7 @@ static const nsModuleComponentInfo components = }; static nsCOMPtr componentFactory; -extern NS_COM_GLUE nsresult NS_NewGenericFactory(nsIGenericFactory* *result, +extern nsresult NS_NewGenericFactory(nsIGenericFactory* *result, const nsModuleComponentInfo *info); int Load() diff --git a/k-meleon/kplugins/jsbridge/nsGenericFactory.cpp b/k-meleon/kplugins/jsbridge/nsGenericFactory.cpp index 0ea145d5..89d6316d 100644 --- a/k-meleon/kplugins/jsbridge/nsGenericFactory.cpp +++ b/k-meleon/kplugins/jsbridge/nsGenericFactory.cpp @@ -187,7 +187,7 @@ NS_METHOD nsGenericFactory::Create(nsISupports* outer, const nsIID& aIID, void* } -NS_COM_GLUE nsresult +nsresult NS_NewGenericFactory(nsIGenericFactory* *result, const nsModuleComponentInfo *info) { diff --git a/k-meleon/kplugins/login/login.vcxproj b/k-meleon/kplugins/login/login.vcxproj index 6f43fb17..5b4140e2 100644 --- a/k-meleon/kplugins/login/login.vcxproj +++ b/k-meleon/kplugins/login/login.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,12 +25,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/login/mozilla.cpp b/k-meleon/kplugins/login/mozilla.cpp index 0dd771b3..cfb01d3c 100644 --- a/k-meleon/kplugins/login/mozilla.cpp +++ b/k-meleon/kplugins/login/mozilla.cpp @@ -35,7 +35,6 @@ #include "nsIInterfaceRequestorUtils.h" #include "nsIWebNavigation.h" #include "utf.h" -#include "nsIMarkupDocumentViewer.h" #include "nsIWebBrowserFocus.h" nsresult NewURI(nsIURI **result, const nsACString &spec) @@ -183,17 +182,14 @@ NS_IMETHODIMP AutocompletePopup::OpenAutocompletePopup(nsIAutoCompleteInput *inp rv = docShell->GetContentViewer(getter_AddRefs(contentViewer)); NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr markupViewer = do_QueryInterface(contentViewer, &rv); - NS_ENSURE_SUCCESS(rv, rv); - // Calc height of the list int lineHeight = ::SendMessage(hList, LB_GETITEMHEIGHT, 0, 0L); int height = nLine > mNbLine ? (mNbLine+1)*lineHeight : lineHeight*(nLine+1); // Match the font size with the zoom float zoom, fzoom; - markupViewer->GetTextZoom(&zoom); - markupViewer->GetFullZoom(&fzoom); + contentViewer->GetTextZoom(&zoom); + contentViewer->GetFullZoom(&fzoom); zoom *= fzoom; if (zoom != mZoom) { @@ -272,7 +268,7 @@ NS_IMETHODIMP AutocompletePopup::Invalidate() mInput->GetController(getter_AddRefs(controller)); controller->GetMatchCount(&nLine); - for (int i=0;iGetLabelAt(i, line); ::SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)line.get()); diff --git a/k-meleon/kplugins/login/mozilla.h b/k-meleon/kplugins/login/mozilla.h index cfeabebd..8718cbf8 100644 --- a/k-meleon/kplugins/login/mozilla.h +++ b/k-meleon/kplugins/login/mozilla.h @@ -20,7 +20,7 @@ #define MOZILLA_STRICT_API #include -#include "stdafx.h" + #include "nsCOMPtr.h" #include "nsIWebBrowser.h" #include "nsIDOMEventTarget.h" @@ -131,7 +131,7 @@ public: { } - BOOL Init(HWND hwnd) + bool Init(HWND hwnd) { if (!kPlugin.kFuncs->GetMozillaWebBrowser(hwnd, getter_AddRefs(mWebBrowser))) @@ -147,16 +147,16 @@ public: nsCOMPtr domWin; mWebBrowser->GetContentDOMWindow (getter_AddRefs(domWin)); - NS_ENSURE_TRUE (domWin, NS_ERROR_FAILURE); + NS_ENSURE_TRUE(domWin, false); // Prevent crash in embed component if the browser was closed nsCOMPtr doc; domWin->GetDocument(getter_AddRefs(doc)); - NS_ENSURE_TRUE (doc, NS_ERROR_FAILURE); + NS_ENSURE_TRUE(doc, false); nsCOMPtr target; domWin->GetWindowRoot (getter_AddRefs(target)); - NS_ENSURE_TRUE (target, NS_ERROR_FAILURE); + NS_ENSURE_TRUE(target, false); nsCOMPtr piWin(do_QueryInterface(domWin)); if (!piWin) return NULL; diff --git a/k-meleon/kplugins/macros2/macros.vcxproj b/k-meleon/kplugins/macros2/macros.vcxproj index e6078b61..9055b9fd 100644 --- a/k-meleon/kplugins/macros2/macros.vcxproj +++ b/k-meleon/kplugins/macros2/macros.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,12 +20,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/privacy/privacy.vcxproj b/k-meleon/kplugins/privacy/privacy.vcxproj index 2d7eedcd..43e7c4f0 100644 --- a/k-meleon/kplugins/privacy/privacy.vcxproj +++ b/k-meleon/kplugins/privacy/privacy.vcxproj @@ -1,100 +1,102 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - {F80DCDF9-D001-47F7-97D5-26EF62BF91AF} - Win32Proj - privacy - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - - - - - - - - - - - true - $(SolutionDir)..\$(Configuration)\kplugins\ - $(SolutionDir)..\_$(Configuration)\kmeleon\kplugins\$(ProjectName)\ - - - false - $(SolutionDir)..\$(Configuration)\kplugins\ - $(SolutionDir)..\_$(Configuration)\kmeleon\kplugins\$(ProjectName)\ - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - ..\..\..\xulrunner-sdk\include\nspr;..\..\..\xulrunner-sdk\include;..\..\shared;%(AdditionalIncludeDirectories) - - - Windows - true - true - $(IntDir)$(TargetName).pdb - $(IntDir)$(TargetName).lib - ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) - xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - Level3 - - - MinSpace - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - ..\..\..\xulrunner-sdk\include\nspr;..\..\..\xulrunner-sdk\include;..\..\shared;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - true - $(IntDir)$(TargetName).pdb - $(IntDir)$(TargetName).lib - ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) - xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + {F80DCDF9-D001-47F7-97D5-26EF62BF91AF} + Win32Proj + privacy + + + + DynamicLibrary + true + Unicode + v120 + + + DynamicLibrary + false + true + Unicode + v120 + + + + + + + + + + + + + true + $(SolutionDir)..\$(Configuration)\kplugins\ + $(SolutionDir)..\_$(Configuration)\kmeleon\kplugins\$(ProjectName)\ + + + false + $(SolutionDir)..\$(Configuration)\kplugins\ + $(SolutionDir)..\_$(Configuration)\kmeleon\kplugins\$(ProjectName)\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + ..\..\..\xulrunner-sdk\include\nspr;..\..\..\xulrunner-sdk\include;..\..\shared;%(AdditionalIncludeDirectories) + + + Windows + true + true + $(IntDir)$(TargetName).pdb + $(IntDir)$(TargetName).lib + ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) + mozjs.lib;nss3.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + + + MinSpace + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + ..\..\..\xulrunner-sdk\include\nspr;..\..\..\xulrunner-sdk\include;..\..\shared;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + true + $(IntDir)$(TargetName).pdb + $(IntDir)$(TargetName).lib + ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) + mozjs.lib;nss3.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + \ No newline at end of file diff --git a/k-meleon/kplugins/rebar_menu/rebarmenu.vcxproj b/k-meleon/kplugins/rebar_menu/rebarmenu.vcxproj index ddd9b6a1..922e5cb6 100644 --- a/k-meleon/kplugins/rebar_menu/rebarmenu.vcxproj +++ b/k-meleon/kplugins/rebar_menu/rebarmenu.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,12 +20,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/sessions/sessions.vcxproj b/k-meleon/kplugins/sessions/sessions.vcxproj index 710fce7f..e76bf6e3 100644 --- a/k-meleon/kplugins/sessions/sessions.vcxproj +++ b/k-meleon/kplugins/sessions/sessions.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,12 +20,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/kplugins/spellcheck/spellcheck.cpp b/k-meleon/kplugins/spellcheck/spellcheck.cpp index 0d4702ff..ba0ddedf 100644 --- a/k-meleon/kplugins/spellcheck/spellcheck.cpp +++ b/k-meleon/kplugins/spellcheck/spellcheck.cpp @@ -16,6 +16,8 @@ #define XPCOM_GLUE #include "xpcom-config.h" #include +#include +#include #include #include #include @@ -29,8 +31,7 @@ #include #include #include -#include -#include + #include #include "nsIDOMDocument.h" #include "nsIDocShell.h" @@ -47,6 +48,9 @@ #include #include +#include "mozilla/fallible.h" +#include "mozilla/a11y/Accessible.h" + #include @@ -653,7 +657,6 @@ int message_box(HWND hwnd, LPCSTR lpText, LPCSTR lpTitle, UINT style) return MessageBoxA(hwnd, kPlugin.kFuncs->Translate(lpText), kPlugin.kFuncs->Translate(lpTitle), style); } - /* Get screen position of a word by accesibility API provided mozilla and windows . @@ -672,9 +675,11 @@ BOOL get_word_pos(HWND hwnd, nsCOMPtr& node, PRInt32 offset, int& rx // below code is related with Microsoft Active Accessibility + mozilla::a11y::Accessible* acc = accessible->ToInternalAccessible(); + // This is MS COM component, isn't XPCOM. IAccessible* pAccessible = NULL; - rv = accessible->GetNativeInterface((void**) &pAccessible); + acc->GetNativeInterface((void**) &pAccessible); NS_ENSURE_SUCCESS(rv, FALSE); NS_ENSURE_TRUE(pAccessible, FALSE); diff --git a/k-meleon/kplugins/spellcheck/spellcheck.vcxproj b/k-meleon/kplugins/spellcheck/spellcheck.vcxproj index d49514e2..8b398023 100644 --- a/k-meleon/kplugins/spellcheck/spellcheck.vcxproj +++ b/k-meleon/kplugins/spellcheck/spellcheck.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -24,12 +24,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 @@ -67,7 +69,7 @@ $(IntDir)$(TargetName).pdb $(IntDir)$(TargetName).lib ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) - nss3.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + nss3.lib;mozjs.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -91,7 +93,7 @@ $(IntDir)$(TargetName).pdb $(IntDir)$(TargetName).lib ..\..\..\xulrunner-sdk\lib_$(Configuration);%(AdditionalLibraryDirectories) - nss3.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + nss3.lib;mozjs.lib;xul.lib;mozalloc.lib;xpcomglue_s.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/k-meleon/kplugins/toolbars/toolbars.vcxproj b/k-meleon/kplugins/toolbars/toolbars.vcxproj index 211c4749..b8c927c1 100644 --- a/k-meleon/kplugins/toolbars/toolbars.vcxproj +++ b/k-meleon/kplugins/toolbars/toolbars.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,12 +20,14 @@ DynamicLibrary true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/k-meleon/mozilla.patch b/k-meleon/mozilla.patch index a7bcd5a8..5798ed1c 100644 --- a/k-meleon/mozilla.patch +++ b/k-meleon/mozilla.patch @@ -1,144 +1,256 @@ -diff --git a/build/autoconf/ffi.m4 b/build/autoconf/ffi.m4 ---- a/build/autoconf/ffi.m4 -+++ b/build/autoconf/ffi.m4 -@@ -48,17 +48,20 @@ if test -z "$BUILDING_JS" -o -n "$JS_STA - CFLAGS= - ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe" - case "${target_cpu}" in - x86_64) - # Need target since MSYS tools into mozilla-build may be 32bit - ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\"" - ;; - *) -- ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh" -+ ac_configure_args="$ac_configure_args \ -+ CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh\" \ -+ CFLAGS=\"-O1 -GL-\" \ -+ CXXFLAGS=\"-O1 -GL-\"" - ;; - esac - fi - if test "$SOLARIS_SUNPRO_CC"; then - # Always use gcc for libffi on Solaris - if test ! "$HAVE_64BIT_OS"; then - ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m32 LD= LDFLAGS=" - else -diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp ---- a/caps/src/nsScriptSecurityManager.cpp -+++ b/caps/src/nsScriptSecurityManager.cpp -@@ -1162,17 +1162,17 @@ nsScriptSecurityManager::GetSubjectPrinc - nsresult* rv) - { - *rv = NS_OK; - JSCompartment *compartment = js::GetContextCompartment(cx); - - // The context should always be in a compartment, either one it has entered - // or the one associated with its global. - MOZ_ASSERT(!!compartment); -- -+ if (!compartment) return nullptr; - JSPrincipals *principals = JS_GetCompartmentPrincipals(compartment); - return nsJSPrincipals::get(principals); - } +diff --git a/Makefile.in b/Makefile.in +--- a/Makefile.in ++++ b/Makefile.in +@@ -322,8 +322,11 @@ source-package install: + # Every export rule depends on config/export, but the rule for config/export + # doesn't exist when building js non-standalone. + .PHONY: config/export + config/export: - // static - nsIPrincipal* - nsScriptSecurityManager::doGetObjectPrincipal(JSObject *aObj) - { -diff --git a/client.mk b/client.mk ---- a/client.mk -+++ b/client.mk -@@ -293,17 +293,17 @@ EXTRA_CONFIG_DEPS := \ - cd $(@D); $(AUTOCONF) - - CONFIG_STATUS_DEPS := \ - $(wildcard $(TOPSRCDIR)/*/confvars.sh) \ - $(CONFIGURES) \ - $(TOPSRCDIR)/CLOBBER \ - $(TOPSRCDIR)/nsprpub/configure \ - $(TOPSRCDIR)/config/milestone.txt \ -- $(TOPSRCDIR)/browser/config/version.txt \ -+ $(TOPSRCDIR)/kmeleon/config/version.txt \ - $(TOPSRCDIR)/build/virtualenv_packages.txt \ - $(TOPSRCDIR)/python/mozbuild/mozbuild/virtualenv.py \ - $(TOPSRCDIR)/testing/mozbase/packages.txt \ - $(OBJDIR)/.mozconfig.json \ - $(NULL) - - CONFIGURE_ENV_ARGS += \ - MAKE='$(MAKE)' \ -diff --git a/config/config.mk b/config/config.mk ---- a/config/config.mk -+++ b/config/config.mk -@@ -372,22 +372,18 @@ endif endif - ifndef STATIC_LIBRARY_NAME - ifdef LIBRARY_NAME - STATIC_LIBRARY_NAME=$(LIBRARY_NAME) - endif - endif + # There used to be build interdependencies here. They are now in config/recurse.mk ++ ++pgo-profile-run: ++ $(PYTHON) $(topsrcdir)/build/pgo/profileserver.py $(EXTRA_TEST_ARGS) +diff --git a/browser/components/build/moz.build b/browser/components/build/moz.build +--- a/browser/components/build/moz.build ++++ b/browser/components/build/moz.build +@@ -17,16 +17,21 @@ XPCOMBinaryComponent('browsercomps') + LOCAL_INCLUDES += [ + '../about', + '../dirprovider', + '../feeds', + '../migration', + '../shell', + ] --# PGO on MSVC is opt-in --ifdef _MSC_VER --ifndef MSVC_ENABLE_PGO --NO_PROFILE_GUIDED_OPTIMIZE = 1 --endif --endif ++if CONFIG['JS_SHARED_LIBRARY']: ++ USE_LIBS += [ ++ 'js', ++ ] + -+NO_PROFILE_GUIDED_OPTIMIZE = 0 + if CONFIG['OS_ARCH'] == 'WINNT': + OS_LIBS += [ + 'ole32', + 'shell32', + 'shlwapi', + 'version', + ] - # No sense in profiling tools - ifdef INTERNAL_TOOLS - NO_PROFILE_GUIDED_OPTIMIZE = 1 - endif +diff --git a/browser/confvars.sh b/browser/confvars.sh +--- a/browser/confvars.sh ++++ b/browser/confvars.sh +@@ -19,24 +19,24 @@ if test "$OS_ARCH" = "WINNT"; then + if ! test "$MOZ_DEBUG"; then + MOZ_STUB_INSTALLER=1 + fi + fi + fi + fi + + MOZ_CHROME_FILE_FORMAT=omni +-MOZ_DISABLE_EXPORT_JS=1 +-MOZ_SAFE_BROWSING=1 ++MOZ_DISABLE_EXPORT_JS= ++MOZ_SAFE_BROWSING= + MOZ_SERVICES_COMMON=1 + MOZ_SERVICES_CRYPTO=1 +-MOZ_SERVICES_HEALTHREPORT=1 +-MOZ_SERVICES_METRICS=1 +-MOZ_SERVICES_SYNC=1 +-MOZ_SERVICES_CLOUDSYNC=1 ++MOZ_SERVICES_HEALTHREPORT= ++MOZ_SERVICES_METRICS= ++MOZ_SERVICES_SYNC= ++MOZ_SERVICES_CLOUDSYNC= + MOZ_APP_VERSION=$FIREFOX_VERSION + MOZ_EXTENSIONS_DEFAULT=" gio" + # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh + # Changing MOZ_*BRANDING_DIRECTORY requires a clobber to ensure correct results, + # because branding dependencies are broken. + # MOZ_BRANDING_DIRECTORY is the default branding directory used when none is + # specified. It should never point to the "official" branding directory. + # For mozilla-beta, mozilla-release, or mozilla-central repositories, use +@@ -52,13 +52,13 @@ ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla + # The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t " + MAR_CHANNEL_ID=firefox-mozilla-esr + MOZ_PROFILE_MIGRATOR=1 + MOZ_APP_STATIC_INI=1 + MOZ_WEBAPP_RUNTIME=1 + MOZ_MEDIA_NAVIGATOR=1 + MOZ_WEBGL_CONFORMANT=1 + # Enable navigator.mozPay +-MOZ_PAY=1 ++MOZ_PAY= + # Enable activities. These are used for FxOS developers currently. + MOZ_ACTIVITIES=1 + MOZ_JSDOWNLOADS=1 + MOZ_WEBM_ENCODER=1 +diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in +--- a/browser/installer/package-manifest.in ++++ b/browser/installer/package-manifest.in +@@ -238,17 +238,19 @@ + #endif + @RESPATH@/components/dom_workers.xpt + @RESPATH@/components/dom_xbl.xpt + @RESPATH@/components/dom_xpath.xpt + @RESPATH@/components/dom_xul.xpt + #ifdef MOZ_GAMEPAD + @RESPATH@/components/dom_gamepad.xpt + #endif ++#ifdef MOZ_PAY + @RESPATH@/components/dom_payment.xpt ++#endif + @RESPATH@/components/dom_presentation.xpt + @RESPATH@/components/downloads.xpt + @RESPATH@/components/editor.xpt + @RESPATH@/components/embed_base.xpt + @RESPATH@/components/extensions.xpt + @RESPATH@/components/exthandler.xpt + @RESPATH@/components/exthelper.xpt + @RESPATH@/components/fastfind.xpt +@@ -584,21 +586,21 @@ + @RESPATH@/components/SystemMessageManager.manifest + + @RESPATH@/components/Activities.manifest + @RESPATH@/components/ActivityProxy.js + @RESPATH@/components/ActivityRequestHandler.js + @RESPATH@/components/ActivityWrapper.js + @RESPATH@/components/ActivityMessageConfigurator.js + #endif +- ++#ifdef MOZ_PAY + @RESPATH@/components/Payment.js + @RESPATH@/components/PaymentFlowInfo.js + @RESPATH@/components/Payment.manifest +- ++#endif + #ifdef MOZ_WEBRTC + @RESPATH@/components/PeerConnection.js + @RESPATH@/components/PeerConnection.manifest + #endif - # Don't build SIMPLE_PROGRAMS with PGO, since they don't need it anyway, - # and we don't have the same build logic to re-link them in the second pass. -@@ -397,33 +393,26 @@ endif + @RESPATH@/chrome/marionette@JAREXT@ + @RESPATH@/chrome/marionette.manifest + @RESPATH@/components/MarionetteComponents.manifest +@@ -614,18 +616,18 @@ + @RESPATH@/components/PresentationDeviceInfoManager.manifest + @RESPATH@/components/PresentationDeviceInfoManager.js + + ; InputMethod API + @RESPATH@/components/MozKeyboard.js + @RESPATH@/components/InputMethod.manifest + + #ifdef MOZ_DEBUG +-@RESPATH@/components/TestInterfaceJS.js +-@RESPATH@/components/TestInterfaceJS.manifest ++#@RESPATH@/components/TestInterfaceJS.js ++#@RESPATH@/components/TestInterfaceJS.manifest + #endif - # No sense in profiling unit tests - ifdef CPP_UNIT_TESTS - NO_PROFILE_GUIDED_OPTIMIZE = 1 + ; Modules + @RESPATH@/browser/modules/* + @RESPATH@/modules/* + + ; Safe Browsing + #ifdef MOZ_URL_CLASSIFIER +diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in +--- a/browser/locales/Makefile.in ++++ b/browser/locales/Makefile.in +@@ -126,17 +126,19 @@ libs:: $(addprefix generic/profile/,$(PR + $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile + + libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME))) + $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome + + libs-%: + $(NSINSTALL) -D $(DIST)/install + @$(MAKE) -C ../../toolkit/locales libs-$* ++ifdef MOZ_SERVICE_SYNC + @$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$* ++endif + ifdef MOZ_WEBAPP_RUNTIME + @$(MAKE) -C ../../webapprt/locales AB_CD=$* XPI_NAME=locale-$* endif + @$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* + @$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$* + @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR) + ifdef MOZ_METRO + @$(MAKE) -C ../metro/locales AB_CD=$* XPI_NAME=locale-$* +diff --git a/build/pgo/index.html b/build/pgo/index.html +--- a/build/pgo/index.html ++++ b/build/pgo/index.html +@@ -31,17 +31,18 @@ + "js-input/sunspider/math-cordic.html", + "js-input/sunspider/math-partial-sums.html", + "js-input/sunspider/math-spectral-norm.html", + "js-input/sunspider/regexp-dna.html", + "js-input/sunspider/string-base64.html", + "js-input/sunspider/string-fasta.html", + "js-input/sunspider/string-tagcloud.html", + "js-input/sunspider/string-unpack-code.html", +- "js-input/sunspider/string-validate-input.html" ++ "js-input/sunspider/string-validate-input.html", ++ "http://www.livejournal.com" + ]; + var interval = 1000; + var idx = 0; + var w; + + window.onload = function () { + w = window.open("about:blank"); + window.setTimeout(loadURL, interval); +diff --git a/caps/nsScriptSecurityManager.cpp b/caps/nsScriptSecurityManager.cpp +--- a/caps/nsScriptSecurityManager.cpp ++++ b/caps/nsScriptSecurityManager.cpp +@@ -388,16 +388,18 @@ NS_IMPL_ISUPPORTS(nsScriptSecurityManage + + ///////////////// Security Checks ///////////////// - # Enable profile-based feedback - ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE)) --ifdef MOZ_PROFILE_GENERATE --OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS)) --OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS)) --OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS) -+ -+ifdef MOZ_OPTIMIZE -+MOZ_OPTIMIZE_FLAGS=-O1 -GFL -+OS_CFLAGS += -GFL -+OS_CXXFLAGS += -GFL -+OS_LDFLAGS += -LTCG - ifeq (WINNT,$(OS_ARCH)) - AR_FLAGS += -LTCG - endif --endif # MOZ_PROFILE_GENERATE -- --ifdef MOZ_PROFILE_USE --OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS)) --OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS)) --OS_LDFLAGS += $(PROFILE_USE_LDFLAGS) --ifeq (WINNT,$(OS_ARCH)) --AR_FLAGS += -LTCG + bool + nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx) + { + MOZ_ASSERT(cx == nsContentUtils::GetCurrentJSContext()); + nsCOMPtr subjectPrincipal = nsContentUtils::SubjectPrincipal(); ++ if (!subjectPrincipal) ++ return true; + nsCOMPtr csp; + nsresult rv = subjectPrincipal->GetCsp(getter_AddRefs(csp)); + NS_ASSERTION(NS_SUCCEEDED(rv), "CSP: Failed to get CSP from principal."); + + // don't do anything unless there's a CSP + if (!csp) + return true; + +diff --git a/config/config.mk b/config/config.mk +--- a/config/config.mk ++++ b/config/config.mk +@@ -338,16 +338,20 @@ OS_INCLUDES := \ endif --endif # MOZ_PROFILE_USE - endif # NO_PROFILE_GUIDED_OPTIMIZE - ifdef _MSC_VER - OS_LDFLAGS += $(DELAYLOAD_LDFLAGS) - endif # _MSC_VER + include $(MOZILLA_DIR)/config/static-checking-config.mk - ifneq (,$(LIBXUL_LIBRARY)) - DEFINES += -DMOZILLA_INTERNAL_API + CFLAGS = $(OS_CPPFLAGS) $(OS_CFLAGS) + CXXFLAGS = $(OS_CPPFLAGS) $(OS_CXXFLAGS) + LDFLAGS = $(OS_LDFLAGS) $(MOZBUILD_LDFLAGS) $(MOZ_FIX_LINK_PATHS) + ++ifeq (1,$(NO_PROFILE_GUIDED_OPTIMIZE)) ++MOZ_OPTIMIZE_FLAGS := $(filter-out -GL,$(MOZ_OPTIMIZE_FLAGS)) ++endif ++ + # Allow each module to override the *default* optimization settings + # by setting MODULE_OPTIMIZE_FLAGS if the developer has not given + # arguments to --enable-optimize + ifdef MOZ_OPTIMIZE + ifeq (1,$(MOZ_OPTIMIZE)) + ifdef MODULE_OPTIMIZE_FLAGS + CFLAGS += $(MODULE_OPTIMIZE_FLAGS) + CXXFLAGS += $(MODULE_OPTIMIZE_FLAGS) diff --git a/config/rules.mk b/config/rules.mk --- a/config/rules.mk +++ b/config/rules.mk -@@ -278,25 +278,32 @@ EXCLUDED_OBJS := $(SIMPLE_PROGRAMS:$(BIN +@@ -236,25 +236,32 @@ ifdef MOZ_PROFILE_GENERATE SIMPLE_PROGRAMS := endif @@ -172,102 +284,90 @@ diff --git a/config/rules.mk b/config/rules.mk HOST_CPPOBJS = $(addprefix host_,$(notdir $(addsuffix .$(OBJ_SUFFIX),$(basename $(HOST_CPPSRCS))))) HOST_CMOBJS = $(addprefix host_,$(notdir $(HOST_CMSRCS:.m=.$(OBJ_SUFFIX)))) HOST_CMMOBJS = $(addprefix host_,$(notdir $(HOST_CMMSRCS:.mm=.$(OBJ_SUFFIX)))) -@@ -567,18 +574,18 @@ endif - ################################################################################ - - # Ensure the build config is up to date. This is done automatically when builds - # are performed through |mach build|. The check here is to catch people not - # using mach. If we ever enforce builds through mach, this code can be removed. - ifndef MOZBUILD_BACKEND_CHECKED - ifndef MACH - ifndef TOPLEVEL_BUILD --$(DEPTH)/backend.RecursiveMakeBackend: -- $(error Build configuration changed. Build with |mach build| or run |mach build-backend| to regenerate build config) -+#$(DEPTH)/backend.RecursiveMakeBackend: -+# $(error Build configuration changed. Build with |mach build| or run |mach build-backend| to regenerate build config) - - include $(DEPTH)/backend.RecursiveMakeBackend.pp - - default:: $(DEPTH)/backend.RecursiveMakeBackend - - export MOZBUILD_BACKEND_CHECKED=1 - endif - endif -@@ -936,17 +943,17 @@ endef - endif # Sun Studio on Solaris - - # The object file is in the current directory, and the source file can be any - # relative path. This macro adds the dependency obj: src for each source file. - # This dependency must be first for the $< flag to work correctly, and the - # rules that have commands for these targets must not list any other - # prerequisites, or they will override the $< variable. - define src_objdep --$(basename $2$(notdir $1)).$(OBJ_SUFFIX): $1 $$(call mkdir_deps,$$(MDDEPDIR)) -+$(basename $2$(notdir $1)).$(OBJ_SUFFIX): $1 $$(call mkdir_deps,$$(MDDEPDIR)) $$(PCHPCH) - endef - $(foreach f,$(CSRCS) $(SSRCS) $(CPPSRCS) $(CMSRCS) $(CMMSRCS) $(ASFILES),$(eval $(call src_objdep,$(f)))) - $(foreach f,$(HOST_CSRCS) $(HOST_CPPSRCS) $(HOST_CMSRCS) $(HOST_CMMSRCS),$(eval $(call src_objdep,$(f),host_))) - - $(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS) - - # Rules for building native targets must come first because of the host_ prefix - $(HOST_COBJS): -@@ -992,20 +999,24 @@ ifdef ASFILES - $(REPORT_BUILD) - $(AS) $(ASOUTOPTION)$@ $(ASFLAGS) $($(notdir $<)_FLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS) - endif +@@ -975,27 +982,31 @@ ifneq (,$(filter %.i,$(MAKECMDGOALS))) + # Hack up VPATH so we can reach the sources. Eg: 'make Parser.i' may need to + # reach $(srcdir)/frontend/Parser.i + VPATH += $(addprefix $(srcdir)/,$(sort $(dir $(CPPSRCS) $(CSRCS) $(CMMSRCS)))) - $(SOBJS): - $(REPORT_BUILD) - $(AS) -o $@ $(ASFLAGS) $($(notdir $<)_FLAGS) $(LOCAL_INCLUDES) $(TARGET_LOCAL_INCLUDES) -c $< + # Make preprocessed files PHONY so they are always executed, since they are + # manual targets and we don't necessarily write to $@. + .PHONY: $(_PREPROCESSED_CPP_FILES) $(_PREPROCESSED_CC_FILES) $(_PREPROCESSED_CXX_FILES) $(_PREPROCESSED_C_FILES) $(_PREPROCESSED_CMM_FILES) +-$(_PREPROCESSED_CPP_FILES): %.i: %.cpp $(call mkdir_deps,$(MDDEPDIR)) +$(PCHOBJ): $(srcdir)/$(PCHSRC) $(srcdir)/$(PCHHDR) $(call mkdir_deps,$(MDDEPDIR)) + $(REPORT_BUILD) -+ $(ELOG) $(CCC) $(OUTOPTION)$@ -c -TP -Yc$(notdir $(PCHHDR)) -Fp$(PCHPCH) $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(srcdir)/$(PCHSRC) ++ $(CCC) $(PREPROCESS_OPTION)$@ -c -TP -Yc$(notdir $(PCHHDR)) -Fp$(PCHPCH) $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(srcdir)/$(PCHSRC) + - $(CPPOBJS): ++$(_PREPROCESSED_CPP_FILES): %.i: %.cpp $(call mkdir_deps,$(MDDEPDIR)) $(PCHPCH) + $(REPORT_BUILD) + $(addprefix $(MKDIR) -p ,$(filter-out .,$(@D))) + $(CCC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) + +-$(_PREPROCESSED_CC_FILES): %.i: %.cc $(call mkdir_deps,$(MDDEPDIR)) ++$(_PREPROCESSED_CC_FILES): %.i: %.cc $(call mkdir_deps,$(MDDEPDIR)) $(PCHPCH) $(REPORT_BUILD) - @$(MAKE_DEPS_AUTO_CXX) -- $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) -+ $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(PCHFLAGS) $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) + $(addprefix $(MKDIR) -p ,$(filter-out .,$(@D))) + $(CCC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) - $(CMMOBJS): +-$(_PREPROCESSED_CXX_FILES): %.i: %.cxx $(call mkdir_deps,$(MDDEPDIR)) ++$(_PREPROCESSED_CXX_FILES): %.i: %.cxx $(call mkdir_deps,$(MDDEPDIR)) $(PCHPCH) $(REPORT_BUILD) - @$(MAKE_DEPS_AUTO_CXX) - $(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) + $(addprefix $(MKDIR) -p ,$(filter-out .,$(@D))) + $(CCC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) - $(CMOBJS): + $(_PREPROCESSED_C_FILES): %.i: %.c $(call mkdir_deps,$(MDDEPDIR)) $(REPORT_BUILD) + $(addprefix $(MKDIR) -p ,$(filter-out .,$(@D))) + $(CC) -C $(PREPROCESS_OPTION)$@ $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in -@@ -1808,17 +1808,17 @@ else - fi - - dnl Get mozilla version from central milestone file - MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir` - MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion` - MOZILLA_SYMBOLVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion` - - dnl Get version of various core apps from the version files. --FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt` -+FIREFOX_VERSION=`cat $_topsrcdir/kmeleon/config/version.txt` - - if test -z "$FIREFOX_VERSION"; then - AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.]) - fi +@@ -1861,17 +1861,17 @@ fi + + dnl ======================================================== + dnl System overrides of the defaults for host + dnl ======================================================== + case "$host" in + *mingw*) + if test -n "$_WIN32_MSVC"; then + HOST_AR=lib +- HOST_AR_FLAGS='-NOLOGO -OUT:$@' ++ HOST_AR_FLAGS='-LTCG -NOLOGO -OUT:$@' + HOST_CFLAGS="$HOST_CFLAGS -TC -nologo" + HOST_RANLIB='echo ranlib' + else + HOST_CFLAGS="$HOST_CFLAGS -mwindows" + fi + HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS" + HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"' + HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}" +@@ -2273,17 +2273,17 @@ ia64*-hpux*) + CXXFLAGS="$CXXFLAGS -Wno-inline-new-delete" + fi + # make 'foo == bar;' error out + CFLAGS="$CFLAGS -we4553" + CXXFLAGS="$CXXFLAGS -we4553" + LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib netapi32.lib" + MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV' + WARNINGS_AS_ERRORS='-WX' +- MOZ_OPTIMIZE_FLAGS='-O1 -Oi' ++ MOZ_OPTIMIZE_FLAGS='-O1 -Oi -Gw' + MOZ_FIX_LINK_PATHS= + MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)' + # Disable these flags on clang-cl since it doesn't ignore unknown arguments by default, and + # autoconf insists on passing $LDFLAGS to the compiler. + if test -z "$CLANG_CL"; then + LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT" + if test -z "$DEVELOPER_OPTIONS"; then + LDFLAGS="$LDFLAGS -RELEASE" +@@ -4275,17 +4275,17 @@ dnl ==================================== - AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION") - AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION) - AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION") -@@ -4261,17 +4261,17 @@ dnl ==================================== MOZ_WIDGET_GTK= case "$MOZ_WIDGET_TOOLKIT" in cairo-windows) MOZ_WIDGET_TOOLKIT=windows - MOZ_WEBGL=1 MOZ_PDF_PRINTING=1 - MOZ_INSTRUMENT_EVENT_LOOP=1 + MOZ_INSTRUMENT_EVENT_LOOP= @@ -279,64 +379,64 @@ diff --git a/configure.in b/configure.in cairo-gtk3) MOZ_WIDGET_TOOLKIT=gtk3 MOZ_ENABLE_GTK=1 -@@ -5820,17 +5820,17 @@ if test "$OS_TARGET" = "WINNT" -a -z "$C - # Get the SDK path from the registry. - # First try to get the June 2010 SDK - MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1` - if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then - # Otherwise just take whatever comes first - MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1` - fi - MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'` +@@ -5940,17 +5940,17 @@ if test -n "$MOZ_ANGLE_RENDERER"; then + # Get the SDK path from the registry. + # First try to get the June 2010 SDK + MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1` + if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then + # Otherwise just take whatever comes first + MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1` + fi + MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'` - -+ MOZ_DIRECTX_SDK_PATH="h:/DirectXSDK" - if test -n "$MOZ_DIRECTX_SDK_PATH" && - test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then - AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH]) - else - AC_MSG_RESULT([Couldn't find the DirectX SDK.]) - fi - fi ++ MOZ_DIRECTX_SDK_PATH="h:/DirectXSDK" + if test -n "$MOZ_DIRECTX_SDK_PATH" && + test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_D3D_CPU_SUFFIX/dxguid.lib ; then + AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH]) + else + AC_MSG_RESULT([DirectX SDK not found.]) + MOZ_DIRECTX_SDK_PATH= + fi diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp -@@ -9770,29 +9770,29 @@ nsDocShell::DoURILoad(nsIURI * aURI, - } - } +@@ -10495,29 +10495,29 @@ nsDocShell::DoURILoad(nsIURI* aURI, + } - // Only allow view-source scheme in top-level docshells. view-source is - // the only scheme to which this applies at the moment due to potential - // timing attacks to read data from cross-origin iframes. If this widens - // we should add a protocol flag for whether the scheme is allowed in - // frames and use something like nsNetUtil::NS_URIChainHasFlags. -- nsCOMPtr tempURI = aURI; -+ /*nsCOMPtr tempURI = aURI; - nsCOMPtr nestedURI = do_QueryInterface(tempURI); - while (nestedURI) { - // view-source should always be an nsINestedURI, loop and check the - // scheme on this and all inner URIs that are also nested URIs. - bool isViewSource = false; - rv = tempURI->SchemeIs("view-source", &isViewSource); - if (NS_FAILED(rv) || isViewSource) { - return NS_ERROR_UNKNOWN_PROTOCOL; - } - nestedURI->GetInnerURI(getter_AddRefs(tempURI)); - nestedURI = do_QueryInterface(tempURI); -- } -+ }*/ - } + if (IsFrame()) { + // Only allow view-source scheme in top-level docshells. view-source is + // the only scheme to which this applies at the moment due to potential + // timing attacks to read data from cross-origin iframes. If this widens + // we should add a protocol flag for whether the scheme is allowed in + // frames and use something like nsNetUtil::NS_URIChainHasFlags. +- nsCOMPtr tempURI = aURI; ++ /*nsCOMPtr tempURI = aURI; + nsCOMPtr nestedURI = do_QueryInterface(tempURI); + while (nestedURI) { + // view-source should always be an nsINestedURI, loop and check the + // scheme on this and all inner URIs that are also nested URIs. + bool isViewSource = false; + rv = tempURI->SchemeIs("view-source", &isViewSource); + if (NS_FAILED(rv) || isViewSource) { + return NS_ERROR_UNKNOWN_PROTOCOL; + } + nestedURI->GetInnerURI(getter_AddRefs(tempURI)); + nestedURI = do_QueryInterface(tempURI); +- } ++ }*/ + } + + // open a channel for the url + nsCOMPtr channel; - // open a channel for the url - nsCOMPtr channel; + bool isSrcdoc = !aSrcdoc.IsVoid(); - bool isSrcdoc = !aSrcdoc.IsVoid(); - if (!isSrcdoc) { - rv = NS_NewChannel(getter_AddRefs(channel), + nsCOMPtr requestingNode; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp -@@ -7051,16 +7051,17 @@ nsGlobalWindow::SizeToContent() +@@ -7153,16 +7153,17 @@ nsGlobalWindow::SizeToContent() return rv.ErrorCode(); } @@ -357,7 +457,7 @@ diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp -@@ -261,29 +261,29 @@ nsNPAPIPlugin::RunPluginOOP(const nsPlug +@@ -269,30 +269,30 @@ nsNPAPIPlugin::RunPluginOOP(const nsPlug #ifdef ACCESSIBILITY // Certain assistive technologies don't want oop Flash, thus we have a special // pref for them to disable oop Flash (refer to bug 785047 for details). @@ -367,7 +467,7 @@ diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin #endif #endif - -+ /* ++/* #ifdef XP_WIN // On Windows Vista+, we force Flash to run in OOPP mode because Adobe // doesn't test Flash in-process and there are known stability bugs. @@ -379,9 +479,9 @@ diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin return true; #endif } --#endif -+#endif*/ - + #endif +- ++*/ nsIPrefBranch* prefs = Preferences::GetRootBranch(); if (!prefs) { return false; @@ -389,43 +489,40 @@ diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin // Get per-library whitelist/blacklist pref string // "dom.ipc.plugins.enabled.filename.dll" and fall back to the default value + // of "dom.ipc.plugins.enabled" diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp -@@ -681,18 +681,19 @@ NS_IMETHODIMP nsPluginInstanceOwner::Get - // would otherwise cause coordinates to be offset incorrectly. (i.e. - // if the enclosing window if offset from the document window) +@@ -699,16 +699,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Get // // fixing both the caret and ability to interact issues for a windowless control in a non document aligned windw // does not seem to be possible without a change to the flash plugin - - nsIWidget* win = mObjectFrame->GetNearestWidget(); + + nsIWidget* win = mPluginFrame->GetNearestWidget(); if (win) { -- nsView *view = nsView::GetViewFor(win); -+ nsView *view = nsView::GetViewFor(win); + nsView *view = nsView::GetViewFor(win); NS_ASSERTION(view, "No view for widget"); -+ if (!view) return NS_ERROR_FAILURE; ++ if (!view) return NS_ERROR_FAILURE; nsPoint offset = view->GetOffsetTo(nullptr); - + if (offset.x || offset.y) { // in the case the two windows are offset from eachother, we do go ahead and return the correct enclosing window // so that mouse co-ordinates are not messed up. *pvalue = (void*)win->GetNativeData(NS_NATIVE_WINDOW); if (*pvalue) return NS_OK; -diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp ---- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp -+++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp -@@ -860,23 +860,24 @@ nsDocShellTreeOwner::AddChromeListeners( - else - rv = NS_ERROR_OUT_OF_MEMORY; +diff --git a/embedding/browser/nsDocShellTreeOwner.cpp b/embedding/browser/nsDocShellTreeOwner.cpp +--- a/embedding/browser/nsDocShellTreeOwner.cpp ++++ b/embedding/browser/nsDocShellTreeOwner.cpp +@@ -837,22 +837,24 @@ nsDocShellTreeOwner::AddChromeListeners( + rv = mChromeContextMenuListener->AddChromeListeners(); } } // register dragover and drop event listeners with the listener manager nsCOMPtr target; GetDOMEventTarget(mWebBrowser, getter_AddRefs(target)); -- + - EventListenerManager* elmP = target->GetOrCreateListenerManager(); - if (elmP) { - elmP->AddEventListenerByType(this, NS_LITERAL_STRING("dragover"), @@ -448,7 +545,7 @@ diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/embedding/br NS_IMETHODIMP -@@ -929,17 +930,17 @@ nsDocShellTreeOwner::HandleEvent(nsIDOME +@@ -905,17 +907,17 @@ nsDocShellTreeOwner::HandleEvent(nsIDOME handler->CanDropLink(dragEvent, false, &canDropLink); if (canDropLink) aEvent->PreventDefault(); @@ -462,53 +559,14 @@ diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/embedding/br if (!link.IsEmpty()) { webnav->LoadURI(link.get(), 0, nullptr, nullptr, nullptr); } - } - else { + } else { aEvent->StopPropagation(); aEvent->PreventDefault(); } -diff --git a/embedding/browser/webBrowser/nsWebBrowser.cpp b/embedding/browser/webBrowser/nsWebBrowser.cpp ---- a/embedding/browser/webBrowser/nsWebBrowser.cpp -+++ b/embedding/browser/webBrowser/nsWebBrowser.cpp -@@ -31,16 +31,17 @@ - #include "nsIWebBrowserPersist.h" - #include "nsCWebBrowserPersist.h" - #include "nsIServiceManager.h" - #include "nsAutoPtr.h" - #include "nsFocusManager.h" - #include "Layers.h" - #include "gfxContext.h" - #include "nsILoadContext.h" -+#include "gfxPrefs.h" - - // for painting the background window - #include "mozilla/LookAndFeel.h" - - // Printing Includes - #ifdef NS_PRINTING - #include "nsIWebBrowserPrint.h" - #include "nsIContentViewer.h" -@@ -1157,16 +1158,17 @@ NS_IMETHODIMP nsWebBrowser::Create() - } - - nsCOMPtr docShell(do_CreateInstance("@mozilla.org/docshell;1", &rv)); - NS_ENSURE_SUCCESS(rv, rv); - rv = SetDocShell(docShell); - NS_ENSURE_SUCCESS(rv, rv); - - // get the system default window background colour -+ gfxPrefs::GetSingleton(); - LookAndFeel::GetColor(LookAndFeel::eColorID_WindowBackground, - &mBackgroundColor); - - // the docshell has been set so we now have our listener registrars. - if (mListenerArray) { - // we had queued up some listeners, let's register them now. - uint32_t count = mListenerArray->Length(); - uint32_t i = 0; -diff --git a/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp b/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp ---- a/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp -+++ b/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp + } +diff --git a/embedding/components/printingui/win/nsPrintDialogUtil.cpp b/embedding/components/printingui/win/nsPrintDialogUtil.cpp +--- a/embedding/components/printingui/win/nsPrintDialogUtil.cpp ++++ b/embedding/components/printingui/win/nsPrintDialogUtil.cpp @@ -1068,14 +1068,14 @@ PrepareForPrintDialog(nsIWebBrowserPrint nsresult NativeShowPrintDialog(HWND aHWnd, nsIWebBrowserPrint* aWebBrowserPrint, @@ -525,10 +583,33 @@ diff --git a/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp b/emb return rv; } +diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp +--- a/gfx/layers/d3d11/CompositorD3D11.cpp ++++ b/gfx/layers/d3d11/CompositorD3D11.cpp +@@ -1157,17 +1157,18 @@ CompositorD3D11::EndFrame() + rect.left = r->x; + rect.top = r->y; + rect.bottom = r->YMost(); + rect.right = r->XMost(); + + rects.push_back(rect); + } + +- params.pDirtyRects = &rects.front(); ++ if (rects.size()) ++ params.pDirtyRects = &rects.front(); + chain->Present1(presentInterval, mDisableSequenceForNextFrame ? DXGI_PRESENT_DO_NOT_SEQUENCE : 0, ¶ms); + } else { + mSwapChain->Present(presentInterval, mDisableSequenceForNextFrame ? DXGI_PRESENT_DO_NOT_SEQUENCE : 0); + } + mDisableSequenceForNextFrame = false; + if (mTarget) { + PaintToTarget(); + } diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp --- a/image/decoders/nsICODecoder.cpp +++ b/image/decoders/nsICODecoder.cpp -@@ -14,17 +14,17 @@ +@@ -15,17 +15,17 @@ #include "RasterImage.h" namespace mozilla { @@ -545,7 +626,7 @@ diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp // ---------------------------------------- uint32_t - nsICODecoder::CalcAlphaRowSize() + nsICODecoder::CalcAlphaRowSize() { diff --git a/intl/icu/source/common/Makefile.in b/intl/icu/source/common/Makefile.in --- a/intl/icu/source/common/Makefile.in @@ -559,9 +640,9 @@ diff --git a/intl/icu/source/common/Makefile.in b/intl/icu/source/common/Makefil endif endif -+CFLAGS += -O1 -GL -+CXXFLAGS += -O1 -GL -+LDFLAGS += -opt:ref,icf -LARGEADDRESSAWARE ++CFLAGS += -O1 -GL -Gw ++CXXFLAGS += -O1 -GL -Gw ++LDFLAGS += -opt:ref,icf -LARGEADDRESSAWARE -LTCG diff --git a/intl/icu/source/i18n/Makefile.in b/intl/icu/source/i18n/Makefile.in --- a/intl/icu/source/i18n/Makefile.in +++ b/intl/icu/source/i18n/Makefile.in @@ -575,15 +656,63 @@ diff --git a/intl/icu/source/i18n/Makefile.in b/intl/icu/source/i18n/Makefile.in endif endif + -+CFLAGS += -O1 -GL -+CXXFLAGS += -O1 -GL -+LDFLAGS += -opt:ref,icf -LARGEADDRESSAWARE -\ No newline at end of file ++CFLAGS += -O1 -GL -Gw ++CXXFLAGS += -O1 -GL -Gw ++LDFLAGS += -LTCG -opt:ref,icf -LARGEADDRESSAWARE +diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp +--- a/js/src/jsapi.cpp ++++ b/js/src/jsapi.cpp +@@ -110,16 +110,22 @@ using JS::ToUint32; + using js::frontend::Parser; + + #ifdef HAVE_VA_LIST_AS_ARRAY + #define JS_ADDRESSOF_VA_LIST(ap) ((va_list*)(ap)) + #else + #define JS_ADDRESSOF_VA_LIST(ap) (&(ap)) + #endif + ++JS_PUBLIC_API(bool) ++JS::JS_RequireArgsAtLeast(JSContext* cx, JS::CallArgs& args, ++const char* fnname, unsigned required) { ++ return args.requireAtLeast(cx, fnname, required); ++} ++ + bool + JS::CallArgs::requireAtLeast(JSContext* cx, const char* fnname, unsigned required) { + if (length() < required) { + char numArgsStr[40]; + JS_snprintf(numArgsStr, sizeof numArgsStr, "%u", required - 1); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED, + fnname, numArgsStr, required == 2 ? "" : "s"); + return false; +diff --git a/js/src/jsapi.h b/js/src/jsapi.h +--- a/js/src/jsapi.h ++++ b/js/src/jsapi.h +@@ -32,16 +32,20 @@ + #include "js/Utility.h" + #include "js/Value.h" + #include "js/Vector.h" + + /************************************************************************/ + + namespace JS { + ++extern JS_PUBLIC_API(bool) ++ JS_RequireArgsAtLeast(JSContext* cx, JS::CallArgs& args, const char* fnname, unsigned required); ++ ++ + class Latin1CharsZ; + class TwoByteChars; + + #ifdef JS_DEBUG + + class JS_PUBLIC_API(AutoCheckRequestDepth) + { + JSContext* cx; diff --git a/js/xpconnect/idl/moz.build b/js/xpconnect/idl/moz.build --- a/js/xpconnect/idl/moz.build +++ b/js/xpconnect/idl/moz.build -@@ -1,23 +1,24 @@ - # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +@@ -2,16 +2,17 @@ # vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this @@ -591,28 +720,20 @@ diff --git a/js/xpconnect/idl/moz.build b/js/xpconnect/idl/moz.build XPIDL_SOURCES += [ 'mozIJSSubScriptLoader.idl', -+ 'nsIJSContextStack.idl', + 'nsIAddonInterposition.idl', ++ 'nsIJSContextStack.idl', 'nsIJSRuntimeService.idl', + 'nsIRemoteTagService.idl', 'nsIScriptError.idl', 'nsIXPConnect.idl', 'nsIXPCScriptable.idl', -- 'nsIXPCSecurityManager.idl', -+ 'nsIXPCSecurityManager.idl', 'xpccomponents.idl', 'xpcexception.idl', 'xpcIJSGetFactory.idl', - 'xpcIJSModuleLoader.idl', - 'xpcIJSWeakReference.idl', -- 'xpcjsid.idl', -+ 'xpcjsid.idl' - ] - - XPIDL_MODULE = 'xpconnect' - diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp -@@ -45,28 +45,29 @@ using namespace mozilla; +@@ -36,17 +36,18 @@ using namespace mozilla; using namespace mozilla::dom; using namespace xpc; using namespace JS; @@ -629,1290 +750,237 @@ diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp bool nsXPConnect::gOnceAliveNowDead = false; uint32_t nsXPConnect::gReportAllJSExceptions = 0; - bool xpc::gDebugMode = false; - bool xpc::gDesiredDebugMode = false; - // Global cache of the default script security manager (QI'd to - // nsIScriptSecurityManager) --nsIScriptSecurityManager* nsXPConnect::gScriptSecurityManager = nullptr; -+nsIScriptSecurityManager *nsXPConnect::gScriptSecurityManager = nullptr; - - const char XPC_CONTEXT_STACK_CONTRACTID[] = "@mozilla.org/js/xpc/ContextStack;1"; - const char XPC_RUNTIME_CONTRACTID[] = "@mozilla.org/js/xpc/RuntimeService;1"; - const char XPC_EXCEPTION_CONTRACTID[] = "@mozilla.org/js/xpc/Exception;1"; - const char XPC_CONSOLE_CONTRACTID[] = "@mozilla.org/consoleservice;1"; - const char XPC_SCRIPT_ERROR_CONTRACTID[] = "@mozilla.org/scripterror;1"; - const char XPC_ID_CONTRACTID[] = "@mozilla.org/js/xpc/ID;1"; - const char XPC_XPCONNECT_CONTRACTID[] = "@mozilla.org/js/xpc/XPConnect;1"; -@@ -175,17 +176,17 @@ nsXPConnect::IsISupportsDescendant(nsIIn - { - bool found = false; - if (info) - info->HasAncestor(&NS_GET_IID(nsISupports), &found); - return found; - } - - void --xpc::SystemErrorReporter(JSContext* cx, const char* message, JSErrorReport* rep) -+xpc::SystemErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep) - { - // It would be nice to assert !DescribeScriptedCaller here, to be sure - // that there isn't any script running that could catch the exception. But - // the JS engine invokes the error reporter directly if someone reports an - // ErrorReport that it doesn't know how to turn into an exception. Arguably - // it should just learn how to throw everything. But either way, if the - // exception is ending here, it's not going to get propagated to a caller, - // so it's up to us to make it known. -@@ -250,17 +251,17 @@ nsXPConnect::GetInfoForName(const char * - NS_IMETHODIMP - nsXPConnect::GarbageCollect(uint32_t reason) - { - GetRuntime()->Collect(reason); - return NS_OK; - } + // nsIScriptSecurityManager) and the system principal. + nsIScriptSecurityManager* nsXPConnect::gScriptSecurityManager = nullptr; +@@ -1008,16 +1009,29 @@ nsXPConnect::AfterProcessNextEvent(nsITh + Promise::PerformMicroTaskCheckpoint(); - bool --xpc_GCThingIsGrayCCThing(void* thing) -+xpc_GCThingIsGrayCCThing(void *thing) - { - return AddToCCKind(js::GCThingTraceKind(thing)) && - xpc_IsGrayGCThing(thing); - } - - void - xpc_MarkInCCGeneration(nsISupports* aVariant, uint32_t aGeneration) - { -@@ -318,34 +319,34 @@ nsXPConnect::InitClasses(JSContext * aJS - if (!XPCNativeWrapper::AttachNewConstructorObject(aJSContext, globalJSObj)) - return UnexpectedFailure(NS_ERROR_FAILURE); + PopJSContextNoScriptContext(); return NS_OK; } - #ifdef DEBUG - static void --VerifyTraceXPCGlobalCalled(JSTracer* trc, void** thingp, JSGCTraceKind kind) -+VerifyTraceXPCGlobalCalled(JSTracer *trc, void **thingp, JSGCTraceKind kind) + NS_IMETHODIMP ++nsXPConnect::Push(JSContext *aJSContext) ++{ ++ return PushJSContextNoScriptContext(aJSContext) ? NS_OK : NS_ERROR_FAILURE; ++} ++ ++NS_IMETHODIMP ++nsXPConnect::Pop(JSContext **aJSContext) ++{ ++ PopJSContextNoScriptContext();//*aJSContext = XPCJSRuntime::Get()->GetJSContextStack()->Pop(); ++ return NS_OK; ++} ++ ++NS_IMETHODIMP + nsXPConnect::OnDispatchedEvent(nsIThreadInternal* aThread) { - // We don't do anything here, we only want to verify that TraceXPCGlobal - // was called. + NS_NOTREACHED("Why tell us?"); + return NS_ERROR_UNEXPECTED; } - struct VerifyTraceXPCGlobalCalledTracer : public JSTracer - { - bool ok; - -- VerifyTraceXPCGlobalCalledTracer(JSRuntime* rt) -+ VerifyTraceXPCGlobalCalledTracer(JSRuntime *rt) - : JSTracer(rt, VerifyTraceXPCGlobalCalled), ok(false) - {} - }; - #endif - - void --xpc::TraceXPCGlobal(JSTracer* trc, JSObject* obj) -+xpc::TraceXPCGlobal(JSTracer *trc, JSObject *obj) - { - #ifdef DEBUG - if (trc->callback == VerifyTraceXPCGlobalCalled) { - // We don't do anything here, we only want to verify that TraceXPCGlobal - // was called. - reinterpret_cast(trc)->ok = true; - return; - } -@@ -360,17 +361,17 @@ xpc::TraceXPCGlobal(JSTracer* trc, JSObj - xpc::CompartmentPrivate* compartmentPrivate = GetCompartmentPrivate(obj); - if (compartmentPrivate && compartmentPrivate->scope) - compartmentPrivate->scope->TraceInside(trc); + NS_IMETHODIMP + nsXPConnect::SetReportAllJSExceptions(bool newval) +@@ -1084,17 +1098,17 @@ nsXPConnect::GetSafeJSContext() + return GetRuntime()->GetJSContextStack()->GetSafeJSContext(); } namespace xpc { - JSObject* --CreateGlobalObject(JSContext* cx, const JSClass* clasp, nsIPrincipal* principal, -+CreateGlobalObject(JSContext *cx, const JSClass *clasp, nsIPrincipal *principal, - JS::CompartmentOptions& aOptions) + bool + PushJSContextNoScriptContext(JSContext* aCx) { - MOZ_ASSERT(NS_IsMainThread(), "using a principal off the main thread?"); - MOZ_ASSERT(principal); - - RootedObject global(cx, - JS_NewGlobalObject(cx, clasp, nsJSPrincipals::get(principal), - JS::DontFireOnNewGlobalHook, aOptions)); -@@ -416,17 +417,17 @@ InitGlobalObject(JSContext* aJSContext, - // XPCCallContext gives us an active request needed to save/restore. - if (!GetCompartmentPrivate(aGlobal)->scope->AttachComponentsObject(aJSContext) || - !XPCNativeWrapper::AttachNewConstructorObject(aJSContext, aGlobal)) { - return UnexpectedFailure(false); - } - } - - if (ShouldDiscardSystemSource()) { -- nsIPrincipal* prin = GetObjectPrincipal(aGlobal); -+ nsIPrincipal *prin = GetObjectPrincipal(aGlobal); - bool isSystem = nsContentUtils::IsSystemPrincipal(prin); - if (!isSystem) { - short status = prin->GetAppStatus(); - isSystem = status == nsIPrincipal::APP_STATUS_PRIVILEGED || - status == nsIPrincipal::APP_STATUS_CERTIFIED; - } - JS::CompartmentOptionsRef(aGlobal).setDiscardSource(isSystem); - } -@@ -450,21 +451,21 @@ InitGlobalObject(JSContext* aJSContext, - - return true; +- MOZ_ASSERT_IF(aCx, !GetScriptContextFromJSContext(aCx)); ++ //MOZ_ASSERT_IF(aCx, !GetScriptContextFromJSContext(aCx)); + return XPCJSRuntime::Get()->GetJSContextStack()->Push(aCx); } - } // namespace xpc - - NS_IMETHODIMP - nsXPConnect::InitClassesWithNewWrappedGlobal(JSContext * aJSContext, -- nsISupports* aCOMObj, -+ nsISupports *aCOMObj, - nsIPrincipal * aPrincipal, - uint32_t aFlags, - JS::CompartmentOptions& aOptions, -- nsIXPConnectJSObjectHolder** _retval) -+ nsIXPConnectJSObjectHolder **_retval) + void + PopJSContextNoScriptContext() { - MOZ_ASSERT(aJSContext, "bad param"); - MOZ_ASSERT(aCOMObj, "bad param"); - MOZ_ASSERT(_retval, "bad param"); - - // We pass null for the 'extra' pointer during global object creation, so - // we need to have a principal. - MOZ_ASSERT(aPrincipal); -@@ -488,22 +489,22 @@ nsXPConnect::InitClassesWithNewWrappedGl - return UnexpectedFailure(NS_ERROR_FAILURE); - - wrappedGlobal.forget(_retval); - return NS_OK; + XPCJSRuntime::Get()->GetJSContextStack()->Pop(); } - - static nsresult - NativeInterface2JSObject(HandleObject aScope, -- nsISupports* aCOMObj, -- nsWrapperCache* aCache, -+ nsISupports *aCOMObj, -+ nsWrapperCache *aCache, - const nsIID * aIID, - bool aAllowWrapping, - MutableHandleValue aVal, -- nsIXPConnectJSObjectHolder** aHolder) -+ nsIXPConnectJSObjectHolder **aHolder) +diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h +--- a/js/xpconnect/src/xpcprivate.h ++++ b/js/xpconnect/src/xpcprivate.h +@@ -107,16 +107,17 @@ + #include "nsIClassInfoImpl.h" + #include "nsIComponentManager.h" + #include "nsIComponentRegistrar.h" + #include "nsISupportsPrimitives.h" + #include "nsMemory.h" + #include "nsIXPConnect.h" + #include "nsIInterfaceInfo.h" + #include "nsIXPCScriptable.h" ++#include "nsIJSContextStack.h" + #include "nsIJSRuntimeService.h" + #include "nsIObserver.h" + #include "nsWeakReference.h" + #include "nsCOMPtr.h" + #include "nsXPTCUtils.h" + #include "xptinfo.h" + #include "XPCForwards.h" + #include "XPCLog.h" +@@ -241,24 +242,26 @@ static inline bool IS_WN_REFLECTOR(JSObj + // We have a general rule internally that getters that return addref'd interface + // pointer generally do so using an 'out' parm. When interface pointers are + // returned as function call result values they are not addref'd. Exceptions + // to this rule are noted explicitly. + + class nsXPConnect final : public nsIXPConnect, + public nsIThreadObserver, + public nsSupportsWeakReference, +- public nsIJSRuntimeService ++ public nsIJSRuntimeService, ++ public nsIJSContextStack { - AutoJSContext cx; - JSAutoCompartment ac(cx, aScope); - - nsresult rv; - xpcObjectHelper helper(aCOMObj, aCache); - if (!XPCConvert::NativeInterface2JSObject(aVal, aHolder, helper, aIID, - nullptr, aAllowWrapping, &rv)) -@@ -514,38 +515,38 @@ NativeInterface2JSObject(HandleObject aS - - return NS_OK; - } + public: + // all the interface method declarations... + NS_DECL_ISUPPORTS + NS_DECL_NSIXPCONNECT + NS_DECL_NSITHREADOBSERVER + NS_DECL_NSIJSRUNTIMESERVICE ++ NS_DECL_NSIJSCONTEXTSTACK - /* nsIXPConnectJSObjectHolder wrapNative (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDRef aIID); */ - NS_IMETHODIMP - nsXPConnect::WrapNative(JSContext * aJSContext, - JSObject * aScopeArg, -- nsISupports* aCOMObj, -+ nsISupports *aCOMObj, - const nsIID & aIID, -- nsIXPConnectJSObjectHolder** aHolder) -+ nsIXPConnectJSObjectHolder **aHolder) + // non-interface implementation + public: + // These get non-addref'd pointers + static nsXPConnect* XPConnect() + { + // Do a release-mode assert that we're not doing anything significant in + // XPConnect off the main thread. If you're an extension developer hitting +diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp +--- a/netwerk/base/ProxyAutoConfig.cpp ++++ b/netwerk/base/ProxyAutoConfig.cpp +@@ -411,17 +411,17 @@ bool PACDnsResolve(JSContext *cx, unsign { - MOZ_ASSERT(aHolder, "bad param"); - MOZ_ASSERT(aJSContext, "bad param"); - MOZ_ASSERT(aScopeArg, "bad param"); - MOZ_ASSERT(aCOMObj, "bad param"); - - RootedObject aScope(aJSContext, aScopeArg); - RootedValue v(aJSContext); - return NativeInterface2JSObject(aScope, aCOMObj, nullptr, &aIID, - true, &v, aHolder); - } + JS::CallArgs args = CallArgsFromVp(argc, vp); - /* void wrapNativeToJSVal (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDPtr aIID, out jsval aVal, out nsIXPConnectJSObjectHolder aHolder); */ - NS_IMETHODIMP --nsXPConnect::WrapNativeToJSVal(JSContext* aJSContext, -- JSObject* aScopeArg, -- nsISupports* aCOMObj, -- nsWrapperCache* aCache, -- const nsIID* aIID, -+nsXPConnect::WrapNativeToJSVal(JSContext *aJSContext, -+ JSObject *aScopeArg, -+ nsISupports *aCOMObj, -+ nsWrapperCache *aCache, -+ const nsIID *aIID, - bool aAllowWrapping, - MutableHandleValue aVal) - { - MOZ_ASSERT(aJSContext, "bad param"); - MOZ_ASSERT(aScopeArg, "bad param"); - MOZ_ASSERT(aCOMObj, "bad param"); - - RootedObject aScope(aJSContext, aScopeArg); -@@ -572,36 +573,36 @@ nsXPConnect::WrapJS(JSContext * aJSConte - nsresult rv = NS_ERROR_UNEXPECTED; - if (!XPCConvert::JSObject2NativeInterface(result, aJSObj, - &aIID, nullptr, &rv)) - return rv; - return NS_OK; - } + if (NS_IsMainThread()) { + NS_WARNING("DNS Resolution From PAC on Main Thread. How did that happen?"); + return false; + } - NS_IMETHODIMP --nsXPConnect::JSValToVariant(JSContext* cx, -+nsXPConnect::JSValToVariant(JSContext *cx, - HandleValue aJSVal, -- nsIVariant** aResult) -+ nsIVariant **aResult) - { - NS_PRECONDITION(aResult, "bad param"); +- if (!args.requireAtLeast(cx, "dnsResolve", 1)) ++ if (!JS::JS_RequireArgsAtLeast(cx, args, "dnsResolve", 1)) + return false; - nsRefPtr variant = XPCVariant::newVariant(cx, aJSVal); - variant.forget(aResult); - NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY); + JS::Rooted arg1(cx, JS::ToString(cx, args[0])); + if (!arg1) + return false; - return NS_OK; + nsAutoJSString hostName; + nsAutoCString dottedDecimal; +@@ -463,17 +463,17 @@ bool PACMyIpAddress(JSContext *cx, unsig } - /* void wrapJSAggregatedToNative (in nsISupports aOuter, in JSContextPtr aJSContext, in JSObjectPtr aJSObj, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */ - NS_IMETHODIMP --nsXPConnect::WrapJSAggregatedToNative(nsISupports* aOuter, -- JSContext* aJSContext, -- JSObject* aJSObjArg, -- const nsIID& aIID, -- void** result) -+nsXPConnect::WrapJSAggregatedToNative(nsISupports *aOuter, -+ JSContext *aJSContext, -+ JSObject *aJSObjArg, -+ const nsIID &aIID, -+ void **result) + // proxyAlert(msg) javascript implementation + static + bool PACProxyAlert(JSContext *cx, unsigned int argc, JS::Value *vp) { - MOZ_ASSERT(aOuter, "bad param"); - MOZ_ASSERT(aJSContext, "bad param"); - MOZ_ASSERT(aJSObjArg, "bad param"); - MOZ_ASSERT(result, "bad param"); - - *result = nullptr; - -@@ -612,17 +613,17 @@ nsXPConnect::WrapJSAggregatedToNative(ns - return rv; - return NS_OK; - } + JS::CallArgs args = CallArgsFromVp(argc, vp); - /* nsIXPConnectWrappedNative getWrappedNativeOfJSObject (in JSContextPtr aJSContext, in JSObjectPtr aJSObj); */ - NS_IMETHODIMP - nsXPConnect::GetWrappedNativeOfJSObject(JSContext * aJSContext, - JSObject * aJSObjArg, -- nsIXPConnectWrappedNative** _retval) -+ nsIXPConnectWrappedNative **_retval) - { - MOZ_ASSERT(aJSContext, "bad param"); - MOZ_ASSERT(aJSObjArg, "bad param"); - MOZ_ASSERT(_retval, "bad param"); +- if (!args.requireAtLeast(cx, "alert", 1)) ++ if (!JS::JS_RequireArgsAtLeast(cx, args, "alert", 1)) + return false; - RootedObject aJSObj(aJSContext, aJSObjArg); - aJSObj = js::CheckedUnwrap(aJSObj, /* stopAtOuter = */ false); - if (!aJSObj || !IS_WN_REFLECTOR(aJSObj)) { -@@ -632,45 +633,45 @@ nsXPConnect::GetWrappedNativeOfJSObject( + JS::Rooted arg1(cx, JS::ToString(cx, args[0])); + if (!arg1) + return false; - nsRefPtr temp = XPCWrappedNative::Get(aJSObj); - temp.forget(_retval); - return NS_OK; - } + nsAutoJSString message; + if (!message.init(cx, arg1)) +diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py +--- a/python/mozbuild/mozbuild/frontend/context.py ++++ b/python/mozbuild/mozbuild/frontend/context.py +@@ -408,16 +408,29 @@ VARIABLES = { + """, 'export'), - /* nsISupports getNativeOfWrapper(in JSContextPtr aJSContext, in JSObjectPtr aJSObj); */ - NS_IMETHODIMP_(nsISupports*) --nsXPConnect::GetNativeOfWrapper(JSContext* aJSContext, -- JSObject* aJSObj) -+nsXPConnect::GetNativeOfWrapper(JSContext *aJSContext, -+ JSObject *aJSObj) - { - MOZ_ASSERT(aJSContext, "bad param"); - MOZ_ASSERT(aJSObj, "bad param"); + 'SOURCES': (StrictOrderingOnAppendListWithFlagsFactory({'no_pgo': bool, 'flags': List}), list, + """Source code files. - aJSObj = js::CheckedUnwrap(aJSObj, /* stopAtOuter = */ false); - if (!aJSObj) { - JS_ReportError(aJSContext, "Permission denied to get native of security wrapper"); - return nullptr; - } - if (IS_WN_REFLECTOR(aJSObj)) { -- if (XPCWrappedNative* wn = XPCWrappedNative::Get(aJSObj)) -+ if (XPCWrappedNative *wn = XPCWrappedNative::Get(aJSObj)) - return wn->Native(); - return nullptr; - } + This variable contains a list of source code files to compile. + Accepts assembler, C, C++, Objective C/C++. + """, None), ++ ++ 'SOURCES_NOPCH': (StrictOrderingOnAppendList, list, ++ """Source code files. ++ ++ This variable contains a list of source code files not using ++ the precompiled header. ++ """, 'compile'), ++ ++ 'PCHHDR': (unicode, unicode, ++ "", None), ++ 'PCHSRC': (unicode, unicode, ++ "", None), ++ - nsCOMPtr canonical = - do_QueryInterface(mozilla::dom::UnwrapDOMObjectToISupports(aJSObj)); - return canonical; - } + 'GENERATED_SOURCES': (StrictOrderingOnAppendList, list, + """Generated source code files. - /* nsIXPConnectWrappedNative getWrappedNativeOfNativeObject (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDRef aIID); */ - NS_IMETHODIMP - nsXPConnect::GetWrappedNativeOfNativeObject(JSContext * aJSContext, - JSObject * aScopeArg, -- nsISupports* aCOMObj, -+ nsISupports *aCOMObj, - const nsIID & aIID, -- nsIXPConnectWrappedNative** _retval) -+ nsIXPConnectWrappedNative **_retval) - { - MOZ_ASSERT(aJSContext, "bad param"); - MOZ_ASSERT(aScopeArg, "bad param"); - MOZ_ASSERT(aCOMObj, "bad param"); - MOZ_ASSERT(_retval, "bad param"); - - *_retval = nullptr; - -@@ -697,97 +698,97 @@ nsXPConnect::GetWrappedNativeOfNativeObj - /* void reparentWrappedNativeIfFound (in JSContextPtr aJSContext, - * in JSObjectPtr aScope, - * in JSObjectPtr aNewParent, - * in nsISupports aCOMObj); */ - NS_IMETHODIMP - nsXPConnect::ReparentWrappedNativeIfFound(JSContext * aJSContext, - JSObject * aScopeArg, - JSObject * aNewParentArg, -- nsISupports* aCOMObj) -+ nsISupports *aCOMObj) - { - RootedObject aScope(aJSContext, aScopeArg); - RootedObject aNewParent(aJSContext, aNewParentArg); + This variable contains a list of generated source code files to + compile. Accepts assembler, C, C++, Objective C/C++. + """, None), - XPCWrappedNativeScope* scope = GetObjectScope(aScope); - XPCWrappedNativeScope* scope2 = GetObjectScope(aNewParent); - if (!scope || !scope2) - return UnexpectedFailure(NS_ERROR_FAILURE); - - RootedObject newParent(aJSContext, aNewParent); - return XPCWrappedNative:: - ReparentWrapperIfFound(scope, scope2, newParent, aCOMObj); - } - - static PLDHashOperator --MoveableWrapperFinder(PLDHashTable* table, PLDHashEntryHdr* hdr, -- uint32_t number, void* arg) -+MoveableWrapperFinder(PLDHashTable *table, PLDHashEntryHdr *hdr, -+ uint32_t number, void *arg) - { -- nsTArray >* array = -- static_cast >*>(arg); -- XPCWrappedNative* wn = ((Native2WrappedNativeMap::Entry*)hdr)->value; -+ nsTArray > *array = -+ static_cast > *>(arg); -+ XPCWrappedNative *wn = ((Native2WrappedNativeMap::Entry*)hdr)->value; - - // If a wrapper is expired, then there are no references to it from JS, so - // we don't have to move it. - if (!wn->IsWrapperExpired()) - array->AppendElement(wn); - return PL_DHASH_NEXT; - } - - /* void rescueOrphansInScope(in JSContextPtr aJSContext, in JSObjectPtr aScope); */ - NS_IMETHODIMP --nsXPConnect::RescueOrphansInScope(JSContext* aJSContext, JSObject* aScopeArg) -+nsXPConnect::RescueOrphansInScope(JSContext *aJSContext, JSObject *aScopeArg) - { - RootedObject aScope(aJSContext, aScopeArg); - -- XPCWrappedNativeScope* scope = GetObjectScope(aScope); -+ XPCWrappedNativeScope *scope = GetObjectScope(aScope); - if (!scope) - return UnexpectedFailure(NS_ERROR_FAILURE); - - // First, look through the old scope and find all of the wrappers that we - // might need to rescue. - nsTArray > wrappersToMove; - -- Native2WrappedNativeMap* map = scope->GetWrappedNativeMap(); -+ Native2WrappedNativeMap *map = scope->GetWrappedNativeMap(); - wrappersToMove.SetCapacity(map->Count()); - map->Enumerate(MoveableWrapperFinder, &wrappersToMove); - - // Now that we have the wrappers, reparent them to the new scope. - for (uint32_t i = 0, stop = wrappersToMove.Length(); i < stop; ++i) { - nsresult rv = wrappersToMove[i]->RescueOrphans(); - NS_ENSURE_SUCCESS(rv, rv); - } - - return NS_OK; - } - - /* void setDefaultSecurityManager (in nsIXPCSecurityManager aManager); */ - NS_IMETHODIMP --nsXPConnect::SetDefaultSecurityManager(nsIXPCSecurityManager* aManager) -+nsXPConnect::SetDefaultSecurityManager(nsIXPCSecurityManager *aManager) - { - mDefaultSecurityManager = aManager; - - nsCOMPtr ssm = - do_QueryInterface(mDefaultSecurityManager); - - // Remember the result of the above QI for fast access to the - // script securityt manager. - gScriptSecurityManager = ssm; - - return NS_OK; - } - - /* nsIStackFrame createStackFrameLocation (in uint32_t aLanguage, in string aFilename, in string aFunctionName, in int32_t aLineNumber, in nsIStackFrame aCaller); */ - NS_IMETHODIMP - nsXPConnect::CreateStackFrameLocation(uint32_t aLanguage, -- const char* aFilename, -- const char* aFunctionName, -+ const char *aFilename, -+ const char *aFunctionName, - int32_t aLineNumber, -- nsIStackFrame* aCaller, -- nsIStackFrame** _retval) -+ nsIStackFrame *aCaller, -+ nsIStackFrame **_retval) - { - MOZ_ASSERT(_retval, "bad param"); - - nsCOMPtr stackFrame = - exceptions::CreateStackFrameLocation(aLanguage, - aFilename, - aFunctionName, - aLineNumber, -@@ -816,27 +817,27 @@ nsXPConnect::GetCurrentNativeCallContext - - *aCurrentNativeCallContext = XPCJSRuntime::Get()->GetCallContext(); - return NS_OK; - } - - /* void setFunctionThisTranslator (in nsIIDRef aIID, in nsIXPCFunctionThisTranslator aTranslator); */ - NS_IMETHODIMP - nsXPConnect::SetFunctionThisTranslator(const nsIID & aIID, -- nsIXPCFunctionThisTranslator* aTranslator) -+ nsIXPCFunctionThisTranslator *aTranslator) - { - XPCJSRuntime* rt = GetRuntime(); - IID2ThisTranslatorMap* map = rt->GetThisTranslatorMap(); - map->Add(aIID, aTranslator); - return NS_OK; - } - - NS_IMETHODIMP --nsXPConnect::CreateSandbox(JSContext* cx, nsIPrincipal* principal, -- nsIXPConnectJSObjectHolder** _retval) -+nsXPConnect::CreateSandbox(JSContext *cx, nsIPrincipal *principal, -+ nsIXPConnectJSObjectHolder **_retval) - { - *_retval = nullptr; - - RootedValue rval(cx); - SandboxOptions options; - nsresult rv = CreateSandboxObject(cx, &rval, principal, options); - MOZ_ASSERT(NS_FAILED(rv) || !JSVAL_IS_PRIMITIVE(rval), - "Bad return value from xpc_CreateSandboxObject()!"); -@@ -847,18 +848,18 @@ nsXPConnect::CreateSandbox(JSContext* cx - - NS_ADDREF(*_retval); - } - - return rv; - } - - NS_IMETHODIMP --nsXPConnect::EvalInSandboxObject(const nsAString& source, const char* filename, -- JSContext* cx, JSObject* sandboxArg, -+nsXPConnect::EvalInSandboxObject(const nsAString& source, const char *filename, -+ JSContext *cx, JSObject *sandboxArg, - bool returnStringOnly, MutableHandleValue rval) - { - if (!sandboxArg) - return NS_ERROR_INVALID_ARG; - - RootedObject sandbox(cx, sandboxArg); - nsCString filenameStr; - if (filename) { -@@ -869,18 +870,18 @@ nsXPConnect::EvalInSandboxObject(const n - return EvalInSandbox(cx, sandbox, source, filenameStr, 1, - JSVERSION_DEFAULT, returnStringOnly, rval); - } - - /* nsIXPConnectJSObjectHolder getWrappedNativePrototype (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsIClassInfo aClassInfo); */ - NS_IMETHODIMP - nsXPConnect::GetWrappedNativePrototype(JSContext * aJSContext, - JSObject * aScopeArg, -- nsIClassInfo* aClassInfo, -- nsIXPConnectJSObjectHolder** _retval) -+ nsIClassInfo *aClassInfo, -+ nsIXPConnectJSObjectHolder **_retval) - { - RootedObject aScope(aJSContext, aScopeArg); - JSAutoCompartment ac(aJSContext, aScope); - - XPCWrappedNativeScope* scope = GetObjectScope(aScope); - if (!scope) - return UnexpectedFailure(NS_ERROR_FAILURE); - -@@ -922,17 +923,17 @@ nsXPConnect::DebugDump(int16_t depth) - XPCWrappedNativeScope::DebugDumpAllScopes(depth); - XPC_LOG_OUTDENT(); - #endif - return NS_OK; - } - - /* void debugDumpObject (in nsISupports aCOMObj, in short depth); */ - NS_IMETHODIMP --nsXPConnect::DebugDumpObject(nsISupports* p, int16_t depth) -+nsXPConnect::DebugDumpObject(nsISupports *p, int16_t depth) - { - #ifdef DEBUG - if (!depth) - return NS_OK; - if (!p) { - XPC_LOG_ALWAYS(("*** Cound not dump object with NULL address")); - return NS_OK; - } -@@ -994,17 +995,17 @@ nsXPConnect::DebugPrintJSStack(bool show - else - return xpc_PrintJSStack(cx, showArgs, showLocals, showThisProps); - - return nullptr; - } +diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py +--- a/python/mozbuild/mozbuild/frontend/emitter.py ++++ b/python/mozbuild/mozbuild/frontend/emitter.py +@@ -416,16 +416,19 @@ class TreeMetadataEmitter(LoggingMixin): + 'NO_DIST_INSTALL', + 'PYTHON_UNIT_TESTS', + 'RCFILE', + 'RESFILE', + 'RCINCLUDE', + 'DEFFILE', + 'WIN32_EXE_LDFLAGS', + 'LD_VERSION_SCRIPT', ++ 'SOURCES_NOPCH', ++ 'PCHHDR', ++ 'PCHSRC', + ] + for v in varlist: + if v in context and context[v]: + passthru.variables[v] = context[v] - /* void debugDumpEvalInJSStackFrame (in uint32_t aFrameNumber, in string aSourceText); */ - NS_IMETHODIMP --nsXPConnect::DebugDumpEvalInJSStackFrame(uint32_t aFrameNumber, const char* aSourceText) -+nsXPConnect::DebugDumpEvalInJSStackFrame(uint32_t aFrameNumber, const char *aSourceText) - { - JSContext* cx = GetCurrentJSContext(); - if (!cx) - printf("there is no JSContext on the nsIThreadJSContextStack!\n"); + if context.config.substs.get('OS_TARGET') == 'WINNT' and \ + context['DELAYLOAD_DLLS']: + context['LDFLAGS'].extend([('-DELAYLOAD:%s' % dll) +diff --git a/security/nss/coreconf/WIN32.mk b/security/nss/coreconf/WIN32.mk +--- a/security/nss/coreconf/WIN32.mk ++++ b/security/nss/coreconf/WIN32.mk +@@ -106,19 +106,19 @@ ifdef NS_USE_GCC + # The -mnop-fun-dllimport flag allows us to avoid a drawback of + # the dllimport attribute that a pointer to a function marked as + # dllimport cannot be used as as a constant address. + OS_CFLAGS += -mwindows -mms-bitfields -mnop-fun-dllimport + _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY) + DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB)) + ifdef BUILD_OPT + ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) +- OPTIMIZER += -Os ++ OPTIMIZER += -Os -GFL -Gw + else +- OPTIMIZER += -O2 ++ OPTIMIZER += -O2 -GFL -Gw + endif + DEFINES += -UDEBUG -U_DEBUG -DNDEBUG else - xpc_DumpEvalInJSStackFrame(cx, aFrameNumber, aSourceText); - - return NS_OK; -@@ -1043,32 +1044,32 @@ nsXPConnect::JSToVariant(JSContext* ctx, - variant.forget(_retval); - if (!(*_retval)) - return NS_ERROR_FAILURE; - - return NS_OK; - } - - NS_IMETHODIMP --nsXPConnect::OnProcessNextEvent(nsIThreadInternal* aThread, bool aMayWait, -+nsXPConnect::OnProcessNextEvent(nsIThreadInternal *aThread, bool aMayWait, - uint32_t aRecursionDepth) - { - // Record this event. - mEventDepth++; - - // Push a null JSContext so that we don't see any script during - // event processing. - MOZ_ASSERT(NS_IsMainThread()); - bool ok = PushJSContextNoScriptContext(nullptr); - NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE); - return NS_OK; - } - - NS_IMETHODIMP --nsXPConnect::AfterProcessNextEvent(nsIThreadInternal* aThread, -+nsXPConnect::AfterProcessNextEvent(nsIThreadInternal *aThread, - uint32_t aRecursionDepth, - bool aEventWasProcessed) - { - // Watch out for unpaired events during observer registration. - if (MOZ_UNLIKELY(mEventDepth == 0)) - return NS_OK; - mEventDepth--; - -@@ -1105,22 +1106,22 @@ nsXPConnect::SetReportAllJSExceptions(bo - if (gReportAllJSExceptions != 1) - gReportAllJSExceptions = newval ? 2 : 0; - - return NS_OK; - } - - /* attribute JSRuntime runtime; */ - NS_IMETHODIMP --nsXPConnect::GetRuntime(JSRuntime** runtime) -+nsXPConnect::GetRuntime(JSRuntime **runtime) - { - if (!runtime) - return NS_ERROR_NULL_POINTER; - -- JSRuntime* rt = GetRuntime()->Runtime(); -+ JSRuntime *rt = GetRuntime()->Runtime(); - JS_AbortIfWrongThread(rt); - *runtime = rt; - return NS_OK; - } - - /* [noscript, notxpcom] void registerGCCallback(in xpcGCCallback func); */ - NS_IMETHODIMP_(void) - nsXPConnect::RegisterGCCallback(xpcGCCallback func) -@@ -1146,17 +1147,17 @@ nsXPConnect::RegisterContextCallback(xpc - NS_IMETHODIMP_(void) - nsXPConnect::UnregisterContextCallback(xpcContextCallback func) - { - mRuntime->RemoveContextCallback(func); - } - - #ifdef MOZ_JSDEBUGGER - void --nsXPConnect::CheckForDebugMode(JSRuntime* rt) -+nsXPConnect::CheckForDebugMode(JSRuntime *rt) - { - if (gDebugMode == gDesiredDebugMode) { - return; - } - - // This can happen if a Worker is running, but we don't have the ability to - // debug workers right now, so just return. - if (!NS_IsMainThread()) -@@ -1192,17 +1193,17 @@ fail: - * debugger callbacks from having any effect. - */ - if (gDesiredDebugMode) - JS_SetRuntimeDebugMode(rt, false); - gDesiredDebugMode = gDebugMode = false; - } - #else //MOZ_JSDEBUGGER not defined - void --nsXPConnect::CheckForDebugMode(JSRuntime* rt) -+nsXPConnect::CheckForDebugMode(JSRuntime *rt) - { - gDesiredDebugMode = gDebugMode = false; - } - #endif //#ifdef MOZ_JSDEBUGGER - - - void - xpc_ActivateDebugMode() -@@ -1231,134 +1232,148 @@ JSContext* - nsXPConnect::GetSafeJSContext() - { - return GetRuntime()->GetJSContextStack()->GetSafeJSContext(); - } - - namespace xpc { - - bool --PushJSContextNoScriptContext(JSContext* aCx) -+PushJSContextNoScriptContext(JSContext *aCx) - { -- MOZ_ASSERT_IF(aCx, !GetScriptContextFromJSContext(aCx)); -+ //MOZ_ASSERT_IF(aCx, !GetScriptContextFromJSContext(aCx)); - return XPCJSRuntime::Get()->GetJSContextStack()->Push(aCx); - } - - void - PopJSContextNoScriptContext() - { - XPCJSRuntime::Get()->GetJSContextStack()->Pop(); - } - - } // namespace xpc - - nsIPrincipal* - nsXPConnect::GetPrincipal(JSObject* obj, bool allowShortCircuit) const - { - MOZ_ASSERT(IS_WN_REFLECTOR(obj), "What kind of wrapper is this?"); - -- XPCWrappedNative* xpcWrapper = XPCWrappedNative::Get(obj); -+ XPCWrappedNative *xpcWrapper = XPCWrappedNative::Get(obj); - if (xpcWrapper) { - if (allowShortCircuit) { -- nsIPrincipal* result = xpcWrapper->GetObjectPrincipal(); -+ nsIPrincipal *result = xpcWrapper->GetObjectPrincipal(); - if (result) { - return result; - } - } - - // If not, check if it points to an nsIScriptObjectPrincipal - nsCOMPtr objPrin = - do_QueryInterface(xpcWrapper->Native()); - if (objPrin) { -- nsIPrincipal* result = objPrin->GetPrincipal(); -+ nsIPrincipal *result = objPrin->GetPrincipal(); - if (result) { - return result; - } - } - } - - return nullptr; - } - - NS_IMETHODIMP --nsXPConnect::HoldObject(JSContext* aJSContext, JSObject* aObjectArg, -- nsIXPConnectJSObjectHolder** aHolder) -+nsXPConnect::Push(JSContext *aJSContext) -+{ -+ return PushJSContextNoScriptContext(aJSContext) ? NS_OK : NS_ERROR_FAILURE; -+} -+ -+NS_IMETHODIMP -+nsXPConnect::Pop(JSContext **aJSContext) -+{ -+ PopJSContextNoScriptContext();//*aJSContext = XPCJSRuntime::Get()->GetJSContextStack()->Pop(); -+ return NS_OK; -+} -+ -+ -+NS_IMETHODIMP -+nsXPConnect::HoldObject(JSContext *aJSContext, JSObject *aObjectArg, -+ nsIXPConnectJSObjectHolder **aHolder) - { - RootedObject aObject(aJSContext, aObjectArg); - XPCJSObjectHolder* objHolder = XPCJSObjectHolder::newHolder(aObject); - if (!objHolder) - return NS_ERROR_OUT_OF_MEMORY; - - NS_ADDREF(*aHolder = objHolder); - return NS_OK; - } - - namespace xpc { - - bool --Base64Encode(JSContext* cx, HandleValue val, MutableHandleValue out) -+Base64Encode(JSContext *cx, HandleValue val, MutableHandleValue out) - { - MOZ_ASSERT(cx); - - JS::RootedValue root(cx, val); - xpc_qsACString encodedString(cx, root, &root, false, - xpc_qsACString::eStringify, - xpc_qsACString::eStringify); - if (!encodedString.IsValid()) - return false; - - nsAutoCString result; - if (NS_FAILED(mozilla::Base64Encode(encodedString, result))) { - JS_ReportError(cx, "Failed to encode base64 data!"); - return false; - } - -- JSString* str = JS_NewStringCopyN(cx, result.get(), result.Length()); -+ JSString *str = JS_NewStringCopyN(cx, result.get(), result.Length()); - if (!str) - return false; - - out.setString(str); - return true; - } - - bool --Base64Decode(JSContext* cx, HandleValue val, MutableHandleValue out) -+Base64Decode(JSContext *cx, HandleValue val, MutableHandleValue out) - { - MOZ_ASSERT(cx); - - JS::RootedValue root(cx, val); - xpc_qsACString encodedString(cx, root, &root, false, - xpc_qsACString::eStringify, - xpc_qsACString::eStringify); - if (!encodedString.IsValid()) - return false; - - nsAutoCString result; - if (NS_FAILED(mozilla::Base64Decode(encodedString, result))) { - JS_ReportError(cx, "Failed to decode base64 string!"); - return false; - } - -- JSString* str = JS_NewStringCopyN(cx, result.get(), result.Length()); -+ JSString *str = JS_NewStringCopyN(cx, result.get(), result.Length()); - if (!str) - return false; - - out.setString(str); - return true; - } - - void --SetLocationForGlobal(JSObject* global, const nsACString& location) -+SetLocationForGlobal(JSObject *global, const nsACString& location) - { - MOZ_ASSERT(global); - EnsureCompartmentPrivate(global)->SetLocation(location); - } - - void --SetLocationForGlobal(JSObject* global, nsIURI* locationURI) -+SetLocationForGlobal(JSObject *global, nsIURI *locationURI) - { - MOZ_ASSERT(global); - EnsureCompartmentPrivate(global)->SetLocationURI(locationURI); - } - - } // namespace xpc - - NS_IMETHODIMP -@@ -1377,31 +1392,31 @@ nsXPConnect::NotifyDidPaint() - return NS_OK; - } - - // Note - We used to have HAS_PRINCIPALS_FLAG = 1 here, so reusing that flag - // will require bumping the XDR version number. - static const uint8_t HAS_ORIGIN_PRINCIPALS_FLAG = 2; - - static nsresult --WriteScriptOrFunction(nsIObjectOutputStream* stream, JSContext* cx, -- JSScript* scriptArg, HandleObject functionObj) -+WriteScriptOrFunction(nsIObjectOutputStream *stream, JSContext *cx, -+ JSScript *scriptArg, HandleObject functionObj) - { - // Exactly one of script or functionObj must be given - MOZ_ASSERT(!scriptArg != !functionObj); - - RootedScript script(cx, scriptArg); - if (!script) { - RootedFunction fun(cx, JS_GetObjectFunction(functionObj)); - script.set(JS_GetFunctionScript(cx, fun)); - } - -- nsIPrincipal* principal = -+ nsIPrincipal *principal = - nsJSPrincipals::get(JS_GetScriptPrincipals(script)); -- nsIPrincipal* originPrincipal = -+ nsIPrincipal *originPrincipal = - nsJSPrincipals::get(JS_GetScriptOriginPrincipals(script)); - - uint8_t flags = 0; - - // Optimize for the common case when originPrincipals == principals. As - // originPrincipals is set to principals when the former is null we can - // simply skip the originPrincipals when they are the same as principals. - if (originPrincipal && originPrincipal != principal) -@@ -1426,25 +1441,25 @@ WriteScriptOrFunction(nsIObjectOutputStr - data = JS_EncodeScript(cx, script, &size); - } - - if (!data) - return NS_ERROR_OUT_OF_MEMORY; - MOZ_ASSERT(size); - rv = stream->Write32(size); - if (NS_SUCCEEDED(rv)) -- rv = stream->WriteBytes(static_cast(data), size); -+ rv = stream->WriteBytes(static_cast(data), size); - js_free(data); - - return rv; - } - - static nsresult --ReadScriptOrFunction(nsIObjectInputStream* stream, JSContext* cx, -- JSScript** scriptp, JSObject** functionObjp) -+ReadScriptOrFunction(nsIObjectInputStream *stream, JSContext *cx, -+ JSScript **scriptp, JSObject **functionObjp) - { - // Exactly one of script or functionObj must be given - MOZ_ASSERT(!scriptp != !functionObjp); - - uint8_t flags; - nsresult rv = stream->Read8(&flags); - if (NS_FAILED(rv)) - return rv; -@@ -1467,64 +1482,64 @@ ReadScriptOrFunction(nsIObjectInputStrea - - char* data; - rv = stream->ReadBytes(size, &data); - if (NS_FAILED(rv)) - return rv; - - { - if (scriptp) { -- JSScript* script = JS_DecodeScript(cx, data, size, originPrincipal); -+ JSScript *script = JS_DecodeScript(cx, data, size, originPrincipal); - if (!script) - rv = NS_ERROR_OUT_OF_MEMORY; - else - *scriptp = script; - } else { -- JSObject* funobj = JS_DecodeInterpretedFunction(cx, data, size, -+ JSObject *funobj = JS_DecodeInterpretedFunction(cx, data, size, - originPrincipal); - if (!funobj) - rv = NS_ERROR_OUT_OF_MEMORY; - else - *functionObjp = funobj; - } - } - - nsMemory::Free(data); - return rv; - } - - NS_IMETHODIMP --nsXPConnect::WriteScript(nsIObjectOutputStream* stream, JSContext* cx, JSScript* script) -+nsXPConnect::WriteScript(nsIObjectOutputStream *stream, JSContext *cx, JSScript *script) - { - return WriteScriptOrFunction(stream, cx, script, NullPtr()); - } - - NS_IMETHODIMP --nsXPConnect::ReadScript(nsIObjectInputStream* stream, JSContext* cx, JSScript** scriptp) -+nsXPConnect::ReadScript(nsIObjectInputStream *stream, JSContext *cx, JSScript **scriptp) - { - return ReadScriptOrFunction(stream, cx, scriptp, nullptr); - } - - NS_IMETHODIMP --nsXPConnect::WriteFunction(nsIObjectOutputStream* stream, JSContext* cx, JSObject* functionObjArg) -+nsXPConnect::WriteFunction(nsIObjectOutputStream *stream, JSContext *cx, JSObject *functionObjArg) - { - RootedObject functionObj(cx, functionObjArg); - return WriteScriptOrFunction(stream, cx, nullptr, functionObj); - } - - NS_IMETHODIMP --nsXPConnect::ReadFunction(nsIObjectInputStream* stream, JSContext* cx, JSObject** functionObjp) -+nsXPConnect::ReadFunction(nsIObjectInputStream *stream, JSContext *cx, JSObject **functionObjp) - { - return ReadScriptOrFunction(stream, cx, nullptr, functionObjp); - } - - NS_IMETHODIMP --nsXPConnect::MarkErrorUnreported(JSContext* cx) -+nsXPConnect::MarkErrorUnreported(JSContext *cx) - { -- XPCContext* xpcc = XPCContext::GetXPCContext(cx); -+ XPCContext *xpcc = XPCContext::GetXPCContext(cx); - xpcc->MarkErrorUnreported(); - return NS_OK; - } - - /* These are here to be callable from a debugger */ - extern "C" { - JS_EXPORT_API(void) DumpJSStack() - { -@@ -1574,37 +1589,37 @@ JS_EXPORT_API(void) DumpCompleteHeap() - nsJSContext::CycleCollectNow(alltracesListener); - } - - } // extern "C" - - namespace xpc { - - bool --Atob(JSContext* cx, unsigned argc, Value* vp) -+Atob(JSContext *cx, unsigned argc, Value *vp) - { - CallArgs args = CallArgsFromVp(argc, vp); - if (!args.length()) - return true; - - return xpc::Base64Decode(cx, args[0], args.rval()); - } - - bool --Btoa(JSContext* cx, unsigned argc, Value* vp) -+Btoa(JSContext *cx, unsigned argc, Value *vp) - { - CallArgs args = CallArgsFromVp(argc, vp); - if (!args.length()) - return true; - - return xpc::Base64Encode(cx, args[0], args.rval()); - } - - bool --IsXrayWrapper(JSObject* obj) -+IsXrayWrapper(JSObject *obj) - { - return WrapperFactory::IsXrayWrapper(obj); - } - - } // namespace xpc - - namespace mozilla { - namespace dom { -diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h ---- a/js/xpconnect/src/xpcprivate.h -+++ b/js/xpconnect/src/xpcprivate.h -@@ -104,16 +104,17 @@ - #include "nsIComponentRegistrar.h" - #include "nsISupportsPrimitives.h" - #include "nsMemory.h" - #include "nsIXPConnect.h" - #include "nsIInterfaceInfo.h" - #include "nsIXPCScriptable.h" - #include "nsIXPCSecurityManager.h" - #include "nsIJSRuntimeService.h" -+#include "nsIJSContextStack.h" - #include "nsWeakReference.h" - #include "nsCOMPtr.h" - #include "nsXPTCUtils.h" - #include "xptinfo.h" - #include "XPCForwards.h" - #include "XPCLog.h" - #include "xpccomponents.h" - #include "xpcexception.h" -@@ -246,25 +247,27 @@ inline bool - AddToCCKind(JSGCTraceKind kind) - { - return kind == JSTRACE_OBJECT || kind == JSTRACE_SCRIPT; - } - - class nsXPConnect : public nsIXPConnect, - public nsIThreadObserver, - public nsSupportsWeakReference, -- public nsIJSRuntimeService -+ public nsIJSRuntimeService, -+ public nsIJSContextStack - { - public: - // all the interface method declarations... - NS_DECL_ISUPPORTS - NS_DECL_NSIXPCONNECT - NS_DECL_NSITHREADOBSERVER - NS_DECL_NSIJSRUNTIMESERVICE -- -+ NS_DECL_NSIJSCONTEXTSTACK -+ - // non-interface implementation - public: - // These get non-addref'd pointers - static nsXPConnect* XPConnect() - { - // Do a release-mode assert that we're not doing anything significant in - // XPConnect off the main thread. If you're an extension developer hitting - // this, you need to change your code. See bug 716167. -diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp ---- a/layout/base/nsPresShell.cpp -+++ b/layout/base/nsPresShell.cpp -@@ -10106,29 +10106,30 @@ PresShell::SetIsActive(bool aIsActive) - // - // PresShell::SetIsActive() is the first C++ entry point at which we - // (i) know that our parent process wants our content to be hidden; - // and (ii) has easy access to the TabChild. So we use this - // notification to signal the TabChild to drop its layer tree and - // stop trying to repaint. - if (TabChild* tab = TabChild::GetFrom(this)) { - if (aIsActive) { -- tab->MakeVisible(); -- if (!mIsZombie) { -- if (nsIFrame* root = mFrameConstructor->GetRootFrame()) { -- FrameLayerBuilder::InvalidateAllLayersForFrame( -- nsLayoutUtils::GetDisplayRootFrame(root)); -- root->SchedulePaint(); -- } -- } -+ tab->MakeVisible(); - } else { - tab->MakeHidden(); - } - } - -+ if (aIsActive && !mIsZombie) { -+ if (nsIFrame* root = mFrameConstructor->GetRootFrame()) { -+ FrameLayerBuilder::InvalidateAllLayersForFrame( -+ nsLayoutUtils::GetDisplayRootFrame(root)); -+ root->SchedulePaint(); -+ } -+ } -+ - return rv; - } - - /* - * Determines the current image locking state. Called when one of the - * dependent factors changes. - */ - nsresult -diff --git a/media/libvpx/Makefile.in b/media/libvpx/Makefile.in ---- a/media/libvpx/Makefile.in -+++ b/media/libvpx/Makefile.in -@@ -89,24 +89,32 @@ EXTRA_MDDEPEND_FILES = vp8_asm_enc_offse - - include $(topsrcdir)/config/rules.mk - - quantize_sse4.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm - quantize_ssse3.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm - - ifdef VPX_NEED_OBJ_INT_EXTRACT - -+ifeq (WINNT_,$(OS_TARGET)_$(GNU_CC)) -+vpx_scale_asm_offsets.$(OBJ_SUFFIX): CFLAGS += -GL- -+endif -+ - vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM) - ./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \ - $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@ - - # Filter out this object, because we don't want to link against it. - # It was generated solely so it could be parsed by obj_int_extract. - OBJS := $(filter-out vpx_scale_asm_offsets.$(OBJ_SUFFIX),$(OBJS)) - -+ifeq (WINNT_,$(OS_TARGET)_$(GNU_CC)) -+vp8_asm_enc_offsets.$(OBJ_SUFFIX): CFLAGS += -GL- -+endif -+ - vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM) - ./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \ - $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@ - - # Filter out this object, because we don't want to link against it. - # It was generated solely so it could be parsed by obj_int_extract. - OBJS := $(filter-out vp8_asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS)) - -diff --git a/media/libvpx/moz.build b/media/libvpx/moz.build ---- a/media/libvpx/moz.build -+++ b/media/libvpx/moz.build -@@ -1,16 +1,16 @@ - # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- - # vim: set filetype=python: - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - - include('sources.mozbuild') -- -+NO_PGO = True - EXPORTS.vpx += files['EXPORTS'] - - if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']: - HOST_SOURCES += [ - 'build/make/obj_int_extract.c', - ] - - HOST_PROGRAM = 'host_obj_int_extract' -@@ -25,19 +25,19 @@ if CONFIG['MOZ_VPX_ERROR_CONCEALMENT']: - SOURCES += files['ERROR_CONCEALMENT'] - - if CONFIG['VPX_X86_ASM'] and CONFIG['OS_TARGET'] == 'WINNT': - offset_sources = [ - 'vp8/encoder/vp8_asm_enc_offsets.c', - 'vpx_scale/vpx_scale_asm_offsets.c', - ] - SOURCES += offset_sources -- if CONFIG['_MSC_VER']: -- for s in offset_sources: -- SOURCES[s].no_pgo = True -+ #if CONFIG['_MSC_VER']: -+ # for s in offset_sources: -+ # SOURCES[s].no_pgo = True - - if CONFIG['VPX_X86_ASM']: - SOURCES += files['X86_ASM'] - - if '64' in CONFIG['OS_TEST']: - SOURCES += files['X86-64_ASM'] - - # AVX2 only supported on -diff --git a/media/webrtc/moz.build b/media/webrtc/moz.build ---- a/media/webrtc/moz.build -+++ b/media/webrtc/moz.build -@@ -1,16 +1,18 @@ - # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- - # vim: set filetype=python: - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - - include('/build/gyp.mozbuild') - -+NO_PGO = True -+ - webrtc_non_unified_sources = [ - 'trunk/webrtc/common_audio/vad/vad_core.c', # Because of name clash in the kInitCheck variable - 'trunk/webrtc/common_audio/vad/webrtc_vad.c', # Because of name clash in the kInitCheck variable - 'trunk/webrtc/modules/audio_coding/codecs/g722/g722_decode.c', # Because of name clash in the saturate function - 'trunk/webrtc/modules/audio_coding/codecs/g722/g722_encode.c', # Because of name clash in the saturate function - 'trunk/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c', # Because of name clash in the kDampFilter variable - 'trunk/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c', # Because of name clash in the kDampFilter variable - 'trunk/webrtc/modules/audio_coding/neteq4/audio_vector.cc', # Because of explicit template specializations -diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py ---- a/python/mozbuild/mozbuild/frontend/emitter.py -+++ b/python/mozbuild/mozbuild/frontend/emitter.py -@@ -238,16 +238,19 @@ class TreeMetadataEmitter(LoggingMixin): - 'NO_DIST_INSTALL', - 'OS_LIBS', - 'RCFILE', - 'RESFILE', - 'RCINCLUDE', - 'DEFFILE', - 'SDK_LIBRARY', - 'WIN32_EXE_LDFLAGS', -+ 'SOURCES_NOPCH', -+ 'PCHHDR', -+ 'PCHSRC', - ] - for v in varlist: - if v in sandbox and sandbox[v]: - passthru.variables[v] = sandbox[v] - - for v in ['CFLAGS', 'CXXFLAGS', 'CMFLAGS', 'CMMFLAGS', 'LDFLAGS']: - if v in sandbox and sandbox[v]: - passthru.variables['MOZBUILD_' + v] = sandbox[v] -diff --git a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py ---- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py -+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py -@@ -85,16 +85,28 @@ VARIABLES = { - """, 'export'), - - 'SOURCES': (StrictOrderingOnAppendListWithFlagsFactory({'no_pgo': bool, 'flags': list}), list, - """Source code files. - - This variable contains a list of source code files to compile. - Accepts assembler, C, C++, Objective C/C++. - """, 'compile'), -+ -+ 'SOURCES_NOPCH': (StrictOrderingOnAppendList, list, -+ """Source code files. -+ -+ This variable contains a list of source code files not using -+ the precompiled header. -+ """, 'compile'), -+ -+ 'PCHHDR': (unicode, unicode, -+ "", None), -+ 'PCHSRC': (unicode, unicode, -+ "", None), - - 'GENERATED_SOURCES': (StrictOrderingOnAppendList, list, - """Generated source code files. - - This variable contains a list of generated source code files to - compile. Accepts assembler, C, C++, Objective C/C++. - """, 'compile'), - -diff --git a/security/nss/coreconf/WIN32.mk b/security/nss/coreconf/WIN32.mk ---- a/security/nss/coreconf/WIN32.mk -+++ b/security/nss/coreconf/WIN32.mk -@@ -106,19 +106,19 @@ ifdef NS_USE_GCC - # The -mnop-fun-dllimport flag allows us to avoid a drawback of - # the dllimport attribute that a pointer to a function marked as - # dllimport cannot be used as as a constant address. - OS_CFLAGS += -mwindows -mms-bitfields -mnop-fun-dllimport - _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY) - DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB)) - ifdef BUILD_OPT - ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) -- OPTIMIZER += -Os -+ OPTIMIZER += -Os -GFL - else -- OPTIMIZER += -O2 -+ OPTIMIZER += -O2 -GFL - endif - DEFINES += -UDEBUG -U_DEBUG -DNDEBUG - else - OPTIMIZER += -g - NULLSTRING := - SPACE := $(NULLSTRING) # end of the line - USERNAME := $(subst $(SPACE),_,$(USERNAME)) - USERNAME := $(subst -,_,$(USERNAME)) -diff --git a/security/nss/coreconf/command.mk b/security/nss/coreconf/command.mk ---- a/security/nss/coreconf/command.mk -+++ b/security/nss/coreconf/command.mk -@@ -6,17 +6,17 @@ - ####################################################################### - # Master "Core Components" default command macros; # - # can be overridden in .mk # - ####################################################################### + OPTIMIZER += -g + NULLSTRING := + SPACE := $(NULLSTRING) # end of the line + USERNAME := $(subst $(SPACE),_,$(USERNAME)) + USERNAME := $(subst -,_,$(USERNAME)) +diff --git a/security/nss/coreconf/command.mk b/security/nss/coreconf/command.mk +--- a/security/nss/coreconf/command.mk ++++ b/security/nss/coreconf/command.mk +@@ -6,17 +6,17 @@ + ####################################################################### + # Master "Core Components" default command macros; # + # can be overridden in .mk # + ####################################################################### AS = $(CC) ASFLAGS += $(CFLAGS) @@ -1940,1286 +1008,87 @@ diff --git a/security/nss/lib/freebl/Makefile b/security/nss/lib/freebl/Makefile DEFINES += -DMP_ASSEMBLY_DIV_2DX1D -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD ifdef BUILD_OPT - OPTIMIZER += -Ox # maximum optimization for freebl -+ OPTIMIZER += -Ox -GFL # maximum optimization for freebl ++ OPTIMIZER += -Ox -GFL # maximum optimization for freebl endif # The Intel AES assembly code requires Visual C++ 2010. # if $(_MSC_VER) >= 1600 (Visual C++ 2010) ifeq ($(firstword $(sort $(_MSC_VER) 1600)),1600) DEFINES += -DUSE_HW_AES -DINTEL_GCM - ASFILES += intel-aes-x86-masm.asm intel-gcm-x86-masm.asm - EXTRA_SRCS += intel-gcm-wrap.c - ifeq ($(CLANG_CL),1) -@@ -150,17 +150,17 @@ else - # -DMP_NO_MP_WORD - DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN - ifdef NS_USE_GCC - # Ideally, we should use amd64 assembly code, but it's not yet mingw-w64 - # compatible. - else - # MSVC - ifdef BUILD_OPT -- OPTIMIZER += -Ox # maximum optimization for freebl -+ OPTIMIZER += -Ox -GFL # maximum optimization for freebl - endif - ASFILES = arcfour-amd64-masm.asm mpi_amd64_masm.asm mp_comba_amd64_masm.asm - DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY - DEFINES += -DNSS_USE_COMBA - # The Intel AES assembly code requires Visual C++ 2010 (10.0). The _xgetbv - # compiler intrinsic function requires Visual C++ 2010 (10.0) SP1. - ifeq ($(_MSC_VER_GE_10SP1),1) - DEFINES += -DUSE_HW_AES -DINTEL_GCM -diff --git a/security/nss/lib/freebl/mpi/Makefile.win b/security/nss/lib/freebl/mpi/Makefile.win ---- a/security/nss/lib/freebl/mpi/Makefile.win -+++ b/security/nss/lib/freebl/mpi/Makefile.win -@@ -43,17 +43,17 @@ else - AS_SRCS = mpi_x86.asm - MPICMN += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE -DMP_ASSEMBLY_DIV_2DX1D - #CFLAGS= -Od -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC \ - -DDEBUG -D_DEBUG -UNDEBUG -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) - #CFLAGS = -O2 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ - -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) - #CFLAGS = -Od -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ - -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) --CFLAGS = -O2 -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ -+CFLAGS = -O2 -GFL -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ - -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) - ASFLAGS = -Cp -Sn -Zi -coff -I. - endif - - ## - ## Define LIBS to include any libraries you need to link against. - ## If NO_TABLE is define, LIBS should include '-lm' or whatever is - ## necessary to bring in the math library. Otherwise, it can be -diff --git a/toolkit/components/places/nsFaviconService.cpp b/toolkit/components/places/nsFaviconService.cpp ---- a/toolkit/components/places/nsFaviconService.cpp -+++ b/toolkit/components/places/nsFaviconService.cpp -@@ -1,613 +1,698 @@ --/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ --/* This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -- --/** -- * This is the favicon service, which stores favicons for web pages with your -- * history as you browse. It is also used to save the favicons for bookmarks. -- * -- * DANGER: The history query system makes assumptions about the favicon storage -- * so that icons can be quickly generated for history/bookmark result sets. If -- * you change the database layout at all, you will have to update both services. -- */ -- --#include "nsFaviconService.h" -- --#include "nsNavHistory.h" --#include "nsPlacesMacros.h" --#include "Helpers.h" --#include "AsyncFaviconHelpers.h" -- --#include "nsNetUtil.h" --#include "nsReadableUtils.h" --#include "nsStreamUtils.h" --#include "nsStringStream.h" --#include "plbase64.h" --#include "nsIClassInfoImpl.h" --#include "mozilla/ArrayUtils.h" --#include "mozilla/Preferences.h" -- --// For large favicons optimization. --#include "imgITools.h" --#include "imgIContainer.h" -- --// Default value for mOptimizedIconDimension --#define OPTIMIZED_FAVICON_DIMENSION 16 -- --#define MAX_FAVICON_CACHE_SIZE 256 --#define FAVICON_CACHE_REDUCE_COUNT 64 -- --#define MAX_UNASSOCIATED_FAVICONS 64 -- --// When replaceFaviconData is called, we store the icons in an in-memory cache --// instead of in storage. Icons in the cache are expired according to this --// interval. --#define UNASSOCIATED_ICON_EXPIRY_INTERVAL 60000 -- --// The MIME type of the default favicon and favicons created by --// OptimizeFaviconImage. --#define DEFAULT_MIME_TYPE "image/png" -- --using namespace mozilla; --using namespace mozilla::places; -- --/** -- * Used to notify a topic to system observers on async execute completion. -- * Will throw on error. -- */ --class ExpireFaviconsStatementCallbackNotifier : public AsyncStatementCallback --{ --public: -- ExpireFaviconsStatementCallbackNotifier(); -- NS_IMETHOD HandleCompletion(uint16_t aReason); --}; -- -- --PLACES_FACTORY_SINGLETON_IMPLEMENTATION(nsFaviconService, gFaviconService) -- --NS_IMPL_CLASSINFO(nsFaviconService, nullptr, 0, NS_FAVICONSERVICE_CID) --NS_IMPL_ISUPPORTS_CI( -- nsFaviconService --, nsIFaviconService --, mozIAsyncFavicons --, nsITimerCallback --) -- --nsFaviconService::nsFaviconService() -- : mOptimizedIconDimension(OPTIMIZED_FAVICON_DIMENSION) -- , mFailedFaviconSerial(0) -- , mFailedFavicons(MAX_FAVICON_CACHE_SIZE) -- , mUnassociatedIcons(MAX_UNASSOCIATED_FAVICONS) --{ -- NS_ASSERTION(!gFaviconService, -- "Attempting to create two instances of the service!"); -- gFaviconService = this; --} -- -- --nsFaviconService::~nsFaviconService() --{ -- NS_ASSERTION(gFaviconService == this, -- "Deleting a non-singleton instance of the service"); -- if (gFaviconService == this) -- gFaviconService = nullptr; --} -- -- --nsresult --nsFaviconService::Init() --{ -- mDB = Database::GetDatabase(); -- NS_ENSURE_STATE(mDB); -- -- mOptimizedIconDimension = Preferences::GetInt( -- "places.favicons.optimizeToDimension", OPTIMIZED_FAVICON_DIMENSION -- ); -- -- mExpireUnassociatedIconsTimer = do_CreateInstance("@mozilla.org/timer;1"); -- NS_ENSURE_STATE(mExpireUnassociatedIconsTimer); -- -- return NS_OK; --} -- --NS_IMETHODIMP --nsFaviconService::ExpireAllFavicons() --{ -- nsCOMPtr unlinkIconsStmt = mDB->GetAsyncStatement( -- "UPDATE moz_places " -- "SET favicon_id = NULL " -- "WHERE favicon_id NOT NULL" -- ); -- NS_ENSURE_STATE(unlinkIconsStmt); -- nsCOMPtr removeIconsStmt = mDB->GetAsyncStatement( -- "DELETE FROM moz_favicons WHERE id NOT IN (" -- "SELECT favicon_id FROM moz_places WHERE favicon_id NOT NULL " -- ")" -- ); -- NS_ENSURE_STATE(removeIconsStmt); -- -- mozIStorageBaseStatement* stmts[] = { -- unlinkIconsStmt.get() -- , removeIconsStmt.get() -- }; -- nsCOMPtr ps; -- nsRefPtr callback = -- new ExpireFaviconsStatementCallbackNotifier(); -- nsresult rv = mDB->MainConn()->ExecuteAsync( -- stmts, ArrayLength(stmts), callback, getter_AddRefs(ps) -- ); -- NS_ENSURE_SUCCESS(rv, rv); -- -- return NS_OK; --} -- --//////////////////////////////////////////////////////////////////////////////// --//// nsITimerCallback -- --static PLDHashOperator --ExpireNonrecentUnassociatedIconsEnumerator( -- UnassociatedIconHashKey* aIconKey, -- void* aNow) --{ -- PRTime now = *(reinterpret_cast(aNow)); -- if (now - aIconKey->created >= UNASSOCIATED_ICON_EXPIRY_INTERVAL) { -- return PL_DHASH_REMOVE; -- } -- return PL_DHASH_NEXT; --} -- --NS_IMETHODIMP --nsFaviconService::Notify(nsITimer* timer) --{ -- if (timer != mExpireUnassociatedIconsTimer.get()) { -- return NS_ERROR_INVALID_ARG; -- } -- -- PRTime now = PR_Now(); -- mUnassociatedIcons.EnumerateEntries( -- ExpireNonrecentUnassociatedIconsEnumerator, &now); -- // Re-init the expiry timer if the cache isn't empty. -- if (mUnassociatedIcons.Count() > 0) { -- mExpireUnassociatedIconsTimer->InitWithCallback( -- this, UNASSOCIATED_ICON_EXPIRY_INTERVAL, nsITimer::TYPE_ONE_SHOT); -- } -- -- return NS_OK; --} -- --//////////////////////////////////////////////////////////////////////////////// --//// nsIFaviconService -- --NS_IMETHODIMP --nsFaviconService::GetDefaultFavicon(nsIURI** _retval) --{ -- NS_ENSURE_ARG_POINTER(_retval); -- -- // not found, use default -- if (!mDefaultIcon) { -- nsresult rv = NS_NewURI(getter_AddRefs(mDefaultIcon), -- NS_LITERAL_CSTRING(FAVICON_DEFAULT_URL)); -- NS_ENSURE_SUCCESS(rv, rv); -- } -- return mDefaultIcon->Clone(_retval); --} -- --void --nsFaviconService::SendFaviconNotifications(nsIURI* aPageURI, -- nsIURI* aFaviconURI, -- const nsACString& aGUID) --{ -- nsAutoCString faviconSpec; -- nsNavHistory* history = nsNavHistory::GetHistoryService(); -- if (history && NS_SUCCEEDED(aFaviconURI->GetSpec(faviconSpec))) { -- history->SendPageChangedNotification(aPageURI, -- nsINavHistoryObserver::ATTRIBUTE_FAVICON, -- NS_ConvertUTF8toUTF16(faviconSpec), -- aGUID); -- } --} -- --NS_IMETHODIMP --nsFaviconService::SetAndFetchFaviconForPage(nsIURI* aPageURI, -- nsIURI* aFaviconURI, -- bool aForceReload, -- uint32_t aFaviconLoadType, -- nsIFaviconDataCallback* aCallback) --{ -- NS_ENSURE_ARG(aPageURI); -- NS_ENSURE_ARG(aFaviconURI); -- -- // If a favicon is in the failed cache, only load it during a forced reload. -- bool previouslyFailed; -- nsresult rv = IsFailedFavicon(aFaviconURI, &previouslyFailed); -- NS_ENSURE_SUCCESS(rv, rv); -- if (previouslyFailed) { -- if (aForceReload) -- RemoveFailedFavicon(aFaviconURI); -- else -- return NS_OK; -- } -- -- // Check if the icon already exists and fetch it from the network, if needed. -- // Finally associate the icon to the requested page if not yet associated. -- rv = AsyncFetchAndSetIconForPage::start( -- aFaviconURI, aPageURI, aForceReload ? FETCH_ALWAYS : FETCH_IF_MISSING, -- aFaviconLoadType, aCallback -- ); -- NS_ENSURE_SUCCESS(rv, rv); -- -- // DB will be updated and observers notified when data has finished loading. -- return NS_OK; --} -- --NS_IMETHODIMP --nsFaviconService::ReplaceFaviconData(nsIURI* aFaviconURI, -- const uint8_t* aData, -- uint32_t aDataLen, -- const nsACString& aMimeType, -- PRTime aExpiration) --{ -- NS_ENSURE_ARG(aFaviconURI); -- NS_ENSURE_ARG(aData); -- NS_ENSURE_TRUE(aDataLen > 0, NS_ERROR_INVALID_ARG); -- NS_ENSURE_TRUE(aMimeType.Length() > 0, NS_ERROR_INVALID_ARG); -- if (aExpiration == 0) { -- aExpiration = PR_Now() + MAX_FAVICON_EXPIRATION; -- } -- -- UnassociatedIconHashKey* iconKey = mUnassociatedIcons.PutEntry(aFaviconURI); -- if (!iconKey) { -- return NS_ERROR_OUT_OF_MEMORY; -- } -- -- iconKey->created = PR_Now(); -- -- // If the cache contains unassociated icons, an expiry timer should already exist, otherwise -- // there may be a timer left hanging around, so make sure we fire a new one. -- int32_t unassociatedCount = mUnassociatedIcons.Count(); -- if (unassociatedCount == 1) { -- mExpireUnassociatedIconsTimer->Cancel(); -- mExpireUnassociatedIconsTimer->InitWithCallback( -- this, UNASSOCIATED_ICON_EXPIRY_INTERVAL, nsITimer::TYPE_ONE_SHOT); -- } -- -- IconData* iconData = &(iconKey->iconData); -- iconData->expiration = aExpiration; -- iconData->status = ICON_STATUS_CACHED; -- iconData->fetchMode = FETCH_NEVER; -- nsresult rv = aFaviconURI->GetSpec(iconData->spec); -- NS_ENSURE_SUCCESS(rv, rv); -- -- // If the page provided a large image for the favicon (eg, a highres image -- // or a multiresolution .ico file), we don't want to store more data than -- // needed. -- if (aDataLen > MAX_ICON_FILESIZE(mOptimizedIconDimension)) { -- rv = OptimizeFaviconImage(aData, aDataLen, aMimeType, iconData->data, iconData->mimeType); -- NS_ENSURE_SUCCESS(rv, rv); -- -- if (iconData->data.Length() > MAX_FAVICON_SIZE) { -- // We cannot optimize this favicon size and we are over the maximum size -- // allowed, so we will not save data to the db to avoid bloating it. -- mUnassociatedIcons.RemoveEntry(aFaviconURI); -- return NS_ERROR_FAILURE; -- } -- } else { -- iconData->mimeType.Assign(aMimeType); -- iconData->data.Assign(TO_CHARBUFFER(aData), aDataLen); -- } -- -- // If the database contains an icon at the given url, we will update the -- // database immediately so that the associated pages are kept in sync. -- // Otherwise, do nothing and let the icon be picked up from the memory hash. -- rv = AsyncReplaceFaviconData::start(iconData); -- NS_ENSURE_SUCCESS(rv, rv); -- -- return NS_OK; --} -- --NS_IMETHODIMP --nsFaviconService::ReplaceFaviconDataFromDataURL(nsIURI* aFaviconURI, -- const nsAString& aDataURL, -- PRTime aExpiration) --{ -- NS_ENSURE_ARG(aFaviconURI); -- NS_ENSURE_TRUE(aDataURL.Length() > 0, NS_ERROR_INVALID_ARG); -- if (aExpiration == 0) { -- aExpiration = PR_Now() + MAX_FAVICON_EXPIRATION; -- } -- -- nsCOMPtr dataURI; -- nsresult rv = NS_NewURI(getter_AddRefs(dataURI), aDataURL); -- NS_ENSURE_SUCCESS(rv, rv); -- -- // Use the data: protocol handler to convert the data. -- nsCOMPtr ioService = do_GetIOService(&rv); -- NS_ENSURE_SUCCESS(rv, rv); -- nsCOMPtr protocolHandler; -- rv = ioService->GetProtocolHandler("data", getter_AddRefs(protocolHandler)); -- NS_ENSURE_SUCCESS(rv, rv); -- -- nsCOMPtr channel; -- rv = protocolHandler->NewChannel(dataURI, getter_AddRefs(channel)); -- NS_ENSURE_SUCCESS(rv, rv); -- -- // Blocking stream is OK for data URIs. -- nsCOMPtr stream; -- rv = channel->Open(getter_AddRefs(stream)); -- NS_ENSURE_SUCCESS(rv, rv); -- -- uint64_t available64; -- rv = stream->Available(&available64); -- NS_ENSURE_SUCCESS(rv, rv); -- if (available64 == 0 || available64 > UINT32_MAX / sizeof(uint8_t)) -- return NS_ERROR_FILE_TOO_BIG; -- uint32_t available = (uint32_t)available64; -- -- // Read all the decoded data. -- uint8_t* buffer = static_cast -- (nsMemory::Alloc(sizeof(uint8_t) * available)); -- if (!buffer) -- return NS_ERROR_OUT_OF_MEMORY; -- uint32_t numRead; -- rv = stream->Read(TO_CHARBUFFER(buffer), available, &numRead); -- if (NS_FAILED(rv) || numRead != available) { -- nsMemory::Free(buffer); -- return rv; -- } -- -- nsAutoCString mimeType; -- rv = channel->GetContentType(mimeType); -- if (NS_FAILED(rv)) { -- nsMemory::Free(buffer); -- return rv; -- } -- -- // ReplaceFaviconData can now do the dirty work. -- rv = ReplaceFaviconData(aFaviconURI, buffer, available, mimeType, aExpiration); -- nsMemory::Free(buffer); -- NS_ENSURE_SUCCESS(rv, rv); -- -- return NS_OK; --} -- --NS_IMETHODIMP --nsFaviconService::GetFaviconURLForPage(nsIURI *aPageURI, -- nsIFaviconDataCallback* aCallback) --{ -- NS_ENSURE_ARG(aPageURI); -- NS_ENSURE_ARG(aCallback); -- -- nsresult rv = AsyncGetFaviconURLForPage::start(aPageURI, aCallback); -- NS_ENSURE_SUCCESS(rv, rv); -- return NS_OK; --} -- --NS_IMETHODIMP --nsFaviconService::GetFaviconDataForPage(nsIURI* aPageURI, -- nsIFaviconDataCallback* aCallback) --{ -- NS_ENSURE_ARG(aPageURI); -- NS_ENSURE_ARG(aCallback); -- -- nsresult rv = AsyncGetFaviconDataForPage::start(aPageURI, aCallback); -- NS_ENSURE_SUCCESS(rv, rv); -- return NS_OK; --} -- --nsresult --nsFaviconService::GetFaviconLinkForIcon(nsIURI* aFaviconURI, -- nsIURI** aOutputURI) --{ -- NS_ENSURE_ARG(aFaviconURI); -- NS_ENSURE_ARG_POINTER(aOutputURI); -- -- nsAutoCString spec; -- if (aFaviconURI) { -- nsresult rv = aFaviconURI->GetSpec(spec); -- NS_ENSURE_SUCCESS(rv, rv); -- } -- return GetFaviconLinkForIconString(spec, aOutputURI); --} -- -- --static PLDHashOperator --ExpireFailedFaviconsCallback(nsCStringHashKey::KeyType aKey, -- uint32_t& aData, -- void* userArg) --{ -- uint32_t* threshold = reinterpret_cast(userArg); -- if (aData < *threshold) -- return PL_DHASH_REMOVE; -- return PL_DHASH_NEXT; --} -- -- --NS_IMETHODIMP --nsFaviconService::AddFailedFavicon(nsIURI* aFaviconURI) --{ -- NS_ENSURE_ARG(aFaviconURI); -- -- nsAutoCString spec; -- nsresult rv = aFaviconURI->GetSpec(spec); -- NS_ENSURE_SUCCESS(rv, rv); -- -- mFailedFavicons.Put(spec, mFailedFaviconSerial); -- mFailedFaviconSerial ++; -- -- if (mFailedFavicons.Count() > MAX_FAVICON_CACHE_SIZE) { -- // need to expire some entries, delete the FAVICON_CACHE_REDUCE_COUNT number -- // of items that are the oldest -- uint32_t threshold = mFailedFaviconSerial - -- MAX_FAVICON_CACHE_SIZE + FAVICON_CACHE_REDUCE_COUNT; -- mFailedFavicons.Enumerate(ExpireFailedFaviconsCallback, &threshold); -- } -- return NS_OK; --} -- -- --NS_IMETHODIMP --nsFaviconService::RemoveFailedFavicon(nsIURI* aFaviconURI) --{ -- NS_ENSURE_ARG(aFaviconURI); -- -- nsAutoCString spec; -- nsresult rv = aFaviconURI->GetSpec(spec); -- NS_ENSURE_SUCCESS(rv, rv); -- -- // we silently do nothing and succeed if the icon is not in the cache -- mFailedFavicons.Remove(spec); -- return NS_OK; --} -- -- --NS_IMETHODIMP --nsFaviconService::IsFailedFavicon(nsIURI* aFaviconURI, bool* _retval) --{ -- NS_ENSURE_ARG(aFaviconURI); -- nsAutoCString spec; -- nsresult rv = aFaviconURI->GetSpec(spec); -- NS_ENSURE_SUCCESS(rv, rv); -- -- uint32_t serial; -- *_retval = mFailedFavicons.Get(spec, &serial); -- return NS_OK; --} -- -- --// nsFaviconService::GetFaviconLinkForIconString --// --// This computes a favicon URL with string input and using the cached --// default one to minimize parsing. -- --nsresult --nsFaviconService::GetFaviconLinkForIconString(const nsCString& aSpec, -- nsIURI** aOutput) --{ -- if (aSpec.IsEmpty()) { -- // default icon for empty strings -- if (! mDefaultIcon) { -- nsresult rv = NS_NewURI(getter_AddRefs(mDefaultIcon), -- NS_LITERAL_CSTRING(FAVICON_DEFAULT_URL)); -- NS_ENSURE_SUCCESS(rv, rv); -- } -- return mDefaultIcon->Clone(aOutput); -- } -- -- if (StringBeginsWith(aSpec, NS_LITERAL_CSTRING("chrome:"))) { -- // pass through for chrome URLs, since they can be referenced without -- // this service -- return NS_NewURI(aOutput, aSpec); -- } -- -- nsAutoCString annoUri; -- annoUri.AssignLiteral("moz-anno:" FAVICON_ANNOTATION_NAME ":"); -- annoUri += aSpec; -- return NS_NewURI(aOutput, annoUri); --} -- -- --// nsFaviconService::GetFaviconSpecForIconString --// --// This computes a favicon spec for when you don't want a URI object (as in --// the tree view implementation), sparing all parsing and normalization. --void --nsFaviconService::GetFaviconSpecForIconString(const nsCString& aSpec, -- nsACString& aOutput) --{ -- if (aSpec.IsEmpty()) { -- aOutput.AssignLiteral(FAVICON_DEFAULT_URL); -- } else if (StringBeginsWith(aSpec, NS_LITERAL_CSTRING("chrome:"))) { -- aOutput = aSpec; -- } else { -- aOutput.AssignLiteral("moz-anno:" FAVICON_ANNOTATION_NAME ":"); -- aOutput += aSpec; -- } --} -- -- --// nsFaviconService::OptimizeFaviconImage --// --// Given a blob of data (a image file already read into a buffer), optimize --// its size by recompressing it as a 16x16 PNG. --nsresult --nsFaviconService::OptimizeFaviconImage(const uint8_t* aData, uint32_t aDataLen, -- const nsACString& aMimeType, -- nsACString& aNewData, -- nsACString& aNewMimeType) --{ -- nsresult rv; -- -- nsCOMPtr imgtool = do_CreateInstance("@mozilla.org/image/tools;1"); -- -- nsCOMPtr stream; -- rv = NS_NewByteInputStream(getter_AddRefs(stream), -- reinterpret_cast(aData), aDataLen, -- NS_ASSIGNMENT_DEPEND); -- NS_ENSURE_SUCCESS(rv, rv); -- -- // decode image -- nsCOMPtr container; -- rv = imgtool->DecodeImageData(stream, aMimeType, getter_AddRefs(container)); -- NS_ENSURE_SUCCESS(rv, rv); -- -- aNewMimeType.AssignLiteral(DEFAULT_MIME_TYPE); -- -- // scale and recompress -- nsCOMPtr iconStream; -- rv = imgtool->EncodeScaledImage(container, aNewMimeType, -- mOptimizedIconDimension, -- mOptimizedIconDimension, -- EmptyString(), -- getter_AddRefs(iconStream)); -- NS_ENSURE_SUCCESS(rv, rv); -- -- // Read the stream into a new buffer. -- rv = NS_ConsumeStream(iconStream, UINT32_MAX, aNewData); -- NS_ENSURE_SUCCESS(rv, rv); -- -- return NS_OK; --} -- --nsresult --nsFaviconService::GetFaviconDataAsync(nsIURI* aFaviconURI, -- mozIStorageStatementCallback *aCallback) --{ -- NS_ASSERTION(aCallback, "Doesn't make sense to call this without a callback"); -- nsCOMPtr stmt = mDB->GetAsyncStatement( -- "SELECT f.data, f.mime_type FROM moz_favicons f WHERE url = :icon_url" -- ); -- NS_ENSURE_STATE(stmt); -- -- nsresult rv = URIBinder::Bind(stmt, NS_LITERAL_CSTRING("icon_url"), aFaviconURI); -- NS_ENSURE_SUCCESS(rv, rv); -- -- nsCOMPtr pendingStatement; -- return stmt->ExecuteAsync(aCallback, getter_AddRefs(pendingStatement)); --} -- --//////////////////////////////////////////////////////////////////////////////// --//// ExpireFaviconsStatementCallbackNotifier -- --ExpireFaviconsStatementCallbackNotifier::ExpireFaviconsStatementCallbackNotifier() --{ --} -- -- --NS_IMETHODIMP --ExpireFaviconsStatementCallbackNotifier::HandleCompletion(uint16_t aReason) --{ -- // We should dispatch only if expiration has been successful. -- if (aReason != mozIStorageStatementCallback::REASON_FINISHED) -- return NS_OK; -- -- nsCOMPtr observerService = -- mozilla::services::GetObserverService(); -- if (observerService) { -- (void)observerService->NotifyObservers(nullptr, -- NS_PLACES_FAVICONS_EXPIRED_TOPIC_ID, -- nullptr); -- } -- -- return NS_OK; --} -+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+/** -+ * This is the favicon service, which stores favicons for web pages with your -+ * history as you browse. It is also used to save the favicons for bookmarks. -+ * -+ * DANGER: The history query system makes assumptions about the favicon storage -+ * so that icons can be quickly generated for history/bookmark result sets. If -+ * you change the database layout at all, you will have to update both services. -+ */ -+ -+#include "nsFaviconService.h" -+ -+#include "nsNavHistory.h" -+#include "nsPlacesMacros.h" -+#include "Helpers.h" -+#include "AsyncFaviconHelpers.h" -+ -+#include "nsNetUtil.h" -+#include "nsReadableUtils.h" -+#include "nsStreamUtils.h" -+#include "nsStringStream.h" -+#include "plbase64.h" -+#include "nsIClassInfoImpl.h" -+#include "mozilla/ArrayUtils.h" -+#include "mozilla/Preferences.h" -+ -+// For large favicons optimization. -+#include "imgITools.h" -+#include "imgIContainer.h" -+ -+// Default value for mOptimizedIconDimension -+#define OPTIMIZED_FAVICON_DIMENSION 16 -+ -+#define MAX_FAVICON_CACHE_SIZE 256 -+#define FAVICON_CACHE_REDUCE_COUNT 64 -+ -+#define MAX_UNASSOCIATED_FAVICONS 64 -+ -+// When replaceFaviconData is called, we store the icons in an in-memory cache -+// instead of in storage. Icons in the cache are expired according to this -+// interval. -+#define UNASSOCIATED_ICON_EXPIRY_INTERVAL 60000 -+ -+// The MIME type of the default favicon and favicons created by -+// OptimizeFaviconImage. -+#define DEFAULT_MIME_TYPE "image/png" -+ -+using namespace mozilla; -+using namespace mozilla::places; -+ -+/** -+ * Used to notify a topic to system observers on async execute completion. -+ * Will throw on error. -+ */ -+class ExpireFaviconsStatementCallbackNotifier : public AsyncStatementCallback -+{ -+public: -+ ExpireFaviconsStatementCallbackNotifier(); -+ NS_IMETHOD HandleCompletion(uint16_t aReason); -+}; -+ -+ -+PLACES_FACTORY_SINGLETON_IMPLEMENTATION(nsFaviconService, gFaviconService) -+ -+NS_IMPL_CLASSINFO(nsFaviconService, nullptr, 0, NS_FAVICONSERVICE_CID) -+NS_IMPL_ISUPPORTS_CI( -+ nsFaviconService -+, nsIFaviconService -+, mozIAsyncFavicons -+, nsITimerCallback -+) -+ -+nsFaviconService::nsFaviconService() -+ : mOptimizedIconDimension(OPTIMIZED_FAVICON_DIMENSION) -+ , mFailedFaviconSerial(0) -+ , mFailedFavicons(MAX_FAVICON_CACHE_SIZE) -+ , mUnassociatedIcons(MAX_UNASSOCIATED_FAVICONS) -+{ -+ NS_ASSERTION(!gFaviconService, -+ "Attempting to create two instances of the service!"); -+ gFaviconService = this; -+} -+ -+ -+nsFaviconService::~nsFaviconService() -+{ -+ NS_ASSERTION(gFaviconService == this, -+ "Deleting a non-singleton instance of the service"); -+ if (gFaviconService == this) -+ gFaviconService = nullptr; -+} -+ -+ -+nsresult -+nsFaviconService::Init() -+{ -+ mDB = Database::GetDatabase(); -+ NS_ENSURE_STATE(mDB); -+ -+ mOptimizedIconDimension = Preferences::GetInt( -+ "places.favicons.optimizeToDimension", OPTIMIZED_FAVICON_DIMENSION -+ ); -+ -+ mExpireUnassociatedIconsTimer = do_CreateInstance("@mozilla.org/timer;1"); -+ NS_ENSURE_STATE(mExpireUnassociatedIconsTimer); -+ -+ return NS_OK; -+} -+ -+NS_IMETHODIMP -+nsFaviconService::ExpireAllFavicons() -+{ -+ nsCOMPtr unlinkIconsStmt = mDB->GetAsyncStatement( -+ "UPDATE moz_places " -+ "SET favicon_id = NULL " -+ "WHERE favicon_id NOT NULL" -+ ); -+ NS_ENSURE_STATE(unlinkIconsStmt); -+ nsCOMPtr removeIconsStmt = mDB->GetAsyncStatement( -+ "DELETE FROM moz_favicons WHERE id NOT IN (" -+ "SELECT favicon_id FROM moz_places WHERE favicon_id NOT NULL " -+ ")" -+ ); -+ NS_ENSURE_STATE(removeIconsStmt); -+ -+ mozIStorageBaseStatement* stmts[] = { -+ unlinkIconsStmt.get() -+ , removeIconsStmt.get() -+ }; -+ nsCOMPtr ps; -+ nsRefPtr callback = -+ new ExpireFaviconsStatementCallbackNotifier(); -+ nsresult rv = mDB->MainConn()->ExecuteAsync( -+ stmts, ArrayLength(stmts), callback, getter_AddRefs(ps) -+ ); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ return NS_OK; -+} -+ -+//////////////////////////////////////////////////////////////////////////////// -+//// nsITimerCallback -+ -+static PLDHashOperator -+ExpireNonrecentUnassociatedIconsEnumerator( -+ UnassociatedIconHashKey* aIconKey, -+ void* aNow) -+{ -+ PRTime now = *(reinterpret_cast(aNow)); -+ if (now - aIconKey->created >= UNASSOCIATED_ICON_EXPIRY_INTERVAL) { -+ return PL_DHASH_REMOVE; -+ } -+ return PL_DHASH_NEXT; -+} -+ -+NS_IMETHODIMP -+nsFaviconService::Notify(nsITimer* timer) -+{ -+ if (timer != mExpireUnassociatedIconsTimer.get()) { -+ return NS_ERROR_INVALID_ARG; -+ } -+ -+ PRTime now = PR_Now(); -+ mUnassociatedIcons.EnumerateEntries( -+ ExpireNonrecentUnassociatedIconsEnumerator, &now); -+ // Re-init the expiry timer if the cache isn't empty. -+ if (mUnassociatedIcons.Count() > 0) { -+ mExpireUnassociatedIconsTimer->InitWithCallback( -+ this, UNASSOCIATED_ICON_EXPIRY_INTERVAL, nsITimer::TYPE_ONE_SHOT); -+ } -+ -+ return NS_OK; -+} -+ -+//////////////////////////////////////////////////////////////////////////////// -+//// nsIFaviconService -+ -+NS_IMETHODIMP -+nsFaviconService::GetDefaultFavicon(nsIURI** _retval) -+{ -+ NS_ENSURE_ARG_POINTER(_retval); -+ -+ // not found, use default -+ if (!mDefaultIcon) { -+ nsresult rv = NS_NewURI(getter_AddRefs(mDefaultIcon), -+ NS_LITERAL_CSTRING(FAVICON_DEFAULT_URL)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ } -+ return mDefaultIcon->Clone(_retval); -+} -+ -+void -+nsFaviconService::SendFaviconNotifications(nsIURI* aPageURI, -+ nsIURI* aFaviconURI, -+ const nsACString& aGUID) -+{ -+ nsAutoCString faviconSpec; -+ nsNavHistory* history = nsNavHistory::GetHistoryService(); -+ if (history && NS_SUCCEEDED(aFaviconURI->GetSpec(faviconSpec))) { -+ history->SendPageChangedNotification(aPageURI, -+ nsINavHistoryObserver::ATTRIBUTE_FAVICON, -+ NS_ConvertUTF8toUTF16(faviconSpec), -+ aGUID); -+ } -+} -+ -+NS_IMETHODIMP -+nsFaviconService::SetAndFetchFaviconForPage(nsIURI* aPageURI, -+ nsIURI* aFaviconURI, -+ bool aForceReload, -+ uint32_t aFaviconLoadType, -+ nsIFaviconDataCallback* aCallback) -+{ -+ NS_ENSURE_ARG(aPageURI); -+ NS_ENSURE_ARG(aFaviconURI); -+ -+ // If a favicon is in the failed cache, only load it during a forced reload. -+ bool previouslyFailed; -+ nsresult rv = IsFailedFavicon(aFaviconURI, &previouslyFailed); -+ NS_ENSURE_SUCCESS(rv, rv); -+ if (previouslyFailed) { -+ if (aForceReload) -+ RemoveFailedFavicon(aFaviconURI); -+ else -+ return NS_OK; -+ } -+ -+ // Check if the icon already exists and fetch it from the network, if needed. -+ // Finally associate the icon to the requested page if not yet associated. -+ rv = AsyncFetchAndSetIconForPage::start( -+ aFaviconURI, aPageURI, aForceReload ? FETCH_ALWAYS : FETCH_IF_MISSING, -+ aFaviconLoadType, aCallback -+ ); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // DB will be updated and observers notified when data has finished loading. -+ return NS_OK; -+} -+ -+NS_IMETHODIMP -+nsFaviconService::ReplaceFaviconData(nsIURI* aFaviconURI, -+ const uint8_t* aData, -+ uint32_t aDataLen, -+ const nsACString& aMimeType, -+ PRTime aExpiration) -+{ -+ NS_ENSURE_ARG(aFaviconURI); -+ NS_ENSURE_ARG(aData); -+ NS_ENSURE_TRUE(aDataLen > 0, NS_ERROR_INVALID_ARG); -+ NS_ENSURE_TRUE(aMimeType.Length() > 0, NS_ERROR_INVALID_ARG); -+ if (aExpiration == 0) { -+ aExpiration = PR_Now() + MAX_FAVICON_EXPIRATION; -+ } -+ -+ UnassociatedIconHashKey* iconKey = mUnassociatedIcons.PutEntry(aFaviconURI); -+ if (!iconKey) { -+ return NS_ERROR_OUT_OF_MEMORY; -+ } -+ -+ iconKey->created = PR_Now(); -+ -+ // If the cache contains unassociated icons, an expiry timer should already exist, otherwise -+ // there may be a timer left hanging around, so make sure we fire a new one. -+ int32_t unassociatedCount = mUnassociatedIcons.Count(); -+ if (unassociatedCount == 1) { -+ mExpireUnassociatedIconsTimer->Cancel(); -+ mExpireUnassociatedIconsTimer->InitWithCallback( -+ this, UNASSOCIATED_ICON_EXPIRY_INTERVAL, nsITimer::TYPE_ONE_SHOT); -+ } -+ -+ IconData* iconData = &(iconKey->iconData); -+ iconData->expiration = aExpiration; -+ iconData->status = ICON_STATUS_CACHED; -+ iconData->fetchMode = FETCH_NEVER; -+ nsresult rv = aFaviconURI->GetSpec(iconData->spec); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // If the page provided a large image for the favicon (eg, a highres image -+ // or a multiresolution .ico file), we don't want to store more data than -+ // needed. -+ if (aDataLen > MAX_ICON_FILESIZE(mOptimizedIconDimension)) { -+ rv = OptimizeFaviconImage(aData, aDataLen, aMimeType, iconData->data, iconData->mimeType); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ if (iconData->data.Length() > MAX_FAVICON_SIZE) { -+ // We cannot optimize this favicon size and we are over the maximum size -+ // allowed, so we will not save data to the db to avoid bloating it. -+ mUnassociatedIcons.RemoveEntry(aFaviconURI); -+ return NS_ERROR_FAILURE; -+ } -+ } else { -+ iconData->mimeType.Assign(aMimeType); -+ iconData->data.Assign(TO_CHARBUFFER(aData), aDataLen); -+ } -+ -+ // If the database contains an icon at the given url, we will update the -+ // database immediately so that the associated pages are kept in sync. -+ // Otherwise, do nothing and let the icon be picked up from the memory hash. -+ rv = AsyncReplaceFaviconData::start(iconData); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ return NS_OK; -+} -+ -+NS_IMETHODIMP -+nsFaviconService::ReplaceFaviconDataFromDataURL(nsIURI* aFaviconURI, -+ const nsAString& aDataURL, -+ PRTime aExpiration) -+{ -+ NS_ENSURE_ARG(aFaviconURI); -+ NS_ENSURE_TRUE(aDataURL.Length() > 0, NS_ERROR_INVALID_ARG); -+ if (aExpiration == 0) { -+ aExpiration = PR_Now() + MAX_FAVICON_EXPIRATION; -+ } -+ -+ nsCOMPtr dataURI; -+ nsresult rv = NS_NewURI(getter_AddRefs(dataURI), aDataURL); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // Use the data: protocol handler to convert the data. -+ nsCOMPtr ioService = do_GetIOService(&rv); -+ NS_ENSURE_SUCCESS(rv, rv); -+ nsCOMPtr protocolHandler; -+ rv = ioService->GetProtocolHandler("data", getter_AddRefs(protocolHandler)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ nsCOMPtr channel; -+ rv = protocolHandler->NewChannel(dataURI, getter_AddRefs(channel)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // Blocking stream is OK for data URIs. -+ nsCOMPtr stream; -+ rv = channel->Open(getter_AddRefs(stream)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ uint64_t available64; -+ rv = stream->Available(&available64); -+ NS_ENSURE_SUCCESS(rv, rv); -+ if (available64 == 0 || available64 > UINT32_MAX / sizeof(uint8_t)) -+ return NS_ERROR_FILE_TOO_BIG; -+ uint32_t available = (uint32_t)available64; -+ -+ // Read all the decoded data. -+ uint8_t* buffer = static_cast -+ (nsMemory::Alloc(sizeof(uint8_t) * available)); -+ if (!buffer) -+ return NS_ERROR_OUT_OF_MEMORY; -+ uint32_t numRead; -+ rv = stream->Read(TO_CHARBUFFER(buffer), available, &numRead); -+ if (NS_FAILED(rv) || numRead != available) { -+ nsMemory::Free(buffer); -+ return rv; -+ } -+ -+ nsAutoCString mimeType; -+ rv = channel->GetContentType(mimeType); -+ if (NS_FAILED(rv)) { -+ nsMemory::Free(buffer); -+ return rv; -+ } -+ -+ // ReplaceFaviconData can now do the dirty work. -+ rv = ReplaceFaviconData(aFaviconURI, buffer, available, mimeType, aExpiration); -+ nsMemory::Free(buffer); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ return NS_OK; -+} -+ -+NS_IMETHODIMP -+nsFaviconService::GetFaviconURLForPage(nsIURI *aPageURI, -+ nsIFaviconDataCallback* aCallback) -+{ -+ NS_ENSURE_ARG(aPageURI); -+ NS_ENSURE_ARG(aCallback); -+ -+ nsresult rv = AsyncGetFaviconURLForPage::start(aPageURI, aCallback); -+ NS_ENSURE_SUCCESS(rv, rv); -+ return NS_OK; -+} -+ -+NS_IMETHODIMP -+nsFaviconService::GetFaviconDataForPage(nsIURI* aPageURI, -+ nsIFaviconDataCallback* aCallback) -+{ -+ NS_ENSURE_ARG(aPageURI); -+ NS_ENSURE_ARG(aCallback); -+ -+ nsresult rv = AsyncGetFaviconDataForPage::start(aPageURI, aCallback); -+ NS_ENSURE_SUCCESS(rv, rv); -+ return NS_OK; -+} -+ -+nsresult -+nsFaviconService::GetFaviconLinkForIcon(nsIURI* aFaviconURI, -+ nsIURI** aOutputURI) -+{ -+ NS_ENSURE_ARG(aFaviconURI); -+ NS_ENSURE_ARG_POINTER(aOutputURI); -+ -+ nsAutoCString spec; -+ if (aFaviconURI) { -+ nsresult rv = aFaviconURI->GetSpec(spec); -+ NS_ENSURE_SUCCESS(rv, rv); -+ } -+ return GetFaviconLinkForIconString(spec, aOutputURI); -+} -+ -+ -+static PLDHashOperator -+ExpireFailedFaviconsCallback(nsCStringHashKey::KeyType aKey, -+ uint32_t& aData, -+ void* userArg) -+{ -+ uint32_t* threshold = reinterpret_cast(userArg); -+ if (aData < *threshold) -+ return PL_DHASH_REMOVE; -+ return PL_DHASH_NEXT; -+} -+ -+ -+NS_IMETHODIMP -+nsFaviconService::AddFailedFavicon(nsIURI* aFaviconURI) -+{ -+ NS_ENSURE_ARG(aFaviconURI); -+ -+ nsAutoCString spec; -+ nsresult rv = aFaviconURI->GetSpec(spec); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ mFailedFavicons.Put(spec, mFailedFaviconSerial); -+ mFailedFaviconSerial ++; -+ -+ if (mFailedFavicons.Count() > MAX_FAVICON_CACHE_SIZE) { -+ // need to expire some entries, delete the FAVICON_CACHE_REDUCE_COUNT number -+ // of items that are the oldest -+ uint32_t threshold = mFailedFaviconSerial - -+ MAX_FAVICON_CACHE_SIZE + FAVICON_CACHE_REDUCE_COUNT; -+ mFailedFavicons.Enumerate(ExpireFailedFaviconsCallback, &threshold); -+ } -+ return NS_OK; -+} -+ -+ -+NS_IMETHODIMP -+nsFaviconService::RemoveFailedFavicon(nsIURI* aFaviconURI) -+{ -+ NS_ENSURE_ARG(aFaviconURI); -+ -+ nsAutoCString spec; -+ nsresult rv = aFaviconURI->GetSpec(spec); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // we silently do nothing and succeed if the icon is not in the cache -+ mFailedFavicons.Remove(spec); -+ return NS_OK; -+} -+ -+ -+NS_IMETHODIMP -+nsFaviconService::IsFailedFavicon(nsIURI* aFaviconURI, bool* _retval) -+{ -+ NS_ENSURE_ARG(aFaviconURI); -+ nsAutoCString spec; -+ nsresult rv = aFaviconURI->GetSpec(spec); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ uint32_t serial; -+ *_retval = mFailedFavicons.Get(spec, &serial); -+ return NS_OK; -+} -+ -+ -+// nsFaviconService::GetFaviconLinkForIconString -+// -+// This computes a favicon URL with string input and using the cached -+// default one to minimize parsing. -+ -+nsresult -+nsFaviconService::GetFaviconLinkForIconString(const nsCString& aSpec, -+ nsIURI** aOutput) -+{ -+ if (aSpec.IsEmpty()) { -+ // default icon for empty strings -+ if (! mDefaultIcon) { -+ nsresult rv = NS_NewURI(getter_AddRefs(mDefaultIcon), -+ NS_LITERAL_CSTRING(FAVICON_DEFAULT_URL)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ } -+ return mDefaultIcon->Clone(aOutput); -+ } -+ -+ if (StringBeginsWith(aSpec, NS_LITERAL_CSTRING("chrome:"))) { -+ // pass through for chrome URLs, since they can be referenced without -+ // this service -+ return NS_NewURI(aOutput, aSpec); -+ } -+ -+ nsAutoCString annoUri; -+ annoUri.AssignLiteral("moz-anno:" FAVICON_ANNOTATION_NAME ":"); -+ annoUri += aSpec; -+ return NS_NewURI(aOutput, annoUri); -+} -+ -+ -+// nsFaviconService::GetFaviconSpecForIconString -+// -+// This computes a favicon spec for when you don't want a URI object (as in -+// the tree view implementation), sparing all parsing and normalization. -+void -+nsFaviconService::GetFaviconSpecForIconString(const nsCString& aSpec, -+ nsACString& aOutput) -+{ -+ if (aSpec.IsEmpty()) { -+ aOutput.AssignLiteral(FAVICON_DEFAULT_URL); -+ } else if (StringBeginsWith(aSpec, NS_LITERAL_CSTRING("chrome:"))) { -+ aOutput = aSpec; -+ } else { -+ aOutput.AssignLiteral("moz-anno:" FAVICON_ANNOTATION_NAME ":"); -+ aOutput += aSpec; -+ } -+} -+ -+ -+// nsFaviconService::OptimizeFaviconImage -+// -+// Given a blob of data (a image file already read into a buffer), optimize -+// its size by recompressing it as a 16x16 PNG. -+nsresult -+nsFaviconService::OptimizeFaviconImage(const uint8_t* aData, uint32_t aDataLen, -+ const nsACString& aMimeType, -+ nsACString& aNewData, -+ nsACString& aNewMimeType) -+{ -+ nsresult rv; -+ -+ nsCOMPtr imgtool = do_CreateInstance("@mozilla.org/image/tools;1"); -+ -+ nsCOMPtr stream; -+ rv = NS_NewByteInputStream(getter_AddRefs(stream), -+ reinterpret_cast(aData), aDataLen, -+ NS_ASSIGNMENT_DEPEND); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // decode image -+ nsCOMPtr container; -+ rv = imgtool->DecodeImageData(stream, aMimeType, getter_AddRefs(container)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ aNewMimeType.AssignLiteral(DEFAULT_MIME_TYPE); -+ -+ // scale and recompress -+ nsCOMPtr iconStream; -+ rv = imgtool->EncodeScaledImage(container, aNewMimeType, -+ mOptimizedIconDimension, -+ mOptimizedIconDimension, -+ EmptyString(), -+ getter_AddRefs(iconStream)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ // Read the stream into a new buffer. -+ rv = NS_ConsumeStream(iconStream, UINT32_MAX, aNewData); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ return NS_OK; -+} -+ -+nsresult -+nsFaviconService::GetFaviconDataAsync(nsIURI* aFaviconURI, -+ mozIStorageStatementCallback *aCallback) -+{ -+ NS_ASSERTION(aCallback, "Doesn't make sense to call this without a callback"); -+ nsCOMPtr stmt = mDB->GetAsyncStatement( -+ "SELECT f.data, f.mime_type FROM moz_favicons f WHERE url = :icon_url" -+ ); -+ NS_ENSURE_STATE(stmt); -+ -+ nsresult rv = URIBinder::Bind(stmt, NS_LITERAL_CSTRING("icon_url"), aFaviconURI); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ nsCOMPtr pendingStatement; -+ return stmt->ExecuteAsync(aCallback, getter_AddRefs(pendingStatement)); -+} -+ -+//////////////////////////////////////////////////////////////////////////////// -+//// ExpireFaviconsStatementCallbackNotifier -+ -+ExpireFaviconsStatementCallbackNotifier::ExpireFaviconsStatementCallbackNotifier() -+{ -+} -+ -+ -+NS_IMETHODIMP -+ExpireFaviconsStatementCallbackNotifier::HandleCompletion(uint16_t aReason) -+{ -+ // We should dispatch only if expiration has been successful. -+ if (aReason != mozIStorageStatementCallback::REASON_FINISHED) -+ return NS_OK; -+ -+ nsCOMPtr observerService = -+ mozilla::services::GetObserverService(); -+ if (observerService) { -+ (void)observerService->NotifyObservers(nullptr, -+ NS_PLACES_FAVICONS_EXPIRED_TOPIC_ID, -+ nullptr); -+ } -+ -+ return NS_OK; -+} + ASFILES += intel-aes-x86-masm.asm intel-gcm-x86-masm.asm + EXTRA_SRCS += intel-gcm-wrap.c + ifeq ($(CLANG_CL),1) +@@ -150,17 +150,17 @@ else + # -DMP_NO_MP_WORD + DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN + ifdef NS_USE_GCC + # Ideally, we should use amd64 assembly code, but it's not yet mingw-w64 + # compatible. + else + # MSVC + ifdef BUILD_OPT +- OPTIMIZER += -Ox # maximum optimization for freebl ++ OPTIMIZER += -Ox -GFL # maximum optimization for freebl + endif + ASFILES = arcfour-amd64-masm.asm mpi_amd64_masm.asm mp_comba_amd64_masm.asm + DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY + DEFINES += -DNSS_USE_COMBA + # The Intel AES assembly code requires Visual C++ 2010 (10.0). The _xgetbv + # compiler intrinsic function requires Visual C++ 2010 (10.0) SP1. + ifeq ($(_MSC_VER_GE_10SP1),1) + DEFINES += -DUSE_HW_AES -DINTEL_GCM +diff --git a/security/nss/lib/freebl/mpi/Makefile.win b/security/nss/lib/freebl/mpi/Makefile.win +--- a/security/nss/lib/freebl/mpi/Makefile.win ++++ b/security/nss/lib/freebl/mpi/Makefile.win +@@ -30,17 +30,17 @@ endif + ## + ## Conditional compilation options are no longer here; see + ## the file 'mpi-config.h' instead. + ## + MPICMN = -I. -DMP_API_COMPATIBLE -DMP_IOFUNC + + ifeq ($(CPU_ARCH),x86_64) + AS_SRCS = mpi_x86_64.asm +-CFLAGS = -O2 -Z7 -MD -W3 -nologo -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ ++CFLAGS = -O2 -GFL -Z7 -MD -W3 -nologo -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ + -DWIN32 -D_WIN64 -D_AMD64_ -D_M_AMD64 -D_WINDOWS -DWIN95 $(MPICMN) + ASFLAGS = -Cp -Sn -Zi -I. + else + #NT + AS_SRCS = mpi_x86.asm + MPICMN += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE -DMP_ASSEMBLY_DIV_2DX1D + #CFLAGS= -Od -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC \ + -DDEBUG -D_DEBUG -UNDEBUG -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) +diff --git a/toolkit/components/places/nsFaviconService.cpp b/toolkit/components/places/nsFaviconService.cpp +--- a/toolkit/components/places/nsFaviconService.cpp ++++ b/toolkit/components/places/nsFaviconService.cpp +@@ -31,17 +31,17 @@ + #include "nsIContentPolicy.h" + #include "nsContentUtils.h" + + // For large favicons optimization. + #include "imgITools.h" + #include "imgIContainer.h" + + // Default value for mOptimizedIconDimension +-#define OPTIMIZED_FAVICON_DIMENSION 16 ++#define OPTIMIZED_FAVICON_DIMENSION 32 + + #define MAX_FAILED_FAVICONS 256 + #define FAVICON_CACHE_REDUCE_COUNT 64 + + #define UNASSOCIATED_FAVICONS_LENGTH 32 + + // When replaceFaviconData is called, we store the icons in an in-memory cache + // instead of in storage. Icons in the cache are expired according to this +@@ -621,8 +621,93 @@ ExpireFaviconsStatementCallbackNotifier: + if (observerService) { + (void)observerService->NotifyObservers(nullptr, + NS_PLACES_FAVICONS_EXPIRED_TOPIC_ID, + nullptr); + } + + return NS_OK; + } + +NS_IMETHODIMP +nsFaviconService::GetFaviconForPage(nsIURI* aPageURI, nsIURI** _retval) @@ -3305,335 +1174,254 @@ diff --git a/toolkit/components/places/nsFaviconService.cpp b/toolkit/components + } + return NS_ERROR_NOT_AVAILABLE; +} -\ No newline at end of file diff --git a/toolkit/components/places/nsIFaviconService.idl b/toolkit/components/places/nsIFaviconService.idl --- a/toolkit/components/places/nsIFaviconService.idl +++ b/toolkit/components/places/nsIFaviconService.idl -@@ -1,139 +1,145 @@ --/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ --/* This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -- --#include "nsISupports.idl" -- --interface nsIURI; -- --[scriptable, uuid(e81e0b0c-b9f1-4c2e-8f3c-b809933cf73c)] --interface nsIFaviconService : nsISupports --{ -- // The favicon is being loaded from a private browsing window -- const unsigned long FAVICON_LOAD_PRIVATE = 1; -- // The favicon is being loaded from a non-private browsing window -- const unsigned long FAVICON_LOAD_NON_PRIVATE = 2; -- -- /** -- * For a given icon URI, this will return a URI that will result in the image. -- * In most cases, this is an annotation URI. For chrome URIs, this will do -- * nothing but returning the input URI. -- * -- * No validity checking is done. If you pass an icon URI that we've never -- * seen, you'll get back a URI that references an invalid icon. The moz-anno -- * protocol handler's special case for "favicon" annotations will resolve -- * invalid icons to the default icon, although without caching. -- * For invalid chrome URIs, you'll get a broken image. -- * -- * @param aFaviconURI -- * The URI of an icon in the favicon service. -- * @return A URI that will give you the icon image. This is NOT the URI of -- * the icon as set on the page, but a URI that will give you the -- * data out of the favicon service. For a normal page with a -- * favicon we've stored, this will be an annotation URI which will -- * then cause the corresponding favicon data to be loaded async from -- * this service. For pages where we don't have a favicon, this will -- * be a chrome URI of the default icon. For chrome URIs, the -- * output will be the same as the input. -- */ -- nsIURI getFaviconLinkForIcon(in nsIURI aFaviconURI); -- -- /** -- * Expire all known favicons from the database. -- * -- * @note This is an async method. -- * On successful completion a "places-favicons-expired" notification is -- * dispatched through observer's service. -- */ -- void expireAllFavicons(); -- -- /** -- * Adds a given favicon's URI to the failed favicon cache. -- * -- * The lifespan of the favicon cache is up to the caching system. This cache -- * will also be written when setAndLoadFaviconForPage hits an error while -- * fetching an icon. -- * -- * @param aFaviconURI -- * The URI of an icon in the favicon service. -- */ -- void addFailedFavicon(in nsIURI aFaviconURI); -- -- /** -- * Removes the given favicon from the failed favicon cache. If the icon is -- * not in the cache, it will silently succeed. -- * -- * @param aFaviconURI -- * The URI of an icon in the favicon service. -- */ -- void removeFailedFavicon(in nsIURI aFaviconURI); -- -- /** -- * Checks to see if a favicon is in the failed favicon cache. -- * A positive return value means the icon is in the failed cache and you -- * probably shouldn't try to load it. A false return value means that it's -- * worth trying to load it. -- * This allows you to avoid trying to load "foo.com/favicon.ico" for every -- * page on a site that doesn't have a favicon. -- * -- * @param aFaviconURI -- * The URI of an icon in the favicon service. -- */ -- boolean isFailedFavicon(in nsIURI aFaviconURI); -- -- /** -- * The default favicon URI -- */ -- readonly attribute nsIURI defaultFavicon; --}; -- --[scriptable, function, uuid(c85e5c82-b70f-4621-9528-beb2aa47fb44)] --interface nsIFaviconDataCallback : nsISupports --{ -- /** -- * Called when the required favicon's information is available. -- * -- * It's up to the invoking method to state if the callback is always invoked, -- * or called on success only. Check the method documentation to ensure that. -- * -- * The caller will receive the most information we can gather on the icon, -- * but it's not guaranteed that all of them will be set. For some method -- * we could not know the favicon's data (it could just be too expensive to -- * get it, or the method does not require we actually have any data). -- * It's up to the caller to check aDataLen > 0 before using any data-related -- * information like mime-type or data itself. -- * -- * @param aFaviconURI -- * Receives the "favicon URI" (not the "favicon link URI") associated -- * to the requested page. This can be null if there is no associated -- * favicon URI, or the callback is notifying a failure. -- * @param aDataLen -- * Size of the icon data in bytes. Notice that a value of 0 does not -- * necessarily mean that we don't have an icon. -- * @param aData -- * Icon data, or an empty array if aDataLen is 0. -- * @param aMimeType -- * Mime type of the icon, or an empty string if aDataLen is 0. -- * -- * @note If you want to open a network channel to access the favicon, it's -- * recommended that you call the getFaviconLinkForIcon method to convert -- * the "favicon URI" into a "favicon link URI". -- */ -- void onComplete(in nsIURI aFaviconURI, -- in unsigned long aDataLen, -- [const,array,size_is(aDataLen)] in octet aData, -- in AUTF8String aMimeType); --}; -- --%{C++ -- --/** -- * Notification sent when all favicons are expired. -- */ --#define NS_PLACES_FAVICONS_EXPIRED_TOPIC_ID "places-favicons-expired" -- --#define FAVICON_DEFAULT_URL "chrome://mozapps/skin/places/defaultFavicon.png" --#define FAVICON_ERRORPAGE_URL "chrome://global/skin/icons/warning-16.png" -- --%} -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "nsISupports.idl" -+ -+interface nsIURI; -+ -+[scriptable, uuid(e81e0b0c-b9f1-4c2e-8f3c-b809933cf73c)] -+interface nsIFaviconService : nsISupports -+{ -+ // The favicon is being loaded from a private browsing window -+ const unsigned long FAVICON_LOAD_PRIVATE = 1; -+ // The favicon is being loaded from a non-private browsing window -+ const unsigned long FAVICON_LOAD_NON_PRIVATE = 2; -+ -+ /** -+ * For a given icon URI, this will return a URI that will result in the image. -+ * In most cases, this is an annotation URI. For chrome URIs, this will do -+ * nothing but returning the input URI. -+ * -+ * No validity checking is done. If you pass an icon URI that we've never -+ * seen, you'll get back a URI that references an invalid icon. The moz-anno -+ * protocol handler's special case for "favicon" annotations will resolve -+ * invalid icons to the default icon, although without caching. -+ * For invalid chrome URIs, you'll get a broken image. -+ * -+ * @param aFaviconURI -+ * The URI of an icon in the favicon service. -+ * @return A URI that will give you the icon image. This is NOT the URI of -+ * the icon as set on the page, but a URI that will give you the -+ * data out of the favicon service. For a normal page with a -+ * favicon we've stored, this will be an annotation URI which will -+ * then cause the corresponding favicon data to be loaded async from -+ * this service. For pages where we don't have a favicon, this will -+ * be a chrome URI of the default icon. For chrome URIs, the -+ * output will be the same as the input. -+ */ -+ nsIURI getFaviconLinkForIcon(in nsIURI aFaviconURI); -+ -+ /** -+ * Expire all known favicons from the database. -+ * -+ * @note This is an async method. -+ * On successful completion a "places-favicons-expired" notification is -+ * dispatched through observer's service. -+ */ -+ void expireAllFavicons(); -+ -+ /** -+ * Adds a given favicon's URI to the failed favicon cache. -+ * -+ * The lifespan of the favicon cache is up to the caching system. This cache -+ * will also be written when setAndLoadFaviconForPage hits an error while -+ * fetching an icon. -+ * -+ * @param aFaviconURI -+ * The URI of an icon in the favicon service. -+ */ -+ void addFailedFavicon(in nsIURI aFaviconURI); -+ -+ /** -+ * Removes the given favicon from the failed favicon cache. If the icon is -+ * not in the cache, it will silently succeed. -+ * -+ * @param aFaviconURI -+ * The URI of an icon in the favicon service. -+ */ -+ void removeFailedFavicon(in nsIURI aFaviconURI); -+ -+ /** -+ * Checks to see if a favicon is in the failed favicon cache. -+ * A positive return value means the icon is in the failed cache and you -+ * probably shouldn't try to load it. A false return value means that it's -+ * worth trying to load it. -+ * This allows you to avoid trying to load "foo.com/favicon.ico" for every -+ * page on a site that doesn't have a favicon. -+ * -+ * @param aFaviconURI -+ * The URI of an icon in the favicon service. -+ */ -+ boolean isFailedFavicon(in nsIURI aFaviconURI); -+ -+ /** -+ * The default favicon URI -+ */ -+ readonly attribute nsIURI defaultFavicon; -+ +@@ -81,16 +81,24 @@ interface nsIFaviconService : nsISupport + * The URI of an icon in the favicon service. + */ + boolean isFailedFavicon(in nsIURI aFaviconURI); + + /** + * The default favicon URI + */ + readonly attribute nsIURI defaultFavicon; ++ + nsIURI getFaviconForPage(in nsIURI aPageURI); ++ + void getFaviconData(in nsIURI aFaviconURI, + out AUTF8String aMimeType, + [optional] out unsigned long aDataLen, + [array,retval,size_is(aDataLen)] out octet aData); -+}; -+ -+[scriptable, function, uuid(c85e5c82-b70f-4621-9528-beb2aa47fb44)] -+interface nsIFaviconDataCallback : nsISupports -+{ -+ /** -+ * Called when the required favicon's information is available. -+ * -+ * It's up to the invoking method to state if the callback is always invoked, -+ * or called on success only. Check the method documentation to ensure that. -+ * -+ * The caller will receive the most information we can gather on the icon, -+ * but it's not guaranteed that all of them will be set. For some method -+ * we could not know the favicon's data (it could just be too expensive to -+ * get it, or the method does not require we actually have any data). -+ * It's up to the caller to check aDataLen > 0 before using any data-related -+ * information like mime-type or data itself. -+ * -+ * @param aFaviconURI -+ * Receives the "favicon URI" (not the "favicon link URI") associated -+ * to the requested page. This can be null if there is no associated -+ * favicon URI, or the callback is notifying a failure. -+ * @param aDataLen -+ * Size of the icon data in bytes. Notice that a value of 0 does not -+ * necessarily mean that we don't have an icon. -+ * @param aData -+ * Icon data, or an empty array if aDataLen is 0. -+ * @param aMimeType -+ * Mime type of the icon, or an empty string if aDataLen is 0. -+ * -+ * @note If you want to open a network channel to access the favicon, it's -+ * recommended that you call the getFaviconLinkForIcon method to convert -+ * the "favicon URI" into a "favicon link URI". -+ */ -+ void onComplete(in nsIURI aFaviconURI, -+ in unsigned long aDataLen, -+ [const,array,size_is(aDataLen)] in octet aData, -+ in AUTF8String aMimeType); -+}; -+ -+%{C++ -+ -+/** -+ * Notification sent when all favicons are expired. -+ */ -+#define NS_PLACES_FAVICONS_EXPIRED_TOPIC_ID "places-favicons-expired" -+ -+#define FAVICON_DEFAULT_URL "chrome://mozapps/skin/places/defaultFavicon.png" -+#define FAVICON_ERRORPAGE_URL "chrome://global/skin/icons/warning-16.png" -+ -+%} -diff --git a/toolkit/components/startup/public/moz.build b/toolkit/components/startup/public/moz.build ---- a/toolkit/components/startup/public/moz.build -+++ b/toolkit/components/startup/public/moz.build -@@ -1,13 +1,14 @@ - # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- - # vim: set filetype=python: - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ + }; - XPIDL_SOURCES += [ - 'nsIAppStartup.idl', -+ 'nsIAppStartup2.idl', - 'nsIUserInfo.idl', - ] + [scriptable, function, uuid(c85e5c82-b70f-4621-9528-beb2aa47fb44)] + interface nsIFaviconDataCallback : nsISupports + { + /** + * Called when the required favicon's information is available. + * +diff --git a/toolkit/components/processsingleton/MainProcessSingleton.js b/toolkit/components/processsingleton/MainProcessSingleton.js +--- a/toolkit/components/processsingleton/MainProcessSingleton.js ++++ b/toolkit/components/processsingleton/MainProcessSingleton.js +@@ -82,21 +82,21 @@ MainProcessSingleton.prototype = { + switch (topic) { + case "app-startup": { + Services.obs.addObserver(this, "xpcom-shutdown", false); + + // Load this script early so that console.* is initialized + // before other frame scripts. + globalmm.loadFrameScript("chrome://global/content/browser-content.js", true); + ppmm.addMessageListener("Console:Log", this.logConsoleMessage); +- globalmm.addMessageListener("Search:AddEngine", this.addSearchEngine); ++ ppmm.addMessageListener("Search:AddEngine", this.addSearchEngine); + break; + } + + case "xpcom-shutdown": + ppmm.removeMessageListener("Console:Log", this.logConsoleMessage); +- globalmm.removeMessageListener("Search:AddEngine", this.addSearchEngine); ++ ppmm.removeMessageListener("Search:AddEngine", this.addSearchEngine); + break; + } + }, + }; + + this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MainProcessSingleton]); +diff --git a/toolkit/components/search/nsSidebar.js b/toolkit/components/search/nsSidebar.js +--- a/toolkit/components/search/nsSidebar.js ++++ b/toolkit/components/search/nsSidebar.js +@@ -11,20 +11,18 @@ Cu.import("resource://gre/modules/XPCOMU + const SHERLOCK_FILE_EXT_REGEXP = /\.src$/i; + + function nsSidebar() { + } + + nsSidebar.prototype = { + init: function(window) { + this.window = window; +- this.mm = window.QueryInterface(Ci.nsIInterfaceRequestor) +- .getInterface(Ci.nsIDocShell) +- .QueryInterface(Ci.nsIInterfaceRequestor) +- .getInterface(Ci.nsIContentFrameMessageManager); ++ this.mm = Components.classes["@mozilla.org/childprocessmessagemanager;1"] ++ .getService(Ci.nsISyncMessageSender); + }, + + // The suggestedTitle and suggestedCategory parameters are ignored, but remain + // for backward compatibility. + addSearchEngine: function(engineURL, iconURL, suggestedTitle, suggestedCategory) { + let dataType = SHERLOCK_FILE_EXT_REGEXP.test(engineURL) ? + Ci.nsISearchEngine.DATA_TEXT : + Ci.nsISearchEngine.DATA_XML; +@@ -40,17 +38,17 @@ nsSidebar.prototype = { + // This function exists largely to implement window.external.AddSearchProvider(), + // to match other browsers' APIs. The capitalization, although nonstandard here, + // is therefore important. + AddSearchProvider: function(engineURL) { + this.mm.sendAsyncMessage("Search:AddEngine", { + pageURL: this.window.document.documentURIObject.spec, + engineURL, + type: Ci.nsISearchEngine.DATA_XML +- }); ++ },{win:this.window}); + }, + + // This function exists to implement window.external.IsSearchProviderInstalled(), + // for compatibility with other browsers. The function has been deprecated + // and so will not be implemented. + IsSearchProviderInstalled: function(engineURL) { + return 0; + }, +diff --git a/toolkit/mozapps/extensions/addonManager.js b/toolkit/mozapps/extensions/addonManager.js +--- a/toolkit/mozapps/extensions/addonManager.js ++++ b/toolkit/mozapps/extensions/addonManager.js +@@ -37,21 +37,21 @@ let gParentMM = null; + + + function amManager() { + Cu.import("resource://gre/modules/AddonManager.jsm"); + + let globalMM = Cc["@mozilla.org/globalmessagemanager;1"] + .getService(Ci.nsIMessageListenerManager); + globalMM.loadFrameScript(CHILD_SCRIPT, true); +- globalMM.addMessageListener(MSG_INSTALL_ADDONS, this); - XPIDL_MODULE = 'appstartup' + gParentMM = Cc["@mozilla.org/parentprocessmessagemanager;1"] + .getService(Ci.nsIMessageListenerManager); + gParentMM.addMessageListener(MSG_INSTALL_ENABLED, this); ++ gParentMM.addMessageListener(MSG_INSTALL_ADDONS, this); + // Needed so receiveMessage can be called directly by JS callers + this.wrappedJSObject = this; + } + + amManager.prototype = { + observe: function AMC_observe(aSubject, aTopic, aData) { + if (aTopic == "addons-startup") +@@ -89,17 +89,17 @@ amManager.prototype = { + if (!AddonManager.isInstallAllowed(aMimetype, aInstallingPrincipal)) { + aCallback = null; + retval = false; + } + + let installs = []; + function buildNextInstall() { + if (aUris.length == 0) { +- AddonManager.installAddonsFromWebpage(aMimetype, aBrowser, aInstallingPrincipal, installs); ++ AddonManager.installAddonsFromWebpage(aMimetype, null, aInstallingPrincipal, installs); + return; + } + let uri = aUris.shift(); + AddonManager.getInstallForURL(uri, function buildNextInstall_getInstallForURL(aInstall) { + function callCallback(aUri, aStatus) { + try { + aCallback.onInstallEnded(aUri, aStatus); + } +@@ -171,17 +171,17 @@ amManager.prototype = { + url: url, + status: status + }); + }, + }; + } + + return this.installAddonsFromWebpage(payload.mimetype, +- aMessage.target, payload.triggeringPrincipal, payload.uris, ++ null, payload.triggeringPrincipal, payload.uris, + payload.hashes, payload.names, payload.icons, callback); + } + } + }, + + classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"), + _xpcom_factory: { + createInstance: function AMC_createInstance(aOuter, aIid) { +diff --git a/toolkit/mozapps/extensions/amContentHandler.js b/toolkit/mozapps/extensions/amContentHandler.js +--- a/toolkit/mozapps/extensions/amContentHandler.js ++++ b/toolkit/mozapps/extensions/amContentHandler.js +@@ -40,16 +40,30 @@ amContentHandler.prototype = { + let window = null; + let callbacks = aRequest.notificationCallbacks ? + aRequest.notificationCallbacks : + aRequest.loadGroup.notificationCallbacks; + if (callbacks) + window = callbacks.getInterface(Ci.nsIDOMWindow); + + aRequest.cancel(Cr.NS_BINDING_ABORTED); ++ ++ let mm = Cc["@mozilla.org/childprocessmessagemanager;1"] ++ .getService(Ci.nsISyncMessageSender); ++ ++ return mm.sendSyncMessage(MSG_INSTALL_ADDONS, { ++ uris: [uri.spec], ++ hashes: [null], ++ names: [null], ++ icons: [null], ++ mimetype: XPI_CONTENT_TYPE, ++ triggeringPrincipal: aRequest.loadInfo.triggeringPrincipal, ++ callbackID: -1 ++ }, {win: window})[0]; ++ + + let installs = { + uris: [uri.spec], + hashes: [null], + names: [null], + icons: [null], + mimetype: XPI_CONTENT_TYPE, + triggeringPrincipal: aRequest.loadInfo.triggeringPrincipal, +diff --git a/toolkit/mozapps/extensions/amInstallTrigger.js b/toolkit/mozapps/extensions/amInstallTrigger.js +--- a/toolkit/mozapps/extensions/amInstallTrigger.js ++++ b/toolkit/mozapps/extensions/amInstallTrigger.js +@@ -89,23 +89,17 @@ RemoteMediator.prototype = { + name: MSG_INSTALL_ADDONS, + target: element, + data: installs, + }); + } + } + + // Fall back to sending through the message manager +- let messageManager = window.QueryInterface(Ci.nsIInterfaceRequestor) +- .getInterface(Ci.nsIWebNavigation) +- .QueryInterface(Ci.nsIDocShell) +- .QueryInterface(Ci.nsIInterfaceRequestor) +- .getInterface(Ci.nsIContentFrameMessageManager); +- +- return messageManager.sendSyncMessage(MSG_INSTALL_ADDONS, installs)[0]; ++ return this.mm.sendSyncMessage(MSG_INSTALL_ADDONS, installs, {win: window})[0]; + }, + + _addCallback: function(callback, urls) { + if (!callback || typeof callback != "function") + return -1; + + let callbackID = this._windowID + "-" + ++this._lastCallbackID; + let callbackObject = new CallbackObject(callbackID, callback, urls, this); diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp -@@ -96,16 +96,17 @@ using mozilla::ipc::TestShellCommandPare - using mozilla::ipc::XPCShellEnvironment; - - using mozilla::startup::sChildProcessType; - - static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); +@@ -24,16 +24,17 @@ + #include "nsIDirectoryService.h" + #include "nsIFile.h" + #include "nsIToolkitChromeRegistry.h" + #include "nsIToolkitProfile.h" #ifdef XP_WIN - static const wchar_t kShellLibraryName[] = L"shell32.dll"; + #include + #include "mozilla/ipc/WindowsMessageLoop.h" +#include "mozilla/widget/AudioSession.h" #endif - nsresult - XRE_LockProfileDirectory(nsIFile* aDirectory, - nsISupports* *aLockObject) - { - nsCOMPtr lock; - -@@ -160,16 +161,20 @@ XRE_InitEmbedding2(nsIFile *aLibXULDirec + #include "nsAppDirectoryServiceDefs.h" + #include "nsAppRunner.h" + #include "nsAutoRef.h" + #include "nsDirectoryServiceDefs.h" + #include "nsExceptionHandler.h" + #include "nsString.h" +@@ -179,16 +180,20 @@ XRE_InitEmbedding2(nsIFile *aLibXULDirec nsCOMPtr startupNotifier (do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID)); @@ -3654,7 +1442,7 @@ diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp { NS_ASSERTION(gDirServiceProvider, "XRE_InitEmbedding was not called!"); gDirServiceProvider->DoStartup(); -@@ -179,16 +184,20 @@ void +@@ -198,16 +203,20 @@ void XRE_TermEmbedding() { if (--sInitCounter != 0) @@ -3675,11 +1463,56 @@ diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp const char* XRE_ChildProcessTypeToString(GeckoProcessType aProcessType) { +diff --git a/widget/nsBaseAppShell.cpp b/widget/nsBaseAppShell.cpp +--- a/widget/nsBaseAppShell.cpp ++++ b/widget/nsBaseAppShell.cpp +@@ -8,21 +8,23 @@ + #include "nsBaseAppShell.h" + #if defined(MOZ_CRASHREPORTER) + #include "nsExceptionHandler.h" + #endif + #include "nsThreadUtils.h" + #include "nsIObserverService.h" + #include "nsServiceManagerUtils.h" + #include "mozilla/Services.h" ++#include "nsXREAppData.h" ++extern const nsXREAppData* gAppData; + + // When processing the next thread event, the appshell may process native + // events (if not in performance mode), which can result in suppressing the + // next thread event for at most this many ticks: +-#define THREAD_EVENT_STARVATION_LIMIT PR_MillisecondsToInterval(20) ++#define THREAD_EVENT_STARVATION_LIMIT PR_MillisecondsToInterval(10) + + NS_IMPL_ISUPPORTS(nsBaseAppShell, nsIAppShell, nsIThreadObserver, nsIObserver) + + nsBaseAppShell::nsBaseAppShell() + : mSuspendNativeCount(0) + , mEventloopNestingLevel(0) + , mBlockedWait(nullptr) + , mFavorPerf(0) +@@ -266,16 +268,17 @@ nsBaseAppShell::OnProcessNextEvent(nsITh + // When mayWait is true, we need to make sure that there is an event in the + // thread's event queue before we return. Otherwise, the thread will block + // on its event queue waiting for an event. + bool needEvent = mayWait; + // Reset prior to invoking DoProcessNextNativeEvent which might cause + // NativeEventCallback to process gecko events. + mProcessedGeckoEvents = false; + ++ if (gAppData) + if (mFavorPerf <= 0 && start > mSwitchTime + mStarvationDelay) { + // Favor pending native events + PRIntervalTime now = start; + bool keepGoing; + do { + mLastNativeEventTime = now; + keepGoing = DoProcessNextNativeEvent(false, recursionDepth); + } while (keepGoing && ((now = PR_IntervalNow()) - start) < limit); diff --git a/widget/windows/moz.build b/widget/windows/moz.build --- a/widget/windows/moz.build +++ b/widget/windows/moz.build -@@ -45,23 +45,27 @@ UNIFIED_SOURCES += [ - 'nsWindow.cpp', +@@ -47,23 +47,27 @@ UNIFIED_SOURCES += [ 'nsWindowBase.cpp', 'nsWindowDbg.cpp', 'nsWindowGfx.cpp', @@ -3687,12 +1520,12 @@ diff --git a/widget/windows/moz.build b/widget/windows/moz.build 'TaskbarPreview.cpp', 'TaskbarPreviewButton.cpp', 'TaskbarTabPreview.cpp', -- 'TaskbarWindowPreview.cpp', + 'TaskbarWindowPreview.cpp', - 'WidgetTraceEvent.cpp', -+ 'TaskbarWindowPreview.cpp', 'WindowHook.cpp', 'WinIMEHandler.cpp', 'WinTaskbar.cpp', + 'WinUtils.cpp', ] +if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']: @@ -3700,113 +1533,18 @@ diff --git a/widget/windows/moz.build b/widget/windows/moz.build + 'WidgetTraceEvent.cpp', + ] + - # The following files cannot be built in unified mode because they force NSPR logging. + # The following files cannot be built in unified mode because of name clashes. SOURCES += [ - 'nsIMM32Handler.cpp', + 'JumpListBuilder.cpp', + 'nsBidiKeyboard.cpp', + 'nsFilePicker.cpp', + 'nsWidgetFactory.cpp', 'WinMouseScrollHandler.cpp', - 'WinUtils.cpp', ] - - # The following files cannot be built in unified mode because of name clashes. -diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp ---- a/widget/windows/nsAppShell.cpp -+++ b/widget/windows/nsAppShell.cpp -@@ -167,16 +167,17 @@ nsAppShell::Init() - wc.lpszClassName = kWindowClass; - RegisterClassW(&wc); - } - - mEventWnd = CreateWindowW(kWindowClass, L"nsAppShell:EventWindow", - 0, 0, 0, 10, 10, nullptr, nullptr, module, nullptr); - NS_ENSURE_STATE(mEventWnd); - -+ mAppStartup = do_GetService("@mozilla.org/toolkit/app-startup;1"); - return nsBaseAppShell::Init(); - } - - NS_IMETHODIMP - nsAppShell::Run(void) - { - // Ignore failure; failing to start the application is not exactly an - // appropriate response to failing to start an audio session. -@@ -283,16 +284,17 @@ nsAppShell::ProcessNextNativeEvent(bool - (msg.message >= NS_WM_IMEFIRST && msg.message <= NS_WM_IMELAST) || - (msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST); - } - - if (gotMessage) { - if (msg.message == WM_QUIT) { - ::PostQuitMessage(msg.wParam); - Exit(); -+ } else if (mAppStartup && NS_SUCCEEDED(mAppStartup->ProcessNativeEvent((void*)&msg))) { - } else { - // If we had UI activity we would be processing it now so we know we - // have either kUIActivity or kActivityNoUIAVail. - mozilla::HangMonitor::NotifyActivity( - uiMessage ? mozilla::HangMonitor::kUIActivity : - mozilla::HangMonitor::kActivityNoUIAVail); - - if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST && -diff --git a/widget/windows/nsAppShell.h b/widget/windows/nsAppShell.h ---- a/widget/windows/nsAppShell.h -+++ b/widget/windows/nsAppShell.h -@@ -2,16 +2,17 @@ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #ifndef nsAppShell_h__ - #define nsAppShell_h__ - - #include "nsBaseAppShell.h" -+#include "nsIAppStartup2.h" - #include - #include "mozilla/TimeStamp.h" - #include "mozilla/Mutex.h" - - // The maximum time we allow before forcing a native event callback. - // In seconds. - #define NATIVE_EVENT_STARVATION_LIMIT 1 - -@@ -44,11 +45,12 @@ protected: - static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM); - - protected: - HWND mEventWnd; - bool mNativeCallbackPending; - - Mutex mLastNativeEventScheduledMutex; - TimeStamp mLastNativeEventScheduled; -+ nsCOMPtr mAppStartup; - }; - - #endif // nsAppShell_h__ -diff --git a/widget/windows/nsClipboard.cpp b/widget/windows/nsClipboard.cpp ---- a/widget/windows/nsClipboard.cpp -+++ b/widget/windows/nsClipboard.cpp -@@ -80,17 +80,17 @@ NS_IMETHODIMP - nsClipboard::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) - { - // This will be called on shutdown. - ::OleFlushClipboard(); - ::CloseClipboard(); - - return NS_OK; --} -+ } - - //------------------------------------------------------------------------- - UINT nsClipboard::GetFormat(const char* aMimeStr) - { - UINT format; - - if (strcmp(aMimeStr, kTextMime) == 0) - format = CF_TEXT; diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp -@@ -72,17 +72,19 @@ +@@ -76,17 +76,19 @@ #include #include "prlog.h" @@ -3826,7 +1564,7 @@ diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp #include "nsIScreenManager.h" #include "imgIContainer.h" #include "nsIFile.h" -@@ -4317,24 +4324,24 @@ LRESULT CALLBACK nsWindow::WindowProcInt +@@ -4319,24 +4321,24 @@ LRESULT CALLBACK nsWindow::WindowProcInt // Route WM_HSCROLL messages to the main window. hWnd = ::GetParent(::GetParent(hWnd)); } else { @@ -3853,125 +1591,41 @@ diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp // Hold the window for the life of this method, in case it gets // destroyed during processing, unless we're in the dtor already. -diff --git a/widget/xpwidgets/nsBaseAppShell.cpp b/widget/xpwidgets/nsBaseAppShell.cpp ---- a/widget/xpwidgets/nsBaseAppShell.cpp -+++ b/widget/xpwidgets/nsBaseAppShell.cpp -@@ -8,21 +8,24 @@ - #include "nsBaseAppShell.h" - #if defined(MOZ_CRASHREPORTER) - #include "nsExceptionHandler.h" - #endif - #include "nsThreadUtils.h" - #include "nsIObserverService.h" - #include "nsServiceManagerUtils.h" - #include "mozilla/Services.h" -+#include "nsXREAppData.h" -+ -+extern const nsXREAppData* gAppData; - - // When processing the next thread event, the appshell may process native - // events (if not in performance mode), which can result in suppressing the - // next thread event for at most this many ticks: --#define THREAD_EVENT_STARVATION_LIMIT PR_MillisecondsToInterval(20) -+#define THREAD_EVENT_STARVATION_LIMIT PR_MillisecondsToInterval(10) - - NS_IMPL_ISUPPORTS(nsBaseAppShell, nsIAppShell, nsIThreadObserver, nsIObserver) - - nsBaseAppShell::nsBaseAppShell() - : mSuspendNativeCount(0) - , mEventloopNestingLevel(0) - , mBlockedWait(nullptr) - , mFavorPerf(0) -@@ -265,17 +268,17 @@ nsBaseAppShell::OnProcessNextEvent(nsITh - - // When mayWait is true, we need to make sure that there is an event in the - // thread's event queue before we return. Otherwise, the thread will block - // on its event queue waiting for an event. - bool needEvent = mayWait; - // Reset prior to invoking DoProcessNextNativeEvent which might cause - // NativeEventCallback to process gecko events. - mProcessedGeckoEvents = false; -- -+ if (gAppData) - if (mFavorPerf <= 0 && start > mSwitchTime + mStarvationDelay) { - // Favor pending native events - PRIntervalTime now = start; - bool keepGoing; - do { - mLastNativeEventTime = now; - keepGoing = DoProcessNextNativeEvent(false, recursionDepth); - } while (keepGoing && ((now = PR_IntervalNow()) - start) < limit); -@@ -292,18 +295,18 @@ nsBaseAppShell::OnProcessNextEvent(nsITh - // events to process. Note that an inner nested event loop causes - // 'mayWait' to become false too, through 'mBlockedWait'. - if (mExiting) - mayWait = false; - - mLastNativeEventTime = PR_IntervalNow(); - if (!DoProcessNextNativeEvent(mayWait, recursionDepth) || !mayWait) - break; -- } -- -+ } -+ - mBlockedWait = oldBlockedWait; - - // Make sure that the thread event queue does not block on its monitor, as - // it normally would do if it did not have any pending events. To avoid - // that, we simply insert a dummy event into its queue during shutdown. - if (needEvent && !mExiting && !NS_HasPendingEvents(thr)) { - DispatchDummyEvent(thr); - } -diff --git a/xpcom/glue/pldhash.cpp b/xpcom/glue/pldhash.cpp ---- a/xpcom/glue/pldhash.cpp -+++ b/xpcom/glue/pldhash.cpp -@@ -631,16 +631,18 @@ PL_DHashTableRawRemove(PLDHashTable *tab - MARK_ENTRY_FREE(entry); - } - table->entryCount--; - } - - uint32_t - PL_DHashTableEnumerate(PLDHashTable *table, PLDHashEnumerator etor, void *arg) - { -+ MOZ_ASSERT(table != nullptr, "table must not be null"); -+ if (!table) return 0; - INCREMENT_RECURSION_LEVEL(table); - - char *entryAddr = table->entryStore; - uint32_t entrySize = table->entrySize; - uint32_t capacity = PL_DHASH_TABLE_SIZE(table); - uint32_t tableSize = capacity * entrySize; - char *entryLimit = entryAddr + tableSize; - uint32_t i = 0; diff --git a/xpcom/threads/HangMonitor.cpp b/xpcom/threads/HangMonitor.cpp --- a/xpcom/threads/HangMonitor.cpp +++ b/xpcom/threads/HangMonitor.cpp -@@ -1,8 +1,9 @@ -+ - /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #include "mozilla/HangMonitor.h" - #include "mozilla/BackgroundHangMonitor.h" - #include "mozilla/Monitor.h" -@@ -297,16 +298,17 @@ Shutdown() - - delete gMonitor; - gMonitor = nullptr; +@@ -496,31 +496,31 @@ Shutdown() + // gAnnotators is a StaticAutoPtr, so we just need to null it out. + gAnnotators = nullptr; + #endif } static bool IsUIMessageWaiting() { -+ return false; - #ifndef XP_WIN +-#ifndef XP_WIN ++//#ifndef XP_WIN return false; - #else - #define NS_WM_IMEFIRST WM_IME_SETCONTEXT - #define NS_WM_IMELAST WM_IME_KEYUP +-#else ++//#else + #define NS_WM_IMEFIRST WM_IME_SETCONTEXT + #define NS_WM_IMELAST WM_IME_KEYUP BOOL haveUIMessageWaiting = FALSE; MSG msg; - haveUIMessageWaiting |= ::PeekMessageW(&msg, nullptr, WM_KEYFIRST, + haveUIMessageWaiting |= ::PeekMessageW(&msg, nullptr, WM_KEYFIRST, + WM_IME_KEYLAST, PM_NOREMOVE); + haveUIMessageWaiting |= ::PeekMessageW(&msg, nullptr, NS_WM_IMEFIRST, + NS_WM_IMELAST, PM_NOREMOVE); + haveUIMessageWaiting |= ::PeekMessageW(&msg, nullptr, WM_MOUSEFIRST, + WM_MOUSELAST, PM_NOREMOVE); + return haveUIMessageWaiting; +-#endif ++//#endif + } + + void + NotifyActivity(ActivityType aActivityType) + { + MOZ_ASSERT(NS_IsMainThread(), + "HangMonitor::Notify called from off the main thread."); +