merge mozilla-inbound to mozilla-central. r=merge a=merge

MozReview-Commit-ID: GSDYk9wLOAM

--HG--
rename : browser/base/content/test/general/browser_bug561636.js => browser/modules/test/browser/formValidation/browser_form_validation.js
rename : browser/base/content/test/general/browser_bug595507.js => browser/modules/test/browser/formValidation/browser_validation_iframe.js
rename : browser/modules/test/browser/browser_bug1319078.js => browser/modules/test/browser/formValidation/browser_validation_invisible.js
This commit is contained in:
Sebastian Hengst 2017-11-01 22:55:12 +01:00
commit 4ff29d14f8
509 changed files with 6070 additions and 8548 deletions

View File

@ -399,7 +399,9 @@ protected:
class TextDecorValue
{
public:
TextDecorValue() { }
TextDecorValue() :
mColor{0}, mLine{NS_STYLE_TEXT_DECORATION_LINE_NONE},
mStyle{NS_STYLE_TEXT_DECORATION_STYLE_NONE} { }
explicit TextDecorValue(nsIFrame* aFrame);
nscolor Color() const { return mColor; }

View File

@ -47,7 +47,7 @@ public:
TextRange(HyperTextAccessible* aRoot,
HyperTextAccessible* aStartContainer, int32_t aStartOffset,
HyperTextAccessible* aEndContainer, int32_t aEndOffset);
TextRange() {}
TextRange() : mStartOffset{0}, mEndOffset{0} {}
TextRange(TextRange&& aRange) :
mRoot(mozilla::Move(aRange.mRoot)),
mStartContainer(mozilla::Move(aRange.mStartContainer)),

View File

@ -20,8 +20,9 @@ using namespace mozilla::a11y;
class RuleCache
{
public:
explicit RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
mAcceptRoles(nullptr) { }
explicit RuleCache(nsIAccessibleTraversalRule* aRule) :
mRule(aRule), mAcceptRoles(nullptr),
mAcceptRolesLength{0}, mPreFilter{0} { }
~RuleCache () {
if (mAcceptRoles)
free(mAcceptRoles);

View File

@ -94,7 +94,7 @@ DocAccessible::
mDocumentNode(aDocument),
mScrollPositionChangedTicks(0),
mLoadState(eTreeConstructionPending), mDocFlags(0), mLoadEventType(0),
mVirtualCursor(nullptr),
mARIAAttrOldValue{nullptr}, mVirtualCursor(nullptr),
mPresShell(aPresShell), mIPCDoc(nullptr)
{
mGenericTypes |= eDocument;

View File

@ -463,9 +463,9 @@ Section "-Application" APP_IDX
; Always add the application's shortcuts to the shortcuts log ini file. The
; DeleteShortcuts macro will do the right thing on uninstall if the
; shortcuts don't exist.
${LogStartMenuShortcut} "${BrandFullName}.lnk"
${LogQuickLaunchShortcut} "${BrandFullName}.lnk"
${LogDesktopShortcut} "${BrandFullName}.lnk"
${LogStartMenuShortcut} "${BrandShortName}.lnk"
${LogQuickLaunchShortcut} "${BrandShortName}.lnk"
${LogDesktopShortcut} "${BrandShortName}.lnk"
; Best effort to update the Win7 taskbar and start menu shortcut app model
; id's. The possible contexts are current user / system and the user that
@ -495,17 +495,17 @@ Section "-Application" APP_IDX
; since this will either add it for the user if unelevated or All Users if
; elevated.
${If} $AddStartMenuSC == 1
CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \
CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true"
ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" "$AppUserModelID" "true"
${EndIf}
${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandFullName}.lnk"
${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandShortName}.lnk"
${Else}
${LogMsg} "** ERROR Adding Shortcut: $SMPROGRAMS\${BrandFullName}.lnk"
${LogMsg} "** ERROR Adding Shortcut: $SMPROGRAMS\${BrandShortName}.lnk"
${EndIf}
${EndIf}
@ -525,17 +525,17 @@ Section "-Application" APP_IDX
${EndIf}
${If} $AddDesktopSC == 1
CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" \
CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true"
ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" "$AppUserModelID" "true"
${EndIf}
${LogMsg} "Added Shortcut: $DESKTOP\${BrandFullName}.lnk"
${LogMsg} "Added Shortcut: $DESKTOP\${BrandShortName}.lnk"
${Else}
${LogMsg} "** ERROR Adding Shortcut: $DESKTOP\${BrandFullName}.lnk"
${LogMsg} "** ERROR Adding Shortcut: $DESKTOP\${BrandShortName}.lnk"
${EndIf}
${EndIf}
@ -548,12 +548,12 @@ Section "-Application" APP_IDX
${GetOptions} "$0" "/UAC:" $0
${If} ${Errors}
Call AddQuickLaunchShortcut
${LogMsg} "Added Shortcut: $QUICKLAUNCH\${BrandFullName}.lnk"
${LogMsg} "Added Shortcut: $QUICKLAUNCH\${BrandShortName}.lnk"
${Else}
; It is not possible to add a log entry from the unelevated process so
; add the log entry without the path since there is no simple way to
; know the correct full path.
${LogMsg} "Added Quick Launch Shortcut: ${BrandFullName}.lnk"
${LogMsg} "Added Quick Launch Shortcut: ${BrandShortName}.lnk"
GetFunctionAddress $0 AddQuickLaunchShortcut
UAC::ExecCodeSegment $0
${EndIf}
@ -744,9 +744,9 @@ FunctionEnd
# Helper Functions
Function AddQuickLaunchShortcut
CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandFullName}.lnk" \
CreateShortCut "$QUICKLAUNCH\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandShortName}.lnk" \
"$INSTDIR"
${EndIf}
FunctionEnd

View File

@ -37,9 +37,6 @@
; setup the application model id registration value
${InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"
; Win7 taskbar and start menu link maintenance
Call FixShortcutAppModelIDs
ClearErrors
WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test"
${If} ${Errors}
@ -54,9 +51,6 @@
${FixShellIconHandler} "HKLM"
${SetAppLSPCategories} ${LSP_CATEGORIES}
; Win7 taskbar and start menu link maintenance
Call FixShortcutAppModelIDs
; Add the Firewall entries after an update
Call AddFirewallEntries
@ -70,25 +64,30 @@
; root of the Start Menu Programs directory.
${MigrateStartMenuShortcut}
; Update lastwritetime of the Start Menu shortcut to clear the tile cache.
; Do this for both shell contexts in case the user has shortcuts in multiple
; locations, then restore the previous context at the end.
${If} ${AtLeastWin8}
SetShellVarContext all
${TouchStartMenuShortcut}
SetShellVarContext current
${TouchStartMenuShortcut}
${If} $TmpVal == "HKLM"
SetShellVarContext all
${ElseIf} $TmpVal == "HKCU"
SetShellVarContext current
${EndIf}
${EndIf}
; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
${MigrateTaskBarShortcut}
; Update the name/icon/AppModelID of our shortcuts as needed, then update the
; lastwritetime of the Start Menu shortcut to clear the tile icon cache.
; Do this for both shell contexts in case the user has shortcuts in multiple
; locations, then restore the previous context at the end.
SetShellVarContext all
${UpdateShortcutBranding}
${If} ${AtLeastWin8}
${TouchStartMenuShortcut}
${EndIf}
Call FixShortcutAppModelIDs
SetShellVarContext current
${UpdateShortcutBranding}
${If} ${AtLeastWin8}
${TouchStartMenuShortcut}
${EndIf}
Call FixShortcutAppModelIDs
${If} $TmpVal == "HKLM"
SetShellVarContext all
${ElseIf} $TmpVal == "HKCU"
SetShellVarContext current
${EndIf}
${RemoveDeprecatedKeys}
${Set32to64DidMigrateReg}
@ -165,10 +164,11 @@
!define PostUpdate "!insertmacro PostUpdate"
; Update the last modified time on the Start Menu shortcut, so that its icon
; gets refreshed. Should be called on Win8+ after MigrateStartMenuShortcut.
; gets refreshed. Should be called on Win8+ after MigrateStartMenuShortcut
; and UpdateShortcutBranding.
!macro TouchStartMenuShortcut
${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
FileOpen $0 "$SMPROGRAMS\${BrandFullName}.lnk" a
${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
FileOpen $0 "$SMPROGRAMS\${BrandShortName}.lnk" a
${IfNot} ${Errors}
System::Call '*(i, i) p .r1'
System::Call 'kernel32::GetSystemTimeAsFileTime(p r1)'
@ -208,51 +208,51 @@
${EndIf}
SetShellVarContext all ; Set $DESKTOP to All Users
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
${Unless} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
SetShellVarContext current ; Set $DESKTOP to the current user's desktop
${EndUnless}
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$DESKTOP\${BrandFullName}.lnk"
${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
ShellLink::GetShortCutArgs "$DESKTOP\${BrandShortName}.lnk"
Pop $0
${If} "$0" == ""
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
ShellLink::GetShortCutTarget "$DESKTOP\${BrandShortName}.lnk"
Pop $0
${GetLongPath} "$0" $0
${If} "$0" == "$INSTDIR\${FileMainEXE}"
Delete "$DESKTOP\${BrandFullName}.lnk"
Delete "$DESKTOP\${BrandShortName}.lnk"
${EndIf}
${EndIf}
${EndIf}
SetShellVarContext all ; Set $SMPROGRAMS to All Users
${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
${Unless} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
SetShellVarContext current ; Set $SMPROGRAMS to the current user's Start
; Menu Programs directory
${EndUnless}
${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$SMPROGRAMS\${BrandFullName}.lnk"
${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
ShellLink::GetShortCutArgs "$SMPROGRAMS\${BrandShortName}.lnk"
Pop $0
${If} "$0" == ""
ShellLink::GetShortCutTarget "$SMPROGRAMS\${BrandFullName}.lnk"
ShellLink::GetShortCutTarget "$SMPROGRAMS\${BrandShortName}.lnk"
Pop $0
${GetLongPath} "$0" $0
${If} "$0" == "$INSTDIR\${FileMainEXE}"
Delete "$SMPROGRAMS\${BrandFullName}.lnk"
Delete "$SMPROGRAMS\${BrandShortName}.lnk"
${EndIf}
${EndIf}
${EndIf}
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
${If} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk"
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandShortName}.lnk"
Pop $0
${If} "$0" == ""
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandShortName}.lnk"
Pop $0
${GetLongPath} "$0" $0
${If} "$0" == "$INSTDIR\${FileMainEXE}"
Delete "$QUICKLAUNCH\${BrandFullName}.lnk"
Delete "$QUICKLAUNCH\${BrandShortName}.lnk"
${EndIf}
${EndIf}
${EndIf}
@ -275,24 +275,24 @@
${EndIf}
SetShellVarContext all ; Set $DESKTOP to All Users
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR"
${Unless} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true"
ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" "$AppUserModelID" "true"
${EndIf}
${Else}
SetShellVarContext current ; Set $DESKTOP to the current user's desktop
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" \
${Unless} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true"
ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" "$AppUserModelID" "true"
${EndIf}
${EndIf}
${EndUnless}
@ -300,26 +300,26 @@
${EndUnless}
SetShellVarContext all ; Set $SMPROGRAMS to All Users
${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \
${Unless} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true"
ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" "$AppUserModelID" "true"
${EndIf}
${Else}
SetShellVarContext current ; Set $SMPROGRAMS to the current user's Start
; Menu Programs directory
${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \
${Unless} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true"
ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" "$AppUserModelID" "true"
${EndIf}
${EndIf}
${EndUnless}
@ -328,11 +328,11 @@
; Windows 7 doesn't use the QuickLaunch directory
${Unless} ${AtLeastWin7}
${AndUnless} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" \
${AndUnless} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk"
CreateShortCut "$QUICKLAUNCH\${BrandShortName}.lnk" \
"$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandFullName}.lnk" \
${If} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandShortName}.lnk" \
"$INSTDIR"
${EndIf}
${EndUnless}
@ -340,9 +340,11 @@
!define ShowShortcuts "!insertmacro ShowShortcuts"
; Update the branding information on all shortcuts our installer created,
; in case the branding has changed between updates.
; to convert from BrandFullName (which is what we used to name shortcuts)
; to BrandShortName (which is what we now name shortcuts). Also update the
; icon if it's been changed.
; This should only be called sometime after both MigrateStartMenuShortcut
; and MigrateTaskBarShurtcut
; and MigrateTaskBarShurtcut, and it assumes SHCTX is set correctly.
!macro UpdateShortcutBranding
${GetLongPath} "$INSTDIR\uninstall\${SHORTCUTS_LOG}" $R9
${If} ${FileExists} "$R9"
@ -370,16 +372,16 @@
${EndIf}
${If} $R5 == "1"
${OrIf} $R8 != "${BrandFullName}.lnk"
${OrIf} $R8 != "${BrandShortName}.lnk"
Delete "$SMPROGRAMS\$R8"
${If} ${FileExists} "$INSTDIR\firefox.ico"
CreateShortcut "$SMPROGRAMS\${BrandFullName}.lnk" \
CreateShortcut "$SMPROGRAMS\${BrandShortName}.lnk" \
"$INSTDIR\${FileMainEXE}" "" "$INSTDIR\firefox.ico"
${Else}
CreateShortcut "$SMPROGRAMS\${BrandFullName}.lnk" \
CreateShortcut "$SMPROGRAMS\${BrandShortName}.lnk" \
"$INSTDIR\${FileMainEXE}"
${EndIf}
WriteINIStr "$R9" "STARTMENU" "Shortcut0" "${BrandFullName}.lnk"
WriteINIStr "$R9" "STARTMENU" "Shortcut0" "${BrandShortName}.lnk"
${EndIf}
${EndIf}
${EndIf}
@ -407,16 +409,16 @@
${EndIf}
${If} $R5 == "1"
${OrIf} $R8 != "${BrandFullName}.lnk"
${OrIf} $R8 != "${BrandShortName}.lnk"
Delete "$DESKTOP\$R8"
${If} ${FileExists} "$INSTDIR\firefox.ico"
CreateShortcut "$DESKTOP\${BrandFullName}.lnk" \
CreateShortcut "$DESKTOP\${BrandShortName}.lnk" \
"$INSTDIR\${FileMainEXE}" "" "$INSTDIR\firefox.ico"
${Else}
CreateShortcut "$DESKTOP\${BrandFullName}.lnk" \
CreateShortcut "$DESKTOP\${BrandShortName}.lnk" \
"$INSTDIR\${FileMainEXE}"
${EndIf}
WriteINIStr "$R9" "DESKTOP" "Shortcut0" "${BrandFullName}.lnk"
WriteINIStr "$R9" "DESKTOP" "Shortcut0" "${BrandShortName}.lnk"
${EndIf}
${EndIf}
${EndIf}
@ -1291,7 +1293,7 @@
ReadINIStr $1 "$0" "STARTMENU" "Shortcut0"
${If} ${Errors}
; The STARTMENU ini section doesn't exist.
${LogStartMenuShortcut} "${BrandFullName}.lnk"
${LogStartMenuShortcut} "${BrandShortName}.lnk"
${GetLongPath} "$SMPROGRAMS" $2
${GetLongPath} "$2\$5" $1
${If} "$1" != ""
@ -1302,14 +1304,14 @@
ShellLink::GetShortCutTarget "$1\$3"
Pop $4
${If} "$INSTDIR\${FileMainEXE}" == "$4"
CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" \
CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" \
"$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \
${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" \
ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" \
"$AppUserModelID" "true"
${EndIf}
${EndIf}
@ -1387,9 +1389,9 @@
!macro CreateShortcutsLog
${GetShortcutsLogPath} $0
${Unless} ${FileExists} "$0"
${LogStartMenuShortcut} "${BrandFullName}.lnk"
${LogQuickLaunchShortcut} "${BrandFullName}.lnk"
${LogDesktopShortcut} "${BrandFullName}.lnk"
${LogStartMenuShortcut} "${BrandShortName}.lnk"
${LogQuickLaunchShortcut} "${BrandShortName}.lnk"
${LogDesktopShortcut} "${BrandShortName}.lnk"
${EndUnless}
!macroend
!define CreateShortcutsLog "!insertmacro CreateShortcutsLog"

View File

@ -187,8 +187,8 @@ set_config('XCODE_PATH', xcode_path)
option('--with-compiler-wrapper', env='COMPILER_WRAPPER', nargs=1,
help='Enable compiling with wrappers such as distcc and ccache')
option('--with-ccache', env='CCACHE', nargs='?',
help='Enable compiling with ccache')
js_option('--with-ccache', env='CCACHE', nargs='?',
help='Enable compiling with ccache')
@depends_if('--with-ccache')
@ -1212,6 +1212,19 @@ set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
set_config('VISIBILITY_FLAGS', visibility_flags)
@depends(c_compiler, using_sccache)
def depend_cflags(info, using_sccache):
if info.type not in ('clang-cl', 'msvc'):
return '-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
elif using_sccache:
# sccache supports a special flag to create depfiles
# by parsing MSVC's -showIncludes output.
return '-deps$(MDDEPDIR)/$(@F).pp'
set_config('_DEPEND_CFLAGS', depend_cflags)
@depends(c_compiler)
@imports('multiprocessing')
@imports(_from='__builtin__', _import='min')

View File

@ -447,3 +447,28 @@ def alter_path(sdk_bin_path):
set_config('PATH', alter_path)
check_prog('MAKECAB', ('makecab.exe',))
@depends(c_compiler, using_sccache)
def need_showincludes_prefix(info, using_sccache):
# sccache does its own -showIncludes prefix checking.
if info.type in ('clang-cl', 'msvc') and not using_sccache:
return True
@depends(c_compiler, when=need_showincludes_prefix)
@imports(_from='re', _import='compile', _as='re_compile')
def msvc_showincludes_prefix(c_compiler):
pattern = re_compile(br'^([^:]*:.*[ :] )(.*\\stdio.h)$')
output = try_invoke_compiler([c_compiler.compiler], 'C', '#include <stdio.h>\n',
['-nologo', '-c', '-Fonul', '-showIncludes'])
for line in output.splitlines():
if line.endswith(b'\\stdio.h'):
m = pattern.match(line)
if m:
return m.group(1)
# We should have found the prefix and returned earlier
die('Cannot find cl -showIncludes prefix.')
set_config('CL_INCLUDES_PREFIX', msvc_showincludes_prefix)

View File

@ -124,12 +124,6 @@ else
mk_add_options "UPLOAD_EXTRA_FILES+=sccache.log.gz"
case "$platform" in
win*)
# sccache supports a special flag to create depfiles.
#TODO: bug 1318370 - move this all into toolchain.configure
export _DEPEND_CFLAGS='-deps$(MDDEPDIR)/$(@F).pp'
# Windows builds have a default wrapper that needs to be overridden
mk_add_options "export CC_WRAPPER="
mk_add_options "export CXX_WRAPPER="
# For now, sccache doesn't support separate PDBs so force debug info to be
# in object files.
mk_add_options "export COMPILE_PDB_FLAG="

View File

@ -120,8 +120,10 @@ CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
ifdef _MSC_VER
ifndef MOZ_USING_SCCACHE
CC_WRAPPER ?= $(call py_action,cl)
CXX_WRAPPER ?= $(call py_action,cl)
endif
endif # _MSC_VER
CC := $(CC_WRAPPER) $(CC)

View File

@ -29,11 +29,11 @@ function consoleOpened(HUD) {
let container = win._container;
// Make sure autocomplete does not walk through generators.
let result = container.gen1.next();
let result = container.gen1.next().value;
let completion = JSPropertyProvider(dbgWindow, null, "_container.gen1.");
isnot(completion.matches.length, 0, "Got matches for gen1");
is(result + 1, container.gen1.next(), "gen1.next() did not execute");
is(result + 1, container.gen1.next().value, "gen1.next() did not execute");
result = container.gen2.next().value;

View File

@ -7,7 +7,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="application/javascript;version=1.8">
(function(){
function genFunc() {
function* genFunc() {
var a = 5;
while (a < 10) {
yield a++;

View File

@ -946,10 +946,15 @@ nsDocShell::DestroyChildren()
nsDocLoader::DestroyChildren();
}
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsDocShell,
nsDocLoader,
mSessionStorageManager,
mScriptGlobal)
NS_IMPL_ADDREF_INHERITED(nsDocShell, nsDocLoader)
NS_IMPL_RELEASE_INHERITED(nsDocShell, nsDocLoader)
NS_INTERFACE_MAP_BEGIN(nsDocShell)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDocShell)
NS_INTERFACE_MAP_ENTRY(nsIDocShell)
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem)
NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)

View File

@ -173,6 +173,7 @@ public:
virtual nsresult Init() override;
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDocShell, nsDocLoader)
NS_DECL_NSIDOCSHELL
NS_DECL_NSIDOCSHELLTREEITEM

View File

@ -98,7 +98,10 @@ RequestWatcher = {
// have the flag, so we just ignore them.
// We also see, eg, resource://gre-resources/loading-image.png, so
// skip resource:// URLs too.
if (req.name.startsWith("about:") || req.name.startsWith("resource:")) {
// We may also see, eg, chrome://global/skin/icons/resizer.png, so
// skip chrome:// URLs too.
if (req.name.startsWith("about:") || req.name.startsWith("resource:") ||
req.name.startsWith("chrome:")) {
return;
}
is(req.loadFlags & TEST_FLAGS, TEST_FLAGS, "request " + req.name + " has the expected flags");

View File

@ -1726,20 +1726,6 @@ Navigator::HasUserMediaSupport(JSContext* /* unused */,
Preferences::GetBool("media.peerconnection.enabled", false);
}
/* static */
bool
Navigator::IsE10sEnabled(JSContext* aCx, JSObject* aGlobal)
{
return XRE_IsContentProcess();
}
bool
Navigator::MozE10sEnabled()
{
// This will only be called if IsE10sEnabled() is true.
return true;
}
/* static */
already_AddRefed<nsPIDOMWindowInner>
Navigator::GetWindowFromGlobal(JSObject* aGlobal)

View File

@ -227,8 +227,6 @@ public:
void GetLanguages(nsTArray<nsString>& aLanguages);
bool MozE10sEnabled();
StorageManager* Storage();
static void GetAcceptLanguages(nsTArray<nsString>& aLanguages);
@ -240,8 +238,6 @@ public:
static bool HasUserMediaSupport(JSContext* /* unused */,
JSObject* /* unused */);
static bool IsE10sEnabled(JSContext* aCx, JSObject* aGlobal);
nsPIDOMWindowInner* GetParentObject() const
{
return GetWindow();

View File

@ -508,7 +508,7 @@ mozilla::dom::TraceBlackJS(JSTracer* aTrc, uint32_t aGCNumber, bool aIsShutdownG
if (windowsById) {
for (auto iter = windowsById->Iter(); !iter.Done(); iter.Next()) {
nsGlobalWindow* window = iter.Data();
if (window->GetDocShell() && window->IsOuterWindow()) {
if (!window->IsCleanedUp() && window->IsOuterWindow()) {
window->TraceGlobalJSObject(aTrc);
EventListenerManager* elm = window->GetExistingListenerManager();
if (elm) {

View File

@ -79,6 +79,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsContentSink)
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mParser)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCSSLoader)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mNodeInfoManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mScriptLoader)
@ -86,6 +87,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsContentSink)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParser)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCSSLoader)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNodeInfoManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mScriptLoader)

View File

@ -70,8 +70,7 @@ public:
NS_IMPL_ISUPPORTS_INHERITED(nsGenConImageContent,
nsXMLElement,
nsIImageLoadingContent,
imgINotificationObserver,
imgIOnloadBlocker)
imgINotificationObserver)
nsresult
NS_NewGenConImageContent(nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,

View File

@ -2325,6 +2325,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMozSelfSupport)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIntlUtils)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell)
tmp->TraverseHostObjectURIs(cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChromeFields.mBrowserDOMWindow)
@ -2408,6 +2410,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMozSelfSupport)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mIntlUtils)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell)
tmp->UnlinkHostObjectURIs();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mIdleRequestExecutor)

View File

@ -669,6 +669,12 @@ public:
mCleanedUp);
}
bool
IsCleanedUp() const
{
return mCleanedUp;
}
bool
HadOriginalOpener() const
{

View File

@ -843,52 +843,6 @@ nsImageLoadingContent::ForceReload(bool aNotify /* = true */,
return result.StealNSResult();
}
NS_IMETHODIMP
nsImageLoadingContent::BlockOnload(imgIRequest* aRequest)
{
if (aRequest == mCurrentRequest) {
NS_ASSERTION(!(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD),
"Double BlockOnload!?");
mCurrentRequestFlags |= REQUEST_BLOCKS_ONLOAD;
} else if (aRequest == mPendingRequest) {
NS_ASSERTION(!(mPendingRequestFlags & REQUEST_BLOCKS_ONLOAD),
"Double BlockOnload!?");
mPendingRequestFlags |= REQUEST_BLOCKS_ONLOAD;
} else {
return NS_OK;
}
nsIDocument* doc = GetOurCurrentDoc();
if (doc) {
doc->BlockOnload();
}
return NS_OK;
}
NS_IMETHODIMP
nsImageLoadingContent::UnblockOnload(imgIRequest* aRequest)
{
if (aRequest == mCurrentRequest) {
NS_ASSERTION(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD,
"Double UnblockOnload!?");
mCurrentRequestFlags &= ~REQUEST_BLOCKS_ONLOAD;
} else if (aRequest == mPendingRequest) {
NS_ASSERTION(mPendingRequestFlags & REQUEST_BLOCKS_ONLOAD,
"Double UnblockOnload!?");
mPendingRequestFlags &= ~REQUEST_BLOCKS_ONLOAD;
} else {
return NS_OK;
}
nsIDocument* doc = GetOurCurrentDoc();
if (doc) {
doc->UnblockOnload(false);
}
return NS_OK;
}
/*
* Non-interface methods
*/
@ -1607,9 +1561,6 @@ nsImageLoadingContent::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
TrackImage(mCurrentRequest);
TrackImage(mPendingRequest);
if (mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD)
aDocument->BlockOnload();
}
void
@ -1622,9 +1573,6 @@ nsImageLoadingContent::UnbindFromTree(bool aDeep, bool aNullParent)
UntrackImage(mCurrentRequest);
UntrackImage(mPendingRequest);
if (mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD)
doc->UnblockOnload(false);
}
void

