Skip to content

Commit

Permalink
Merge mozilla-central to mozilla-inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
IrisHsiao committed Feb 22, 2017
2 parents 030e18d + 4b9cf39 commit c2bb6f5
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 95 deletions.
31 changes: 0 additions & 31 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ host_cxx_compiler = compiler('C++', host, c_compiler=host_c_compiler,
other_c_compiler=c_compiler)

# Generic compiler-based conditions.
building_with_msvc = depends(c_compiler)(lambda info: info.type == 'msvc')
non_msvc_compiler = depends(c_compiler)(lambda info: info.type != 'msvc')
building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')

Expand Down Expand Up @@ -968,36 +967,6 @@ set_define('HAVE_VISIBILITY_ATTRIBUTE',
set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
set_config('VISIBILITY_FLAGS', visibility_flags)

@depends(c_compiler, using_sccache)
def depend_cflags(c_compiler, using_sccache):
if c_compiler.type in ('gcc', 'clang'):
return '-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
elif c_compiler.type == 'msvc' and 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, when=building_with_msvc)
@imports(_from='re', _import='compile', _as='re_compile')
def msvc_showincludes_prefix(c_compiler):
pattern = re_compile(r'^([^:]*:.*[ :] )(.*\\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('\\stdio.h'):
m = pattern.match(line)
if m:
if not m.group(2):
die("Unable to parse cl -showIncludes prefix. " +
"This compiler's locale has an unsupported formatting.")
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)

@depends(target)
def is_windows(target):
return target.kernel == 'WINNT'
Expand Down
20 changes: 20 additions & 0 deletions build/mozconfig.cache
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,31 @@ else
exit 1
fi
mk_add_options "export SCCACHE_BUCKET=$bucket"
case "$master" in
*us[ew][12].mozilla.com*|*euc1.mozilla.com*)
mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
;;
esac
ac_add_options "--with-ccache=$topsrcdir/sccache2/sccache${suffix}"
export SCCACHE_VERBOSE_STATS=1
mk_add_options MOZ_PREFLIGHT_ALL+=build/sccache.mk
mk_add_options MOZ_POSTFLIGHT_ALL+=build/sccache.mk
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="
mk_add_options "export HOST_PDB_FLAG="
mk_add_options "export MOZ_DEBUG_FLAGS=-Z7"
;;
esac
fi

fi
6 changes: 4 additions & 2 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ 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)
Expand Down Expand Up @@ -625,3 +623,7 @@ endif
PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply

export CL_INCLUDES_PREFIX
# Make sure that the build system can handle non-ASCII characters
# in environment variables to prevent it from breking silently on
# non-English systems.
export NONASCII
12 changes: 0 additions & 12 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ ifndef GNU_CC
COMPILE_PDB_FLAG ?= -Fd$(basename $(@F)).pdb
COMPILE_CFLAGS += $(COMPILE_PDB_FLAG)
COMPILE_CXXFLAGS += $(COMPILE_PDB_FLAG)
ifdef MOZ_USING_SCCACHE
# We remove the PDB file before compilation so that sccache knows it's safe to cache.
RM_PDB_FILE = -$(RM) $(basename $(@F)).pdb
endif

LINK_PDBFILE ?= $(basename $(@F)).pdb
ifdef MOZ_DEBUG
Expand Down Expand Up @@ -854,28 +850,23 @@ $(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS)
# Rules for building native targets must come first because of the host_ prefix
$(HOST_COBJS):
$(REPORT_BUILD_VERBOSE)
$(RM_PDB_FILE)
$(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)

$(HOST_CPPOBJS):
$(REPORT_BUILD_VERBOSE)
$(call BUILDSTATUS,OBJECT_FILE $@)
$(RM_PDB_FILE)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)

$(HOST_CMOBJS):
$(REPORT_BUILD_VERBOSE)
$(RM_PDB_FILE)
$(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CFLAGS) $(HOST_CMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)

$(HOST_CMMOBJS):
$(REPORT_BUILD_VERBOSE)
$(RM_PDB_FILE)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)

$(COBJS):
$(REPORT_BUILD_VERBOSE)
$(RM_PDB_FILE)
$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)

# DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
Expand Down Expand Up @@ -1007,17 +998,14 @@ $(SOBJS):
$(CPPOBJS):
$(REPORT_BUILD_VERBOSE)
$(call BUILDSTATUS,OBJECT_FILE $@)
$(RM_PDB_FILE)
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)

$(CMMOBJS):
$(REPORT_BUILD_VERBOSE)
$(RM_PDB_FILE)
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)

$(CMOBJS):
$(REPORT_BUILD_VERBOSE)
$(RM_PDB_FILE)
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS)

$(filter %.s,$(CPPSRCS:%.cpp=%.s)): %.s: %.cpp $(call mkdir_deps,$(MDDEPDIR))
Expand Down
41 changes: 41 additions & 0 deletions js/src/old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,46 @@ AC_LANG_C

MOZ_EXPAND_LIBS

dnl ========================================================
dnl =
dnl = Build depencency options
dnl =
dnl ========================================================
MOZ_ARG_HEADER(Build dependencies)

if test "$GNU_CC" -a "$GNU_CXX"; then
_DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
else
dnl Don't override this for MSVC
if test -z "$_WIN32_MSVC"; then
_USE_CPP_INCLUDE_FLAG=
_DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
else
echo '#include <stdio.h>' > dummy-hello.c
changequote(,)
dnl This output is localized, split at the first double space or colon and space.
_CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*\\\stdio.h\)$"
CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'`
_CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'`
changequote([,])
if ! test -e "$_CL_STDIO_PATH"; then
AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.])
fi
if test -z "$CL_INCLUDES_PREFIX"; then
AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
fi
AC_SUBST(CL_INCLUDES_PREFIX)
rm -f dummy-hello.c

dnl Make sure that the build system can handle non-ASCII characters
dnl in environment variables to prevent it from breaking silently on
dnl non-English systems.
NONASCII=$'\241\241'
AC_SUBST(NONASCII)
fi
fi