View File

@ -14,7 +14,6 @@
#define nsImageLoadingContent_h__
#include "imgINotificationObserver.h"
#include "imgIOnloadBlocker.h"
#include "mozilla/CORSMode.h"
#include "mozilla/EventStates.h"
#include "mozilla/TimeStamp.h"
@ -41,8 +40,7 @@ class AsyncEventDispatcher;
#undef LoadImage
#endif
class nsImageLoadingContent : public nsIImageLoadingContent,
public imgIOnloadBlocker
class nsImageLoadingContent : public nsIImageLoadingContent
{
template <typename T> using Maybe = mozilla::Maybe<T>;
using Nothing = mozilla::Nothing;
@ -56,7 +54,6 @@ public:
NS_DECL_IMGINOTIFICATIONOBSERVER
NS_DECL_NSIIMAGELOADINGCONTENT
NS_DECL_IMGIONLOADBLOCKER
// Web IDL binding methods.
// Note that the XPCOM SetLoadingEnabled, AddObserver, RemoveObserver,
@ -421,8 +418,6 @@ protected:
enum {
// Set if the request needs ResetAnimation called on it.
REQUEST_NEEDS_ANIMATION_RESET = 0x00000001U,
// Set if the request is blocking onload.
REQUEST_BLOCKS_ONLOAD = 0x00000002U,
// Set if the request is currently tracked with the document.
REQUEST_IS_TRACKED = 0x00000004U,
// Set if this is an imageset request, such as from <img srcset> or

View File

@ -143,6 +143,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsInProcessTabChildGlobal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsInProcessTabChildGlobal,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell)
tmp->TraverseHostObjectURIs(cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
@ -154,6 +155,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsInProcessTabChildGlobal,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell)
tmp->nsMessageManagerScriptExecutor::Unlink();
tmp->UnlinkHostObjectURIs();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END

View File

@ -639,10 +639,9 @@ protected:
// These members are only used on outer windows.
nsCOMPtr<mozilla::dom::Element> mFrameElement;
// This reference is used by the subclass nsGlobalWindow, and cleared in it's
// DetachFromDocShell() method. This method is called by nsDocShell::Destroy(),
// which is called before the nsDocShell is destroyed.
nsIDocShell* MOZ_NON_OWNING_REF mDocShell; // Weak Reference
// This reference is used by nsGlobalWindow.
nsCOMPtr<nsIDocShell> mDocShell;
// mPerformance is only used on inner windows.
RefPtr<mozilla::dom::Performance> mPerformance;

View File

@ -1019,6 +1019,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D)
// since we're logically destructed at this point.
CanvasRenderingContext2D::RemoveDemotableContext(tmp);
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCanvasElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell)
for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
ImplCycleCollectionUnlink(tmp->mStyleStack[i].patternStyles[Style::STROKE]);
ImplCycleCollectionUnlink(tmp->mStyleStack[i].patternStyles[Style::FILL]);
@ -1042,6 +1043,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCanvasElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell)
for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::STROKE], "Stroke CanvasPattern");
ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::FILL], "Fill CanvasPattern");