dnl ========================================================
dnl = Link js shell to system readline
dnl ========================================================
Expand Down Expand Up @@ -2014,6 +2054,7 @@ HOST_CFLAGS=`echo \
HOST_CXXFLAGS=`echo \
$HOST_CXXFLAGS`

AC_SUBST(_DEPEND_CFLAGS)
AC_SUBST(MOZ_SYSTEM_NSPR)

OS_CFLAGS="$CFLAGS"
Expand Down
65 changes: 51 additions & 14 deletions mobile/android/chrome/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3434,6 +3434,10 @@ function Tab(aURL, aParams) {
this.id = 0;
this._parentId = -1;
this.lastTouchedAt = Date.now();
this._zoom = 1.0;
this._drawZoom = 1.0;
this._restoreZoom = false;
this.userScrollPos = { x: 0, y: 0 };
this.contentDocumentIsDisplayed = true;
this.pluginDoorhangerTimeout = null;
this.shouldShowPluginDoorhanger = true;
Expand Down Expand Up @@ -4509,37 +4513,66 @@ Tab.prototype = {
// notifications using nsBrowserStatusFilter.
},

OnHistoryNewEntry: function(newURI, oldIndex) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
_getGeckoZoom: function() {
let res = {};
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
cwu.getResolution(res);
let zoom = res.value * window.devicePixelRatio;
return zoom;
},

OnHistoryGoBack: function(backURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
saveSessionZoom: function(aZoom) {
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
cwu.setResolutionAndScaleTo(aZoom / window.devicePixelRatio);
},

restoredSessionZoom: function() {
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);

if (this._restoreZoom && cwu.isResolutionSet) {
return this._getGeckoZoom();
}
return null;
},

_updateZoomFromHistoryEvent: function(aHistoryEventName) {
// Restore zoom only when moving in session history, not for new page loads.
this._restoreZoom = aHistoryEventName !== "New";
},

OnHistoryNewEntry: function(aUri) {
this._updateZoomFromHistoryEvent("New");
},

OnHistoryGoBack: function(aUri) {
this._updateZoomFromHistoryEvent("Back");
return true;
},

OnHistoryGoForward: function(forwardURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
OnHistoryGoForward: function(aUri) {
this._updateZoomFromHistoryEvent("Forward");
return true;
},

OnHistoryReload: function(reloadURI, reloadFlags) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
OnHistoryReload: function(aUri, aFlags) {
// we don't do anything with this, so don't propagate it
// for now anyway
return true;
},

OnHistoryGotoIndex: function(index, gotoURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
OnHistoryGotoIndex: function(aIndex, aUri) {
this._updateZoomFromHistoryEvent("Goto");
return true;
},

OnHistoryPurge: function(numEntries) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
OnHistoryPurge: function(aNumEntries) {
this._updateZoomFromHistoryEvent("Purge");
return true;
},

OnHistoryReplaceEntry: function(index) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
OnHistoryReplaceEntry: function(aIndex) {
// we don't do anything with this, so don't propogate it
// for now anyway.
},

ShouldNotifyMediaPlaybackChange: function(inactive) {
Expand Down Expand Up @@ -4621,6 +4654,10 @@ Tab.prototype = {
return this.browser.contentWindow;
},

get scale() {
return this._zoom;
},

QueryInterface: XPCOMUtils.generateQI([
Ci.nsIWebProgressListener,
Ci.nsISHistoryListener,
Expand Down
35 changes: 4 additions & 31 deletions mobile/android/components/SessionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ SessionStore.prototype = {
observerService.addObserver(this, "quit-application", true);
observerService.addObserver(this, "Session:Restore", true);
observerService.addObserver(this, "Session:NotifyLocationChange", true);
observerService.addObserver(this, "Content:HistoryChange", true);
observerService.addObserver(this, "Tab:KeepZombified", true);
observerService.addObserver(this, "application-background", true);
observerService.addObserver(this, "application-foreground", true);
Expand Down Expand Up @@ -314,27 +313,6 @@ SessionStore.prototype = {
}
break;
}
case "Content:HistoryChange": {
let browser = aSubject;
let window = browser.ownerGlobal;
log("Content:HistoryChange for tab " + window.BrowserApp.getTabForBrowser(browser).id);
// We want to ignore history changes which we caused ourselves when
// restoring the history of a delay-loaded tab.
if (!browser.__SS_restore && !browser.__SS_restoreReloadPending) {
// The OnHistory... notifications are called *before* the history changes
// are persisted. We therefore need to make our onTabLoad call async,
// so it can actually capture the new session history state.
if (browser.__SS_historyChange) {
window.clearTimeout(browser.__SS_historyChange);
}
browser.__SS_historyChange =
window.setTimeout(() => {
delete browser.__SS_historyChange;
this.onTabLoad(window, browser);
}, 0);
}
break;
}
case "Tabs:OpenMultiple": {
let data = JSON.parse(aData);

Expand Down Expand Up @@ -641,11 +619,6 @@ SessionStore.prototype = {
aBrowser.removeEventListener("scroll", this, true);
aBrowser.removeEventListener("resize", this, true);

if (aBrowser.__SS_historyChange) {
aWindow.clearTimeout(aBrowser.__SS_historyChange);
delete aBrowser.__SS_historyChange;
}

delete aBrowser.__SS_data;

log("onTabRemove() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id +
Expand Down Expand Up @@ -1666,12 +1639,12 @@ SessionStore.prototype = {
tab.browser.__SS_extdata = tabData.extData;

if (window.BrowserApp.selectedTab == tab) {
// After we're done restoring, we can lift the general ban on tab data
// capturing, but we still need to protect the foreground tab until we're
this._restoreTab(tabData, tab.browser);

// We can now lift the general ban on tab data capturing,
// but we still need to protect the foreground tab until we're
// sure it's actually reloading after history restoring has finished.
tab.browser.__SS_restoreReloadPending = true;

this._restoreTab(tabData, tab.browser);
this._startupRestoreFinished = true;
log("startupRestoreFinished = true");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,7 @@
// Go back.
is(browser.canGoBack, true, "can go back");
browser.goBack();

let titleChange = promiseTabEvent(browser, "DOMTitleChanged");
let tabDataUpdate = promiseTabEvent(browser, "SSTabDataUpdated");
yield titleChange;
yield tabDataUpdate;
yield promiseTabEvent(browser, "SSTabDataUpdated");
is(browser.currentURI.spec, URL, "navigated back to form data page");

// Make sure form data is still present.
Expand Down
Loading

0 comments on commit c2bb6f5

Please sign in to comment.