View File

@ -0,0 +1,76 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientHandleChild.h"
#include "ClientHandleOpChild.h"
#include "mozilla/dom/ClientIPCTypes.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
void
ClientHandleChild::ActorDestroy(ActorDestroyReason aReason)
{
if (mHandle) {
mHandle->RevokeActor(this);
// Revoking the actor link should automatically cause the owner
// to call RevokeOwner() as well.
MOZ_DIAGNOSTIC_ASSERT(!mHandle);
}
}
PClientHandleOpChild*
ClientHandleChild::AllocPClientHandleOpChild(const ClientOpConstructorArgs& aArgs)
{
MOZ_ASSERT_UNREACHABLE("ClientHandleOpChild must be explicitly constructed.");
return nullptr;
}
bool
ClientHandleChild::DeallocPClientHandleOpChild(PClientHandleOpChild* aActor)
{
delete aActor;
return true;
}
ClientHandleChild::ClientHandleChild()
: mHandle(nullptr)
, mTeardownStarted(false)
{
}
void
ClientHandleChild::SetOwner(ClientThing<ClientHandleChild>* aThing)
{
MOZ_DIAGNOSTIC_ASSERT(!mHandle);
mHandle = aThing;
MOZ_DIAGNOSTIC_ASSERT(mHandle);
}
void
ClientHandleChild::RevokeOwner(ClientThing<ClientHandleChild>* aThing)
{
MOZ_DIAGNOSTIC_ASSERT(mHandle);
MOZ_DIAGNOSTIC_ASSERT(mHandle == aThing);
mHandle = nullptr;
}
void
ClientHandleChild::MaybeStartTeardown()
{
if (mTeardownStarted) {
return;
}
mTeardownStarted = true;
Unused << SendTeardown();
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientHandleChild_h
#define _mozilla_dom_ClientHandleChild_h
#include "ClientThing.h"
#include "mozilla/dom/PClientHandleChild.h"
namespace mozilla {
namespace dom {
class ClientHandle;
class ClientInfo;
template <typename ActorType> class ClientThing;
class ClientHandleChild final : public PClientHandleChild
{
ClientThing<ClientHandleChild>* mHandle;
bool mTeardownStarted;
// PClientHandleChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
PClientHandleOpChild*
AllocPClientHandleOpChild(const ClientOpConstructorArgs& aArgs) override;
bool
DeallocPClientHandleOpChild(PClientHandleOpChild* aActor) override;
public:
ClientHandleChild();
void
SetOwner(ClientThing<ClientHandleChild>* aThing);
void
RevokeOwner(ClientThing<ClientHandleChild>* aThing);
void
MaybeStartTeardown();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientHandleChild_h

View File

@ -0,0 +1,48 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientHandleOpChild.h"
namespace mozilla {
namespace dom {
void
ClientHandleOpChild::ActorDestroy(ActorDestroyReason aReason)
{
if (mPromise) {
mPromise->Reject(NS_ERROR_ABORT, __func__);
mPromise = nullptr;
}
}
IPCResult
ClientHandleOpChild::Recv__delete__(const ClientOpResult& aResult)
{
if (aResult.type() == ClientOpResult::Tnsresult &&
NS_FAILED(aResult.get_nsresult())) {
mPromise->Reject(aResult.get_nsresult(), __func__);
mPromise = nullptr;
return IPC_OK();
}
mPromise->Resolve(aResult, __func__);
mPromise = nullptr;
return IPC_OK();
}
ClientHandleOpChild::ClientHandleOpChild(const ClientOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise)
: mPromise(aPromise)
{
MOZ_DIAGNOSTIC_ASSERT(mPromise);
}
ClientHandleOpChild::~ClientHandleOpChild()
{
MOZ_DIAGNOSTIC_ASSERT(!mPromise);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,37 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientHandleOpChild_h
#define _mozilla_dom_ClientHandleOpChild_h
#include "mozilla/dom/ClientOpPromise.h"
#include "mozilla/dom/PClientHandleOpChild.h"
#include "mozilla/MozPromise.h"
namespace mozilla {
namespace dom {
class ClientHandleOpChild final : public PClientHandleOpChild
{
RefPtr<ClientOpPromise::Private> mPromise;
// PClientHandleOpChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
mozilla::ipc::IPCResult
Recv__delete__(const ClientOpResult& aResult) override;
public:
ClientHandleOpChild(const ClientOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise);
~ClientHandleOpChild();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientHandleOpChild_h

View File

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientHandleOpParent.h"
namespace mozilla {
namespace dom {
void
ClientHandleOpParent::ActorDestroy(ActorDestroyReason aReason)
{
}
void
ClientHandleOpParent::Init(const ClientOpConstructorArgs& aArgs)
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,31 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientHandleOpParent_h
#define _mozilla_dom_ClientHandleOpParent_h
#include "mozilla/dom/PClientHandleOpParent.h"
namespace mozilla {
namespace dom {
class ClientHandleOpParent final : public PClientHandleOpParent
{
// PClientHandleOpParent interface
void
ActorDestroy(ActorDestroyReason aReason) override;
public:
ClientHandleOpParent() = default;
~ClientHandleOpParent() = default;
void
Init(const ClientOpConstructorArgs& aArgs);
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientHandleOpParent_h

View File

@ -0,0 +1,67 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientHandleParent.h"
#include "ClientHandleOpParent.h"
#include "ClientSourceParent.h"
#include "mozilla/dom/ClientIPCTypes.h"
#include "mozilla/Unused.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
IPCResult
ClientHandleParent::RecvTeardown()
{
Unused << Send__delete__(this);
return IPC_OK();
}
void
ClientHandleParent::ActorDestroy(ActorDestroyReason aReason)
{
}
PClientHandleOpParent*
ClientHandleParent::AllocPClientHandleOpParent(const ClientOpConstructorArgs& aArgs)
{
return new ClientHandleOpParent();
}
bool
ClientHandleParent::DeallocPClientHandleOpParent(PClientHandleOpParent* aActor)
{
delete aActor;
return true;
}
IPCResult
ClientHandleParent::RecvPClientHandleOpConstructor(PClientHandleOpParent* aActor,
const ClientOpConstructorArgs& aArgs)
{
auto actor = static_cast<ClientHandleOpParent*>(aActor);
actor->Init(aArgs);
return IPC_OK();
}
ClientHandleParent::ClientHandleParent()
{
}
ClientHandleParent::~ClientHandleParent()
{
}
void
ClientHandleParent::Init(const IPCClientInfo& aClientInfo)
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientHandleParent_h
#define _mozilla_dom_ClientHandleParent_h
#include "mozilla/dom/PClientHandleParent.h"
namespace mozilla {
namespace dom {
class ClientHandleParent final : public PClientHandleParent
{
// PClientHandleParent interface
mozilla::ipc::IPCResult
RecvTeardown() override;
void
ActorDestroy(ActorDestroyReason aReason) override;
PClientHandleOpParent*
AllocPClientHandleOpParent(const ClientOpConstructorArgs& aArgs) override;
bool
DeallocPClientHandleOpParent(PClientHandleOpParent* aActor) override;
mozilla::ipc::IPCResult
RecvPClientHandleOpConstructor(PClientHandleOpParent* aActor,
const ClientOpConstructorArgs& aArgs) override;
public:
ClientHandleParent();
~ClientHandleParent();
void
Init(const IPCClientInfo& aClientInfo);
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientHandleParent_h

View File

@ -2,8 +2,10 @@
* 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 protocol PClientSource;
include DOMTypes;
include PBackgroundSharedTypes;
include IPCServiceWorkerDescriptor;
include ProtocolTypes;
using class mozilla::TimeStamp from "mozilla/TimeStamp.h";
using ClientType from "mozilla/dom/ClientIPCUtils.h";
@ -13,6 +15,10 @@ using VisibilityState from "mozilla/dom/ClientIPCUtils.h";
namespace mozilla {
namespace dom {
struct ClientSourceConstructorArgs
{
};
struct IPCClientInfo
{
nsID id;
@ -40,5 +46,22 @@ union IPCClientState
IPCClientWorkerState;
};
struct ClientOpenWindowArgs
{
};
struct ClientOpConstructorArgs
{
};
struct ClientNavigateOpConstructorArgs
{
};
union ClientOpResult
{
nsresult;
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,41 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientManagerChild.h"
#include "ClientManagerParent.h"
namespace mozilla {
namespace dom {
PClientManagerChild*
AllocClientManagerChild()
{
MOZ_ASSERT_UNREACHABLE("Default ClientManagerChild allocator should not be invoked");
return nullptr;
}
bool
DeallocClientManagerChild(PClientManagerChild* aActor)
{
delete aActor;
return true;
}
PClientManagerParent*
AllocClientManagerParent()
{
return new ClientManagerParent();
}
bool
DeallocClientManagerParent(PClientManagerParent* aActor)
{
delete aActor;
return true;
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,31 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientManagerActors_h
#define _mozilla_dom_ClientManagerActors_h
namespace mozilla {
namespace dom {
class PClientManagerChild;
class PClientManagerParent;
PClientManagerChild*
AllocClientManagerChild();
bool
DeallocClientManagerChild(PClientManagerChild* aActor);
PClientManagerParent*
AllocClientManagerParent();
bool
DeallocClientManagerParent(PClientManagerParent* aActor);
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientManagerActors_h

View File

@ -0,0 +1,154 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientManagerChild.h"
#include "ClientHandleChild.h"
#include "ClientManagerOpChild.h"
#include "ClientNavigateOpChild.h"
#include "ClientSourceChild.h"
namespace mozilla {
namespace dom {
using mozilla::dom::workers::WorkerHolderToken;
using mozilla::dom::workers::WorkerPrivate;
void
ClientManagerChild::ActorDestroy(ActorDestroyReason aReason)
{
if (mWorkerHolderToken) {
mWorkerHolderToken->RemoveListener(this);
mWorkerHolderToken = nullptr;
}
if (mManager) {
mManager->RevokeActor(this);
// Revoking the actor link should automatically cause the owner
// to call RevokeOwner() as well.
MOZ_DIAGNOSTIC_ASSERT(!mManager);
}
}
PClientHandleChild*
ClientManagerChild::AllocPClientHandleChild(const IPCClientInfo& aClientInfo)
{
return new ClientHandleChild();
}
bool
ClientManagerChild::DeallocPClientHandleChild(PClientHandleChild* aActor)
{
delete aActor;
return true;
}
PClientManagerOpChild*
ClientManagerChild::AllocPClientManagerOpChild(const ClientOpConstructorArgs& aArgs)
{
MOZ_ASSERT_UNREACHABLE("ClientManagerOpChild must be explicitly constructed.");
return nullptr;
}
bool
ClientManagerChild::DeallocPClientManagerOpChild(PClientManagerOpChild* aActor)
{
delete aActor;
return true;
}
PClientNavigateOpChild*
ClientManagerChild::AllocPClientNavigateOpChild(const ClientNavigateOpConstructorArgs& aArgs)
{
return new ClientNavigateOpChild();
}
bool
ClientManagerChild::DeallocPClientNavigateOpChild(PClientNavigateOpChild* aActor)
{
delete aActor;
return true;
}
mozilla::ipc::IPCResult
ClientManagerChild::RecvPClientNavigateOpConstructor(PClientNavigateOpChild* aActor,
const ClientNavigateOpConstructorArgs& aArgs)
{
auto actor = static_cast<ClientNavigateOpChild*>(aActor);
actor->Init(aArgs);
return IPC_OK();
}
PClientSourceChild*
ClientManagerChild::AllocPClientSourceChild(const ClientSourceConstructorArgs& aArgs)
{
return new ClientSourceChild(aArgs);
}
bool
ClientManagerChild::DeallocPClientSourceChild(PClientSourceChild* aActor)
{
delete aActor;
return true;
}
void
ClientManagerChild::WorkerShuttingDown()
{
MaybeStartTeardown();
}
ClientManagerChild::ClientManagerChild(WorkerHolderToken* aWorkerHolderToken)
: mManager(nullptr)
, mWorkerHolderToken(aWorkerHolderToken)
, mTeardownStarted(false)
{
MOZ_ASSERT_IF(!NS_IsMainThread(), mWorkerHolderToken);
if (mWorkerHolderToken) {
mWorkerHolderToken->AddListener(this);
}
}
void
ClientManagerChild::SetOwner(ClientThing<ClientManagerChild>* aThing)
{
MOZ_DIAGNOSTIC_ASSERT(aThing);
MOZ_DIAGNOSTIC_ASSERT(!mManager);
mManager = aThing;
}
void
ClientManagerChild::RevokeOwner(ClientThing<ClientManagerChild>* aThing)
{
MOZ_DIAGNOSTIC_ASSERT(mManager);
MOZ_DIAGNOSTIC_ASSERT(mManager == aThing);
mManager = nullptr;
}
void
ClientManagerChild::MaybeStartTeardown()
{
if (mTeardownStarted) {
return;
}
mTeardownStarted = true;
SendTeardown();
}
WorkerPrivate*
ClientManagerChild::GetWorkerPrivate() const
{
if (!mWorkerHolderToken) {
return nullptr;
}
return mWorkerHolderToken->GetWorkerPrivate();
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,83 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientManagerChild_h
#define _mozilla_dom_ClientManagerChild_h
#include "ClientThing.h"
#include "mozilla/dom/PClientManagerChild.h"
#include "mozilla/dom/workers/bindings/WorkerHolderToken.h"
namespace mozilla {
namespace dom {
namespace workers {
class WorkerPrivate;
} // workers namespace
class ClientManagerChild final : public PClientManagerChild
, public mozilla::dom::workers::WorkerHolderToken::Listener
{
ClientThing<ClientManagerChild>* mManager;
RefPtr<mozilla::dom::workers::WorkerHolderToken> mWorkerHolderToken;
bool mTeardownStarted;
// PClientManagerChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
PClientHandleChild*
AllocPClientHandleChild(const IPCClientInfo& aClientInfo) override;
bool
DeallocPClientHandleChild(PClientHandleChild* aActor) override;
PClientManagerOpChild*
AllocPClientManagerOpChild(const ClientOpConstructorArgs& aArgs) override;
bool
DeallocPClientManagerOpChild(PClientManagerOpChild* aActor) override;
PClientNavigateOpChild*
AllocPClientNavigateOpChild(const ClientNavigateOpConstructorArgs& aArgs) override;
bool
DeallocPClientNavigateOpChild(PClientNavigateOpChild* aActor) override;
mozilla::ipc::IPCResult
RecvPClientNavigateOpConstructor(PClientNavigateOpChild* aActor,
const ClientNavigateOpConstructorArgs& aArgs) override;
PClientSourceChild*
AllocPClientSourceChild(const ClientSourceConstructorArgs& aArgs) override;
bool
DeallocPClientSourceChild(PClientSourceChild* aActor) override;
// WorkerHolderToken::Listener interface
void
WorkerShuttingDown() override;
public:
explicit ClientManagerChild(workers::WorkerHolderToken* aWorkerHolderToken);
void
SetOwner(ClientThing<ClientManagerChild>* aThing);
void
RevokeOwner(ClientThing<ClientManagerChild>* aThing);
void
MaybeStartTeardown();
mozilla::dom::workers::WorkerPrivate*
GetWorkerPrivate() const;
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientManagerChild_h

View File

@ -0,0 +1,48 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientManagerOpChild.h"
namespace mozilla {
namespace dom {
void
ClientManagerOpChild::ActorDestroy(ActorDestroyReason aReason)
{
if (mPromise) {
mPromise->Reject(NS_ERROR_ABORT, __func__);
mPromise = nullptr;
}
}
IPCResult
ClientManagerOpChild::Recv__delete__(const ClientOpResult& aResult)
{
if (aResult.type() == ClientOpResult::Tnsresult &&
NS_FAILED(aResult.get_nsresult())) {
mPromise->Reject(aResult.get_nsresult(), __func__);
mPromise = nullptr;
return IPC_OK();
}
mPromise->Resolve(aResult, __func__);
mPromise = nullptr;
return IPC_OK();
}
ClientManagerOpChild::ClientManagerOpChild(const ClientOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise)
: mPromise(aPromise)
{
MOZ_DIAGNOSTIC_ASSERT(mPromise);
}
ClientManagerOpChild::~ClientManagerOpChild()
{
MOZ_DIAGNOSTIC_ASSERT(!mPromise);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,37 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientManagerOpChild_h
#define _mozilla_dom_ClientManagerOpChild_h
#include "mozilla/dom/ClientOpPromise.h"
#include "mozilla/dom/PClientManagerOpChild.h"
#include "mozilla/MozPromise.h"
namespace mozilla {
namespace dom {
class ClientManagerOpChild final : public PClientManagerOpChild
{
RefPtr<ClientOpPromise::Private> mPromise;
// PClientManagerOpChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
mozilla::ipc::IPCResult
Recv__delete__(const ClientOpResult& aResult) override;
public:
ClientManagerOpChild(const ClientOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise);
~ClientManagerOpChild();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientManagerOpChild_h

View File

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientManagerOpParent.h"
namespace mozilla {
namespace dom {
void
ClientManagerOpParent::ActorDestroy(ActorDestroyReason aReason)
{
}
void
ClientManagerOpParent::Init(const ClientOpConstructorArgs& aArgs)
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,33 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientManagerOpParent_h
#define _mozilla_dom_ClientManagerOpParent_h
#include "mozilla/dom/PClientManagerOpParent.h"
namespace mozilla {
namespace dom {
class ClientManagerService;
class ClientManagerOpParent final : public PClientManagerOpParent
{
// PClientManagerOpParent interface
void
ActorDestroy(ActorDestroyReason aReason) override;
public:
ClientManagerOpParent() = default;
~ClientManagerOpParent() = default;
void
Init(const ClientOpConstructorArgs& aArgs);
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientManagerOpParent_h

View File

@ -0,0 +1,112 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientManagerParent.h"
#include "ClientHandleParent.h"
#include "ClientManagerOpParent.h"
#include "ClientSourceParent.h"
#include "mozilla/dom/PClientNavigateOpParent.h"
#include "mozilla/Unused.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
IPCResult
ClientManagerParent::RecvTeardown()
{
Unused << Send__delete__(this);
return IPC_OK();
}
void
ClientManagerParent::ActorDestroy(ActorDestroyReason aReason)
{
}
PClientHandleParent*
ClientManagerParent::AllocPClientHandleParent(const IPCClientInfo& aClientInfo)
{
return new ClientHandleParent();
}
bool
ClientManagerParent::DeallocPClientHandleParent(PClientHandleParent* aActor)
{
delete aActor;
return true;
}
IPCResult
ClientManagerParent::RecvPClientHandleConstructor(PClientHandleParent* aActor,
const IPCClientInfo& aClientInfo)
{
ClientHandleParent* actor = static_cast<ClientHandleParent*>(aActor);
actor->Init(aClientInfo);
return IPC_OK();
}
PClientManagerOpParent*
ClientManagerParent::AllocPClientManagerOpParent(const ClientOpConstructorArgs& aArgs)
{
return new ClientManagerOpParent();
}
bool
ClientManagerParent::DeallocPClientManagerOpParent(PClientManagerOpParent* aActor)
{
delete aActor;
return true;
}
IPCResult
ClientManagerParent::RecvPClientManagerOpConstructor(PClientManagerOpParent* aActor,
const ClientOpConstructorArgs& aArgs)
{
ClientManagerOpParent* actor = static_cast<ClientManagerOpParent*>(aActor);
actor->Init(aArgs);
return IPC_OK();
}
PClientNavigateOpParent*
ClientManagerParent::AllocPClientNavigateOpParent(const ClientNavigateOpConstructorArgs& aArgs)
{
MOZ_ASSERT_UNREACHABLE("ClientNavigateOpParent should be explicitly constructed.");
return nullptr;
}
bool
ClientManagerParent::DeallocPClientNavigateOpParent(PClientNavigateOpParent* aActor)
{
delete aActor;
return true;
}
PClientSourceParent*
ClientManagerParent::AllocPClientSourceParent(const ClientSourceConstructorArgs& aArgs)
{
return new ClientSourceParent(aArgs);
}
bool
ClientManagerParent::DeallocPClientSourceParent(PClientSourceParent* aActor)
{
delete aActor;
return true;
}
ClientManagerParent::ClientManagerParent()
{
}
ClientManagerParent::~ClientManagerParent()
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,63 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientManagerParent_h
#define _mozilla_dom_ClientManagerParent_h
#include "mozilla/dom/PClientManagerParent.h"
namespace mozilla {
namespace dom {
class ClientManagerParent final : public PClientManagerParent
{
// PClientManagerParent interface
mozilla::ipc::IPCResult
RecvTeardown() override;
void
ActorDestroy(ActorDestroyReason aReason) override;
PClientHandleParent*
AllocPClientHandleParent(const IPCClientInfo& aClientInfo) override;
bool
DeallocPClientHandleParent(PClientHandleParent* aActor) override;
mozilla::ipc::IPCResult
RecvPClientHandleConstructor(PClientHandleParent* aActor,
const IPCClientInfo& aClientInfo) override;
PClientManagerOpParent*
AllocPClientManagerOpParent(const ClientOpConstructorArgs& aArgs) override;
bool
DeallocPClientManagerOpParent(PClientManagerOpParent* aActor) override;
mozilla::ipc::IPCResult
RecvPClientManagerOpConstructor(PClientManagerOpParent* aActor,
const ClientOpConstructorArgs& aArgs) override;
PClientNavigateOpParent*
AllocPClientNavigateOpParent(const ClientNavigateOpConstructorArgs& aArgs) override;
bool
DeallocPClientNavigateOpParent(PClientNavigateOpParent* aActor) override;
PClientSourceParent*
AllocPClientSourceParent(const ClientSourceConstructorArgs& aArgs) override;
bool
DeallocPClientSourceParent(PClientSourceParent* aActor) override;
public:
ClientManagerParent();
~ClientManagerParent();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientManagerParent_h

View File

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientNavigateOpChild.h"
namespace mozilla {
namespace dom {
void
ClientNavigateOpChild::ActorDestroy(ActorDestroyReason aReason)
{
}
void
ClientNavigateOpChild::Init(const ClientNavigateOpConstructorArgs& aArgs)
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,31 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientNavigateOpChild_h
#define _mozilla_dom_ClientNavigateOpChild_h
#include "mozilla/dom/PClientNavigateOpChild.h"
namespace mozilla {
namespace dom {
class ClientNavigateOpChild final : public PClientNavigateOpChild
{
// PClientNavigateOpChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
public:
ClientNavigateOpChild() = default;
~ClientNavigateOpChild() = default;
void
Init(const ClientNavigateOpConstructorArgs& aArgs);
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientNavigateOpChild_h

View File

@ -0,0 +1,46 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientNavigateOpParent.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
void
ClientNavigateOpParent::ActorDestroy(ActorDestroyReason aReason)
{
}
IPCResult
ClientNavigateOpParent::Recv__delete__(const ClientOpResult& aResult)
{
if (aResult.type() == ClientOpResult::Tnsresult &&
NS_FAILED(aResult.get_nsresult())) {
mPromise->Reject(aResult.get_nsresult(), __func__);
mPromise = nullptr;
return IPC_OK();
}
mPromise->Resolve(aResult, __func__);
mPromise = nullptr;
return IPC_OK();
}
ClientNavigateOpParent::ClientNavigateOpParent(const ClientNavigateOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise)
: mPromise(aPromise)
{
MOZ_DIAGNOSTIC_ASSERT(mPromise);
}
ClientNavigateOpParent::~ClientNavigateOpParent()
{
MOZ_DIAGNOSTIC_ASSERT(!mPromise);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,36 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientNavigateOpParent_h
#define _mozilla_dom_ClientNavigateOpParent_h
#include "mozilla/dom/ClientOpPromise.h"
#include "mozilla/dom/PClientNavigateOpParent.h"
namespace mozilla {
namespace dom {
class ClientNavigateOpParent final : public PClientNavigateOpParent
{
RefPtr<ClientOpPromise::Private> mPromise;
// PClientNavigateOpParent interface
void
ActorDestroy(ActorDestroyReason aReason) override;
mozilla::ipc::IPCResult
Recv__delete__(const ClientOpResult& aResult) override;
public:
ClientNavigateOpParent(const ClientNavigateOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise);
~ClientNavigateOpParent();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientNavigateOpParent_h

View File

@ -0,0 +1,24 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientOpPromise_h
#define _mozilla_dom_ClientOpPromise_h
#include "mozilla/MozPromise.h"
namespace mozilla {
namespace dom {
class ClientOpResult;
class ClientState;
typedef MozPromise<ClientOpResult, nsresult, false> ClientOpPromise;
typedef MozPromise<ClientState, nsresult, false> ClientStatePromise;
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientOpPromise_h

View File

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientOpenWindowOpActors.h"
#include "ClientOpenWindowOpChild.h"
#include "mozilla/dom/PClientOpenWindowOpParent.h"
namespace mozilla {
namespace dom {
PClientOpenWindowOpChild*
AllocClientOpenWindowOpChild()
{
return new ClientOpenWindowOpChild();
}
void
InitClientOpenWindowOpChild(PClientOpenWindowOpChild* aActor,
const ClientOpenWindowArgs& aArgs)
{
auto actor = static_cast<ClientOpenWindowOpChild*>(aActor);
actor->Init(aArgs);
}
bool
DeallocClientOpenWindowOpChild(PClientOpenWindowOpChild* aActor)
{
delete aActor;
return true;
}
PClientOpenWindowOpParent*
AllocClientOpenWindowOpParent(const ClientOpenWindowArgs& aArgs)
{
MOZ_CRASH("ClientOpenWindowOpParent must be explicitly allocated");
return nullptr;
}
bool
DeallocClientOpenWindowOpParent(PClientOpenWindowOpParent* aActor)
{
delete aActor;
return true;
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,36 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientOpenWindowOpActors_h
#define _mozilla_dom_ClientOpenWindowOpActors_h
namespace mozilla {
namespace dom {
class ClientOpenWindowArgs;
class PClientOpenWindowOpChild;
class PClientOpenWindowOpParent;
PClientOpenWindowOpChild*
AllocClientOpenWindowOpChild();
void
InitClientOpenWindowOpChild(PClientOpenWindowOpChild* aActor,
const ClientOpenWindowArgs& aArgs);
bool
DeallocClientOpenWindowOpChild(PClientOpenWindowOpChild* aActor);
PClientOpenWindowOpParent*
AllocClientOpenWindowOpParent(const ClientOpenWindowArgs& aArgs);
bool
DeallocClientOpenWindowOpParent(PClientOpenWindowOpParent* aActor);
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientOpenWindowOpActors_h

View File

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientOpenWindowOpChild.h"
namespace mozilla {
namespace dom {
void
ClientOpenWindowOpChild::ActorDestroy(ActorDestroyReason aReason)
{
}
void
ClientOpenWindowOpChild::Init(const ClientOpenWindowArgs& aArgs)
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,31 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientOpenWindowOpChild_h
#define _mozilla_dom_ClientOpenWindowOpChild_h
#include "mozilla/dom/PClientOpenWindowOpChild.h"
namespace mozilla {
namespace dom {
class ClientOpenWindowOpChild final : public PClientOpenWindowOpChild
{
// PClientOpenWindowOpChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
public:
ClientOpenWindowOpChild() = default;
~ClientOpenWindowOpChild() = default;
void
Init(const ClientOpenWindowArgs& aArgs);
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientOpenWindowOpChild_h

View File

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientOpenWindowOpParent.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
void
ClientOpenWindowOpParent::ActorDestroy(ActorDestroyReason aReason)
{
if (mPromise) {
mPromise->Reject(NS_ERROR_ABORT, __func__);
mPromise = nullptr;
}
}
IPCResult
ClientOpenWindowOpParent::Recv__delete__(const ClientOpResult& aResult)
{
if (aResult.type() == ClientOpResult::Tnsresult &&
NS_FAILED(aResult.get_nsresult())) {
mPromise->Reject(aResult.get_nsresult(), __func__);
mPromise = nullptr;
return IPC_OK();
}
mPromise->Resolve(aResult, __func__);
mPromise = nullptr;
return IPC_OK();
}
ClientOpenWindowOpParent::ClientOpenWindowOpParent(const ClientOpenWindowArgs& aArgs,
ClientOpPromise::Private* aPromise)
: mPromise(aPromise)
{
MOZ_DIAGNOSTIC_ASSERT(mPromise);
}
ClientOpenWindowOpParent::~ClientOpenWindowOpParent()
{
MOZ_DIAGNOSTIC_ASSERT(!mPromise);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,36 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientOpenWindowOpParent_h
#define _mozilla_dom_ClientOpenWindowOpParent_h
#include "mozilla/dom/ClientOpPromise.h"
#include "mozilla/dom/PClientOpenWindowOpParent.h"
namespace mozilla {
namespace dom {
class ClientOpenWindowOpParent final : public PClientOpenWindowOpParent
{
RefPtr<ClientOpPromise::Private> mPromise;
// PClientOpenWindowOpParent interface
void
ActorDestroy(ActorDestroyReason aReason) override;
mozilla::ipc::IPCResult
Recv__delete__(const ClientOpResult& aResult) override;
public:
ClientOpenWindowOpParent(const ClientOpenWindowArgs& aArgs,
ClientOpPromise::Private* aPromise);
~ClientOpenWindowOpParent();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientOpenWindowOpParent_h

View File

@ -0,0 +1,85 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientSourceChild.h"
#include "ClientSourceOpChild.h"
#include "mozilla/dom/ClientIPCTypes.h"
#include "mozilla/Unused.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
void
ClientSourceChild::ActorDestroy(ActorDestroyReason aReason)
{
if (mSource) {
mSource->RevokeActor(this);
// Revoking the actor link should automatically cause the owner
// to call RevokeOwner() as well.
MOZ_DIAGNOSTIC_ASSERT(!mSource);
}
}
PClientSourceOpChild*
ClientSourceChild::AllocPClientSourceOpChild(const ClientOpConstructorArgs& aArgs)
{
return new ClientSourceOpChild();
}
bool
ClientSourceChild::DeallocPClientSourceOpChild(PClientSourceOpChild* aActor)
{
delete aActor;
return true;
}
IPCResult
ClientSourceChild::RecvPClientSourceOpConstructor(PClientSourceOpChild* aActor,
const ClientOpConstructorArgs& aArgs)
{
auto actor = static_cast<ClientSourceOpChild*>(aActor);
actor->Init(aArgs);
return IPC_OK();
}
ClientSourceChild::ClientSourceChild(const ClientSourceConstructorArgs& aArgs)
: mSource(nullptr)
, mTeardownStarted(false)
{
}
void
ClientSourceChild::SetOwner(ClientThing<ClientSourceChild>* aThing)
{
MOZ_DIAGNOSTIC_ASSERT(aThing);
MOZ_DIAGNOSTIC_ASSERT(!mSource);
mSource = aThing;
}
void
ClientSourceChild::RevokeOwner(ClientThing<ClientSourceChild>* aThing)
{
MOZ_DIAGNOSTIC_ASSERT(mSource);
MOZ_DIAGNOSTIC_ASSERT(mSource == aThing);
mSource = nullptr;
}
void
ClientSourceChild::MaybeStartTeardown()
{
if (mTeardownStarted) {
return;
}
mTeardownStarted = true;
Unused << SendTeardown();
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientSourceChild_h
#define _mozilla_dom_ClientSourceChild_h
#include "mozilla/dom/PClientSourceChild.h"
namespace mozilla {
namespace dom {
class ClientSourceConstructorArgs;
template <typename ActorType> class ClientThing;
class ClientSourceChild final : public PClientSourceChild
{
ClientThing<ClientSourceChild>* mSource;
bool mTeardownStarted;
// PClientSourceChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
PClientSourceOpChild*
AllocPClientSourceOpChild(const ClientOpConstructorArgs& aArgs) override;
bool
DeallocPClientSourceOpChild(PClientSourceOpChild* aActor) override;
mozilla::ipc::IPCResult
RecvPClientSourceOpConstructor(PClientSourceOpChild* aActor,
const ClientOpConstructorArgs& aArgs) override;
public:
explicit ClientSourceChild(const ClientSourceConstructorArgs& aArgs);
void
SetOwner(ClientThing<ClientSourceChild>* aThing);
void
RevokeOwner(ClientThing<ClientSourceChild>* aThing);
void
MaybeStartTeardown();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientSourceChild_h

View File

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientSourceOpChild.h"
namespace mozilla {
namespace dom {
void
ClientSourceOpChild::ActorDestroy(ActorDestroyReason aReason)
{
}
void
ClientSourceOpChild::Init(const ClientOpConstructorArgs& aArgs)
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,32 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientSourceOpChild_h
#define _mozilla_dom_ClientSourceOpChild_h
#include "mozilla/dom/PClientSourceOpChild.h"
#include "ClientOpPromise.h"
namespace mozilla {
namespace dom {
class ClientSourceOpChild final : public PClientSourceOpChild
{
// PClientSourceOpChild interface
void
ActorDestroy(ActorDestroyReason aReason) override;
public:
ClientSourceOpChild() = default;
~ClientSourceOpChild() = default;
void
Init(const ClientOpConstructorArgs& aArgs);
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientSourceOpChild_h

View File

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientSourceOpParent.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
void
ClientSourceOpParent::ActorDestroy(ActorDestroyReason aReason)
{
if (mPromise) {
mPromise->Reject(NS_ERROR_ABORT, __func__);
mPromise = nullptr;
}
}
IPCResult
ClientSourceOpParent::Recv__delete__(const ClientOpResult& aResult)
{
if (aResult.type() == ClientOpResult::Tnsresult &&
NS_FAILED(aResult.get_nsresult())) {
mPromise->Reject(aResult.get_nsresult(), __func__);
mPromise = nullptr;
return IPC_OK();
}
mPromise->Resolve(aResult, __func__);
mPromise = nullptr;
return IPC_OK();
}
ClientSourceOpParent::ClientSourceOpParent(const ClientOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise)
: mPromise(aPromise)
{
MOZ_DIAGNOSTIC_ASSERT(mPromise);
}
ClientSourceOpParent::~ClientSourceOpParent()
{
MOZ_DIAGNOSTIC_ASSERT(!mPromise);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,36 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientSourceOpParent_h
#define _mozilla_dom_ClientSourceOpParent_h
#include "mozilla/dom/ClientOpPromise.h"
#include "mozilla/dom/PClientSourceOpParent.h"
namespace mozilla {
namespace dom {
class ClientSourceOpParent final : public PClientSourceOpParent
{
RefPtr<ClientOpPromise::Private> mPromise;
// PClientSourceOpParent interface
void
ActorDestroy(ActorDestroyReason aReason) override;
mozilla::ipc::IPCResult
Recv__delete__(const ClientOpResult& aResult) override;
public:
ClientSourceOpParent(const ClientOpConstructorArgs& aArgs,
ClientOpPromise::Private* aPromise);
~ClientSourceOpParent();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientSourceOpParent_h

View File

@ -0,0 +1,55 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "ClientSourceParent.h"
#include "ClientHandleParent.h"
#include "ClientSourceOpParent.h"
#include "mozilla/dom/ClientIPCTypes.h"
#include "mozilla/Unused.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::IPCResult;
using mozilla::ipc::PrincipalInfo;
IPCResult
ClientSourceParent::RecvTeardown()
{
Unused << Send__delete__(this);
return IPC_OK();
}
void
ClientSourceParent::ActorDestroy(ActorDestroyReason aReason)
{
}
PClientSourceOpParent*
ClientSourceParent::AllocPClientSourceOpParent(const ClientOpConstructorArgs& aArgs)
{
MOZ_ASSERT_UNREACHABLE("ClientSourceOpParent should be explicitly constructed.");
return nullptr;
}
bool
ClientSourceParent::DeallocPClientSourceOpParent(PClientSourceOpParent* aActor)
{
delete aActor;
return true;
}
ClientSourceParent::ClientSourceParent(const ClientSourceConstructorArgs& aArgs)
{
}
ClientSourceParent::~ClientSourceParent()
{
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,37 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientSourceParent_h
#define _mozilla_dom_ClientSourceParent_h
#include "mozilla/dom/PClientSourceParent.h"
namespace mozilla {
namespace dom {
class ClientSourceParent final : public PClientSourceParent
{
// PClientSourceParent
IPCResult
RecvTeardown() override;
void
ActorDestroy(ActorDestroyReason aReason) override;
PClientSourceOpParent*
AllocPClientSourceOpParent(const ClientOpConstructorArgs& aArgs) override;
bool
DeallocPClientSourceOpParent(PClientSourceOpParent* aActor) override;
public:
explicit ClientSourceParent(const ClientSourceConstructorArgs& aArgs);
~ClientSourceParent();
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientSourceParent_h

View File

@ -0,0 +1,108 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 _mozilla_dom_ClientThing_h
#define _mozilla_dom_ClientThing_h
#include "nsTArray.h"
namespace mozilla {
namespace dom {
// Base class representing various Client "things" such as ClientHandle,
// ClientSource, and ClientManager. Currently it provides a common set
// of code for handling activation and shutdown of IPC actors.
template <typename ActorType>
class ClientThing
{
ActorType* mActor;
bool mShutdown;
protected:
ClientThing()
: mActor(nullptr)
, mShutdown(false)
{
}
~ClientThing()
{
ShutdownThing();
}
// Return the current actor.
ActorType*
GetActor() const
{
return mActor;
}
// Returns true if ShutdownThing() has been called.
bool
IsShutdown() const
{
return mShutdown;
}
// Conditionally execute the given callable based on the current state.
template<typename Callable>
void
MaybeExecute(const Callable& aCallable)
{
if (mShutdown) {
return;
}
MOZ_DIAGNOSTIC_ASSERT(mActor);
aCallable(mActor);
}
// Attach activate the thing by attaching its underlying IPC actor. This
// will make the thing register as the actor's owner as well. The actor
// must call RevokeActor() to clear this weak back reference before its
// destroyed.
void
ActivateThing(ActorType* aActor)
{
MOZ_DIAGNOSTIC_ASSERT(aActor);
MOZ_DIAGNOSTIC_ASSERT(!mActor);
MOZ_DIAGNOSTIC_ASSERT(!mShutdown);
mActor = aActor;
mActor->SetOwner(this);
}
// Start destroying the underlying actor and disconnect the thing.
void
ShutdownThing()
{
if (mShutdown) {
return;
}
mShutdown = true;
// If we are shutdown before the actor, then clear the weak references
// between the actor and the thing.
if (mActor) {
mActor->RevokeOwner(this);
mActor->MaybeStartTeardown();
mActor = nullptr;
}
}
public:
// Clear the weak references between the thing and its IPC actor.
void
RevokeActor(ActorType* aActor)
{
MOZ_DIAGNOSTIC_ASSERT(mActor);
MOZ_DIAGNOSTIC_ASSERT(mActor == aActor);
mActor->RevokeOwner(this);
mActor = nullptr;
}
};
} // namespace dom
} // namespace mozilla
#endif // _mozilla_dom_ClientThing_h

View File

@ -0,0 +1,32 @@
/* 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 protocol PClientManager;
include protocol PClientHandleOp;
include protocol PIPCBlobInputStream;
include protocol PChildToParentStream;
include protocol PParentToChildStream;
include protocol PFileDescriptorSet;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
protocol PClientHandle
{
manager PClientManager;
manages PClientHandleOp;
parent:
async Teardown();
async PClientHandleOp(ClientOpConstructorArgs aArgs);
child:
async __delete__();
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,20 @@
/* 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 protocol PClientHandle;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
protocol PClientHandleOp
{
manager PClientHandle;
child:
async __delete__(ClientOpResult aResult);
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,42 @@
/* 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 protocol PBackground;
include protocol PClientHandle;
include protocol PClientManagerOp;
include protocol PClientNavigateOp;
include protocol PClientSource;
include protocol PIPCBlobInputStream;
include protocol PChildToParentStream;
include protocol PParentToChildStream;
include protocol PFileDescriptorSet;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
sync protocol PClientManager
{
manager PBackground;
manages PClientHandle;
manages PClientManagerOp;
manages PClientNavigateOp;
manages PClientSource;
parent:
async Teardown();
async PClientHandle(IPCClientInfo aClientInfo);
async PClientManagerOp(ClientOpConstructorArgs aArgs);
async PClientSource(ClientSourceConstructorArgs aArgs);
child:
async PClientNavigateOp(ClientNavigateOpConstructorArgs aArgs);
async __delete__();
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,20 @@
/* 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 protocol PClientManager;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
protocol PClientManagerOp
{
manager PClientManager;
child:
async __delete__(ClientOpResult aResult);
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,20 @@
/* 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 protocol PClientManager;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
protocol PClientNavigateOp
{
manager PClientManager;
parent:
async __delete__(ClientOpResult aResult);
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,20 @@
/* 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 protocol PContent;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
protocol PClientOpenWindowOp
{
manager PContent;
parent:
async __delete__(ClientOpResult aResult);
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,32 @@
/* 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 protocol PClientManager;
include protocol PClientSourceOp;
include protocol PIPCBlobInputStream;
include protocol PChildToParentStream;
include protocol PParentToChildStream;
include protocol PFileDescriptorSet;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
sync protocol PClientSource
{
manager PClientManager;
manages PClientSourceOp;
parent:
async Teardown();
child:
async PClientSourceOp(ClientOpConstructorArgs aArgs);
async __delete__();
};
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,20 @@
/* 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 protocol PClientSource;
include ClientIPCTypes;
namespace mozilla {
namespace dom {
protocol PClientSourceOp
{
manager PClientSource;
parent:
async __delete__(ClientOpResult aResult);
};
} // namespace dom
} // namespace mozilla

View File

@ -7,16 +7,46 @@
EXPORTS.mozilla.dom += [
'ClientInfo.h',
'ClientIPCUtils.h',
'ClientManagerActors.h',
'ClientOpenWindowOpActors.h',
'ClientOpPromise.h',
'ClientState.h',
'ClientThing.h',
]
UNIFIED_SOURCES += [
'ClientHandleChild.cpp',
'ClientHandleOpChild.cpp',
'ClientHandleOpParent.cpp',
'ClientHandleParent.cpp',
'ClientInfo.cpp',
'ClientManagerActors.cpp',
'ClientManagerChild.cpp',
'ClientManagerOpChild.cpp',
'ClientManagerOpParent.cpp',
'ClientManagerParent.cpp',
'ClientNavigateOpChild.cpp',
'ClientNavigateOpParent.cpp',
'ClientOpenWindowOpActors.cpp',
'ClientOpenWindowOpChild.cpp',
'ClientOpenWindowOpParent.cpp',
'ClientSourceChild.cpp',
'ClientSourceOpChild.cpp',
'ClientSourceOpParent.cpp',
'ClientSourceParent.cpp',
'ClientState.cpp',
]
IPDL_SOURCES += [
'ClientIPCTypes.ipdlh',
'PClientHandle.ipdl',
'PClientHandleOp.ipdl',
'PClientManager.ipdl',
'PClientManagerOp.ipdl',
'PClientNavigateOp.ipdl',
'PClientOpenWindowOp.ipdl',
'PClientSource.ipdl',
'PClientSourceOp.ipdl',
]
include('/ipc/chromium/chromium-config.mozbuild')

View File

@ -75,12 +75,14 @@ public:
void StartGamepadMonitoring()
{
AndroidGamepadManager::Init();
java::AndroidGamepadManager::Start();
java::AndroidGamepadManager::Start(
java::GeckoAppShell::GetApplicationContext());
}
void StopGamepadMonitoring()
{
java::AndroidGamepadManager::Stop();
java::AndroidGamepadManager::Stop(
java::GeckoAppShell::GetApplicationContext());
}
} // namespace dom

View File

@ -63,7 +63,6 @@ NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLEmbedElement,
nsIObjectLoadingContent,
imgINotificationObserver,
nsIImageLoadingContent,
imgIOnloadBlocker,
nsIChannelEventSink)
NS_IMPL_ELEMENT_CLONE(HTMLEmbedElement)

View File

@ -139,7 +139,6 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLImageElement,
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLImageElement,
nsGenericHTMLElement,
nsIImageLoadingContent,
imgIOnloadBlocker,
imgINotificationObserver)
NS_IMPL_ELEMENT_CLONE(HTMLImageElement)

View File

@ -10,7 +10,6 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsImageLoadingContent.h"
#include "imgRequestProxy.h"
#include "Units.h"
#include "nsCycleCollectionParticipant.h"

View File

@ -1253,7 +1253,6 @@ NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLInputElement,
nsITextControlElement,
imgINotificationObserver,
nsIImageLoadingContent,
imgIOnloadBlocker,
nsIDOMNSEditableElement,
nsIConstraintValidation)

View File

@ -104,7 +104,6 @@ NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLObjectElement,
nsIFrameLoaderOwner,
nsIObjectLoadingContent,
nsIImageLoadingContent,
imgIOnloadBlocker,
nsIChannelEventSink,
nsIConstraintValidation)

View File

@ -22,6 +22,7 @@
#include "mozilla/TelemetryIPC.h"
#include "mozilla/devtools/HeapSnapshotTempFileHelperChild.h"
#include "mozilla/docshell/OfflineCacheUpdateChild.h"
#include "mozilla/dom/ClientOpenWindowOpActors.h"
#include "mozilla/dom/ContentBridgeChild.h"
#include "mozilla/dom/ContentBridgeParent.h"
#include "mozilla/dom/VideoDecoderManagerChild.h"
@ -3580,6 +3581,26 @@ ContentChild::RecvSetPluginList(const uint32_t& aPluginEpoch,
return IPC_OK();
}
PClientOpenWindowOpChild*
ContentChild::AllocPClientOpenWindowOpChild(const ClientOpenWindowArgs& aArgs)
{
return AllocClientOpenWindowOpChild();
}
IPCResult
ContentChild::RecvPClientOpenWindowOpConstructor(PClientOpenWindowOpChild* aActor,
const ClientOpenWindowArgs& aArgs)
{
InitClientOpenWindowOpChild(aActor, aArgs);
return IPC_OK();
}
bool
ContentChild::DeallocPClientOpenWindowOpChild(PClientOpenWindowOpChild* aActor)
{
return DeallocClientOpenWindowOpChild(aActor);
}
mozilla::ipc::IPCResult
ContentChild::RecvShareCodeCoverageMutex(const CrossProcessMutexHandle& aHandle)
{

View File

@ -696,6 +696,16 @@ public:
nsTArray<PluginTag>&& aPluginTags,
nsTArray<FakePluginTag>&& aFakePluginTags) override;
virtual PClientOpenWindowOpChild*
AllocPClientOpenWindowOpChild(const ClientOpenWindowArgs& aArgs) override;
virtual mozilla::ipc::IPCResult
RecvPClientOpenWindowOpConstructor(PClientOpenWindowOpChild* aActor,
const ClientOpenWindowArgs& aArgs) override;
virtual bool
DeallocPClientOpenWindowOpChild(PClientOpenWindowOpChild* aActor) override;
#ifdef NIGHTLY_BUILD
// Fetch the current number of pending input events.
//

View File

@ -34,6 +34,7 @@
#include "mozilla/DataStorage.h"
#include "mozilla/devtools/HeapSnapshotTempFileHelperParent.h"
#include "mozilla/docshell/OfflineCacheUpdateParent.h"
#include "mozilla/dom/ClientOpenWindowOpActors.h"
#include "mozilla/dom/DataTransfer.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/File.h"
@ -2516,6 +2517,18 @@ ContentParent::OnCompositorDeviceReset()
Unused << SendReinitRenderingForDeviceReset();
}
PClientOpenWindowOpParent*
ContentParent::AllocPClientOpenWindowOpParent(const ClientOpenWindowArgs& aArgs)
{
return AllocClientOpenWindowOpParent(aArgs);
}
bool
ContentParent::DeallocPClientOpenWindowOpParent(PClientOpenWindowOpParent* aActor)
{
return DeallocClientOpenWindowOpParent(aActor);
}
void
ContentParent::MaybeEnableRemoteInputEventQueue()
{

View File

@ -636,6 +636,12 @@ public:
void OnCompositorDeviceReset() override;
virtual PClientOpenWindowOpParent*
AllocPClientOpenWindowOpParent(const ClientOpenWindowArgs& aArgs) override;
virtual bool
DeallocPClientOpenWindowOpParent(PClientOpenWindowOpParent* aActor) override;
// Control the priority of the IPC messages for input events.
void SetInputPriorityEventEnabled(bool aEnabled);
bool IsInputPriorityEventEnabled()

View File

@ -6,6 +6,7 @@
include protocol PBackground;
include protocol PBrowser;
include protocol PClientOpenWindowOp;
include protocol PCompositorManager;
include protocol PContentBridge;
include protocol PContentPermissionRequest;
@ -58,6 +59,7 @@ include PContentPermission;
include ServiceWorkerConfiguration;
include GraphicsMessages;
include MemoryReportTypes;
include ClientIPCTypes;
// Workaround to prevent error if PContentChild.cpp & PContentBridgeParent.cpp
// are put into different UnifiedProtocolsXX.cpp files.
@ -275,6 +277,7 @@ struct XPCOMInitData
nested(upto inside_cpow) sync protocol PContent
{
manages PBrowser;
manages PClientOpenWindowOp;
manages PContentPermissionRequest;
manages PCycleCollectWithLogs;
manages PPSMContentDownloader;
@ -674,6 +677,13 @@ child:
*/
async AddDynamicScalars(DynamicScalarDefinition[] definitions);
/*
* Message to construct a PClientOpenWindowOp actor. This is used to
* open windows cross-process and receive notification when the operation
* has completed.
*/
async PClientOpenWindowOp(ClientOpenWindowArgs aArgs);
parent:
async InitBackground(Endpoint<PBackgroundParent> aEndpoint);

View File

@ -175,13 +175,11 @@ StaticMutex sTabChildrenMutex;
TabChildBase::TabChildBase()
: mTabChildGlobal(nullptr)
{
mozilla::HoldJSObjects(this);
}
TabChildBase::~TabChildBase()
{
mAnonymousGlobalScopes.Clear();
mozilla::DropJSObjects(this);
}
NS_IMPL_CYCLE_COLLECTION_CLASS(TabChildBase)
@ -444,6 +442,8 @@ TabChild::TabChild(nsIContentChild* aManager,
, mPendingDocShellBlockers(0)
, mWidgetNativeData(0)
{
mozilla::HoldJSObjects(this);
nsWeakPtr weakPtrThis(do_GetWeakReference(static_cast<nsITabChild*>(this))); // for capture by the lambda
mSetAllowedTouchBehaviorCallback = [weakPtrThis](uint64_t aInputBlockId,
const nsTArray<TouchBehaviorFlags>& aFlags)
@ -702,6 +702,19 @@ TabChild::UpdateFrameType()
nsIDocShell::FRAME_TYPE_REGULAR);
}
NS_IMPL_CYCLE_COLLECTION_CLASS(TabChild)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(TabChild, TabChildBase)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWebNav)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(TabChild, TabChildBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWebNav)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(TabChild, TabChildBase)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TabChild)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome2)
@ -1147,6 +1160,8 @@ TabChild::~TabChild()
if (mHistoryListener) {
mHistoryListener->ClearTabChild();
}
mozilla::DropJSObjects(this);
}
mozilla::ipc::IPCResult

View File

@ -330,6 +330,8 @@ public:
NS_DECL_NSIOBSERVER
NS_DECL_NSITOOLTIPLISTENER
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(TabChild, TabChildBase)
FORWARD_SHMEM_ALLOCATOR_TO(PBrowserChild)
/**

View File

@ -75,7 +75,7 @@ class Manifest {
}
async initialise() {
this._store = new JSONFile({path: this._path});
this._store = new JSONFile({path: this._path, saveDelayMs: 100});
await this._store.load();
}

View File

@ -25,7 +25,6 @@ static mozilla::LazyLogModule sGetUserMediaLog("GetUserMedia");
#ifdef MOZ_WIDGET_ANDROID
#include "VideoEngine.h"
#include "AndroidJNIWrapper.h"
#include "AndroidBridge.h"
#endif
@ -282,13 +281,9 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
}
#ifdef MOZ_WIDGET_ANDROID
JavaVM* jvm = mozilla::jni::GetVM();
jobject context = mozilla::AndroidBridge::Bridge()->GetGlobalContextRef();
// get the JVM
JavaVM* jvm;
JNIEnv* const env = jni::GetEnvForThread();
MOZ_ALWAYS_TRUE(!env->GetJavaVM(&jvm));
if (webrtc::VoiceEngine::SetAndroidObjects(jvm, (void*)context) != 0) {
LOG(("VoiceEngine:SetAndroidObjects Failed"));
return;

View File

@ -44,8 +44,7 @@ nsSVGElement::StringInfo SVGFEImageElement::sStringInfo[3] =
NS_IMPL_ISUPPORTS_INHERITED(SVGFEImageElement, SVGFEImageElementBase,
nsIDOMNode, nsIDOMElement, nsIDOMSVGElement,
imgINotificationObserver, nsIImageLoadingContent,
imgIOnloadBlocker)
imgINotificationObserver, nsIImageLoadingContent)
//----------------------------------------------------------------------
// Implementation

View File

@ -51,7 +51,7 @@ NS_IMPL_ISUPPORTS_INHERITED(SVGImageElement, SVGImageElementBase,
nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
imgINotificationObserver,
nsIImageLoadingContent, imgIOnloadBlocker)
nsIImageLoadingContent)
//----------------------------------------------------------------------
// Implementation

View File

@ -355,13 +355,6 @@ partial interface Navigator {
sequence<MediaKeySystemConfiguration> supportedConfigurations);
};
#ifdef NIGHTLY_BUILD
partial interface Navigator {
[Func="Navigator::IsE10sEnabled"]
readonly attribute boolean mozE10sEnabled;
};
#endif
[NoInterfaceObject, Exposed=(Window,Worker)]
interface NavigatorConcurrentHardware {
readonly attribute unsigned long long hardwareConcurrency;

View File

@ -0,0 +1,110 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "WorkerHolderToken.h"
#include "WorkerPrivate.h"
BEGIN_WORKERS_NAMESPACE
// static
already_AddRefed<WorkerHolderToken>
WorkerHolderToken::Create(WorkerPrivate* aWorkerPrivate, Status aShutdownStatus,
Behavior aBehavior)
{
MOZ_DIAGNOSTIC_ASSERT(aWorkerPrivate);
aWorkerPrivate->AssertIsOnWorkerThread();
RefPtr<WorkerHolderToken> workerHolder =
new WorkerHolderToken(aShutdownStatus, aBehavior);
if (NS_WARN_IF(!workerHolder->HoldWorker(aWorkerPrivate, aShutdownStatus))) {
return nullptr;
}
return workerHolder.forget();
}
void
WorkerHolderToken::AddListener(Listener* aListener)
{
NS_ASSERT_OWNINGTHREAD(WorkerHolderToken);
MOZ_ASSERT(aListener);
MOZ_ASSERT(!mListenerList.Contains(aListener));
mListenerList.AppendElement(aListener);
// Allow an actor to be added after we've entered the Notifying case. We
// can't stop the actor creation from racing with out destruction of the
// other actors and we need to wait for this extra one to close as well.
// Signal it should destroy itself right away.
if (mShuttingDown) {
aListener->WorkerShuttingDown();
}
}
void
WorkerHolderToken::RemoveListener(Listener* aListener)
{
NS_ASSERT_OWNINGTHREAD(WorkerHolderToken);
MOZ_ASSERT(aListener);
DebugOnly<bool> removed = mListenerList.RemoveElement(aListener);
MOZ_ASSERT(removed);
MOZ_ASSERT(!mListenerList.Contains(aListener));
}
bool
WorkerHolderToken::IsShuttingDown() const
{
return mShuttingDown;
}
WorkerPrivate*
WorkerHolderToken::GetWorkerPrivate() const
{
NS_ASSERT_OWNINGTHREAD(WorkerHolderToken);
return mWorkerPrivate;
}
WorkerHolderToken::WorkerHolderToken(Status aShutdownStatus,
Behavior aBehavior)
: WorkerHolder(aBehavior)
, mShutdownStatus(aShutdownStatus)
, mShuttingDown(false)
{
}
WorkerHolderToken::~WorkerHolderToken()
{
NS_ASSERT_OWNINGTHREAD(WorkerHolderToken);
MOZ_ASSERT(mListenerList.IsEmpty());
}
bool
WorkerHolderToken::Notify(Status aStatus)
{
NS_ASSERT_OWNINGTHREAD(WorkerHolderToken);
// When the service worker thread is stopped we will get Terminating,
// but nothing higher than that. We must shut things down at Terminating.
if (aStatus < mShutdownStatus || mShuttingDown) {
return true;
}
mShuttingDown = true;
// Start the asynchronous destruction of our actors. These will call back
// into RemoveActor() once the actor is destroyed.
for (uint32_t i = 0; i < mListenerList.Length(); ++i) {
mListenerList[i]->WorkerShuttingDown();
}
return true;
}
END_WORKERS_NAMESPACE

View File

@ -0,0 +1,80 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 mozilla_dom_workers_WorkerHolderToken_h
#define mozilla_dom_workers_WorkerHolderToken_h
#include "nsISupportsImpl.h"
#include "nsTArray.h"
#include "WorkerHolder.h"
BEGIN_WORKERS_NAMESPACE
class WorkerPrivate;
// This is a ref-counted WorkerHolder implementation. If you wish
// to be notified of worker shutdown beginning, then you can implement
// the Listener interface and call AddListener().
//
// This is purely a convenience class to avoid requiring code to
// extend WorkerHolder all the time.
class WorkerHolderToken final : public WorkerHolder
{
public:
// Pure virtual class defining the interface for objects that
// wish to be notified of worker shutdown.
class Listener
{
public:
virtual void
WorkerShuttingDown() = 0;
};
// Attempt to create a WorkerHolderToken(). If the shutdown has already
// passed the given shutdown phase or fails for another reason then
// nullptr is returned.
static already_AddRefed<WorkerHolderToken>
Create(workers::WorkerPrivate* aWorkerPrivate, Status aShutdownStatus,
Behavior aBehavior = PreventIdleShutdownStart);
// Add a listener to the token. Note, this does not hold a strong
// reference to the listener. You must call RemoveListener() before
// the listener is destroyed. This can only be called on the owning
// worker thread.
void
AddListener(Listener* aListener);
// Remove a previously added listener. This can only be called on the
// owning worker thread.
void
RemoveListener(Listener* aListener);
bool
IsShuttingDown() const;
WorkerPrivate*
GetWorkerPrivate() const;
private:
WorkerHolderToken(Status aShutdownStatus, Behavior aBehavior);
~WorkerHolderToken();
// WorkerHolder methods
virtual bool
Notify(workers::Status aStatus) override;
nsTArray<Listener*> mListenerList;
const Status mShutdownStatus;
bool mShuttingDown;
public:
NS_INLINE_DECL_REFCOUNTING(WorkerHolderToken)
};
END_WORKERS_NAMESPACE
#endif // mozilla_dom_workers_WorkerHolderToken_h

View File

@ -42,6 +42,7 @@ EXPORTS.mozilla.dom.workers.bindings += [
'ServiceWorkerWindowClient.h',
'SharedWorker.h',
'WorkerHolder.h',
'WorkerHolderToken.h',
]
XPIDL_MODULE = 'dom_workers'
@ -85,6 +86,7 @@ UNIFIED_SOURCES += [
'SharedWorker.cpp',
'WorkerDebuggerManager.cpp',
'WorkerHolder.cpp',
'WorkerHolderToken.cpp',
'WorkerLocation.cpp',
'WorkerNavigator.cpp',
'WorkerPrivate.cpp',

View File

@ -10,6 +10,7 @@
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/SpawnTask.js"></script>
<script src="error_reporting_helpers.js"></script>
<script src="utils.js"></script>
</head>
<body>
<p id="display"></p>
@ -27,17 +28,16 @@ add_task(() => {
// test for bug 1408734
add_task(async () => {
let waitForControlled = new Promise((resolve) => {
navigator.serviceWorker.oncontrollerchange = resolve;
});
// register a service worker
let registration = await navigator.serviceWorker.register("fetch.js", {scope: "./"});
let worker = registration.installing || registration.active;
let sw = registration.installing || registration.active;
// wait for service worker be activated
await waitForState(sw, 'activated');
// wait for control changed
worker.postMessage('claim');
await waitForControlled;
sw.postMessage('claim');
await waitForControlled(window);
// get the ServiceWorkerRegistration we just register through GetRegistration
registration = await navigator.serviceWorker.getRegistration("./");

View File

@ -195,6 +195,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLEditor, TextEditor)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mStyleSheets)
tmp->HideAnonymousEditingUIs();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mLinkHandler)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLEditor, TextEditor)
@ -228,6 +230,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLEditor, TextEditor)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAddRowBeforeButton)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRemoveRowButton)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAddRowAfterButton)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLinkHandler)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(HTMLEditor, EditorBase)

View File

@ -28,7 +28,7 @@ VsyncBridgeParent::VsyncBridgeParent()
: mOpen(false)
{
MOZ_COUNT_CTOR(VsyncBridgeParent);
mCompositorThreadRef = new CompositorThreadHolderDebug("VsyncBridge");
mCompositorThreadRef = CompositorThreadHolder::GetSingleton();
}
VsyncBridgeParent::~VsyncBridgeParent()

View File

@ -38,7 +38,7 @@ private:
private:
bool mOpen;
RefPtr<layers::CompositorThreadHolderDebug> mCompositorThreadRef;
RefPtr<layers::CompositorThreadHolder> mCompositorThreadRef;
};
} // namespace gfx

Some files were not shown because too many files have changed in this diff Show More