Merge mozilla-central to mozilla-inbound

This commit is contained in:
Ed Morley 2012-05-25 22:44:48 +01:00
commit 4ff9f1d562
27 changed files with 247 additions and 35 deletions

View File

@ -145,12 +145,12 @@ static int do_main(int argc, char* argv[])
Output("Couldn't read application.ini");
return 255;
}
int result = XRE_main(argc, argv, appData);
int result = XRE_main(argc, argv, appData, 0);
XRE_FreeAppData(appData);
return result;
}
return XRE_main(argc, argv, &sAppData);
return XRE_main(argc, argv, &sAppData, 0);
}
int main(int argc, char* argv[])

View File

@ -0,0 +1 @@
_CodeSignature/CodeResources

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>rules</key>
<dict>
<key>^Info.plist$</key>
<true/>
<key>^PkgInfo$</key>
<true/>
<key>^MacOS/</key>
<true/>
<key>^Resources/</key>
<true/>
<key>^MacOS/extensions/.*</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^MacOS/distribution/.*</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^MacOS/updates/.*</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^MacOS/active-update.xml$</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^MacOS/defaults/.*</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^MacOS/mozilla.cfg$</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^MacOS/removed-files$</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^MacOS/updates.xml$</key><dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
</dict>
</dict>
</plist>

View File

@ -149,12 +149,12 @@ static int do_main(int argc, char* argv[])
Output("Couldn't read application.ini");
return 255;
}
int result = XRE_main(argc, argv, appData);
int result = XRE_main(argc, argv, appData, 0);
XRE_FreeAppData(appData);
return result;
}
return XRE_main(argc, argv, &sAppData);
return XRE_main(argc, argv, &sAppData, 0);
}
int main(int argc, char* argv[])

View File

@ -24,6 +24,7 @@
@APPNAME@/Contents/Info.plist
@APPNAME@/Contents/PkgInfo
@APPNAME@/Contents/Resources/
@APPNAME@/Contents/_CodeSignature/CodeResources
#endif
[@AB_CD@]

View File

@ -10,7 +10,7 @@
// For some reason, Apple's GCC refuses to honor -fno-exceptions when
// compiling ObjC.
#if __EXCEPTIONS && !(__OBJC__ && __APPLE_CC__)
#if __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
# error "STL code can only be used with -fno-exceptions"
#endif

View File

@ -514,7 +514,7 @@ else
case "$target" in
*-mingw*)
# Work around the conftest.exe access problem on Windows
sleep 1
sleep 2
esac
AC_PROG_CXX
AC_PROG_RANLIB
@ -3203,11 +3203,11 @@ EOF
"$ac_cv_have_visibility_class_bug" = "no"; then
VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
WRAP_SYSTEM_INCLUDES=1
STL_FLAGS='-I$(DIST)/stl_wrappers'
WRAP_STL_INCLUDES=1
else
VISIBILITY_FLAGS='-fvisibility=hidden'
fi # have visibility pragma bug
STL_FLAGS='-I$(DIST)/stl_wrappers'
WRAP_STL_INCLUDES=1
fi # have visibility pragma
fi # have visibility(default) attribute
fi # have visibility(hidden) attribute

View File

@ -2877,11 +2877,11 @@ EOF
"$ac_cv_have_visibility_class_bug" = "no"; then
VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h'
WRAP_SYSTEM_INCLUDES=1
STL_FLAGS='-I$(DIST)/stl_wrappers'
WRAP_STL_INCLUDES=1
else
VISIBILITY_FLAGS='-fvisibility=hidden'
fi # have visibility pragma bug
STL_FLAGS='-I$(DIST)/stl_wrappers'
WRAP_STL_INCLUDES=1
fi # have visibility pragma
fi # have visibility(default) attribute
fi # have visibility(hidden) attribute

View File

@ -152,12 +152,12 @@ static int do_main(int argc, char* argv[])
Output("Couldn't read application.ini");
return 255;
}
int result = XRE_main(argc, argv, appData);
int result = XRE_main(argc, argv, appData, 0);
XRE_FreeAppData(appData);
return result;
}
return XRE_main(argc, argv, &sAppData);
return XRE_main(argc, argv, &sAppData, 0);
}
#if MOZ_PLATFORM_MAEMO == 6

View File

@ -65,7 +65,6 @@ ifeq (Android,$(OS_TARGET))
EXTRA_DSO_LDOPTS += -Wl,--wrap=pthread_atfork
CPPSRCS += BionicGlue.cpp
SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,android,$(DEPTH)/other-licenses/android)
STL_FLAGS =
endif
ifeq (android, $(MOZ_WIDGET_TOOLKIT))

View File

@ -336,7 +336,6 @@ class MarionetteTestRunner(object):
if suite.countTestCases():
results = MarionetteTextTestRunner(verbosity=3).run(suite)
self.failed += len(results.failures) + len(results.errors)
self.todo = 0
if hasattr(results, 'skipped'):
self.todo += len(results.skipped) + len(results.expectedFailures)
self.passed += results.passed

View File

@ -346,6 +346,12 @@ HISTOGRAM(FX_THUMBNAILS_CAPTURE_TIME_MS, 1, 500, 15, EXPONENTIAL, "THUMBNAILS: T
HISTOGRAM(FX_THUMBNAILS_STORE_TIME_MS, 1, 500, 15, EXPONENTIAL, "THUMBNAILS: Time (ms) it takes to store a thumbnail in the cache")
HISTOGRAM(FX_THUMBNAILS_HIT_OR_MISS, 0, 1, 2, BOOLEAN, "THUMBNAILS: Thumbnail found")
/*
* Widget telemetry.
*/
HISTOGRAM(EVENTLOOP_UI_LAG, 50, 30000, 200, LINEAR, "Widget: Time (ms) it takes for the message before a UI message")
/**
* Session restore telemetry
*/

View File

@ -6,7 +6,7 @@
void xxxNeverCalledXUL()
{
XRE_main(0, nsnull, nsnull);
XRE_main(0, nsnull, nsnull, nsnull);
XRE_GetFileFromPath(nsnull, nsnull);
XRE_LockProfileDirectory(nsnull, nsnull);
XRE_InitEmbedding2(nsnull, nsnull, nsnull);

View File

@ -74,6 +74,8 @@ endif
include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
include $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.mk
PACKAGE_BASE_DIR = $(_ABS_DIST)/l10n-stage
$(STAGEDIST): AB_CD:=en-US
$(STAGEDIST): UNPACKAGE=$(call ESCAPE_SPACE,$(ZIP_IN))
$(STAGEDIST): $(call ESCAPE_SPACE,$(ZIP_IN))

View File

@ -46,6 +46,7 @@ STAGEPATH = universal/
endif
endif
PACKAGE_BASE_DIR = $(_ABS_DIST)
PACKAGE = $(PKG_PATH)$(PKG_BASENAME)$(PKG_SUFFIX)
# By default, the SDK uses the same packaging type as the main bundle,
@ -553,8 +554,15 @@ MOZ_SIGN_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),
endif
ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD
ifeq (Darwin, $(OS_ARCH))
MAKE_PACKAGE = $(PREPARE_PACKAGE) \
&& cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) && cd $(PACKAGE_BASE_DIR) \
&& $(INNER_MAKE_PACKAGE)
else
MAKE_PACKAGE = $(PREPARE_PACKAGE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) \
$(MOZ_PKG_DIR) && $(INNER_MAKE_PACKAGE)
endif #Darwin
else
MAKE_PACKAGE = $(PREPARE_PACKAGE) && $(INNER_MAKE_PACKAGE)
endif
@ -762,6 +770,11 @@ endif
$(call PACKAGER_COPY, "$(call core_abspath,$(DIST))",\
"$(call core_abspath,$(DIST)/$(MOZ_PKG_DIR))", \
"$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1)
ifeq (DMG, $(MOZ_PKG_FORMAT))
ifeq (dmg, $(filter dmg, $(MOZ_INTERNAL_SIGNING_FORMAT)))
@cd $(DIST)/$(_APPNAME)/Contents && ln -sf _CodeSignature/CodeResources CodeResources
endif
endif
$(PERL) $(MOZILLA_DIR)/toolkit/mozapps/installer/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/components -v -x "$(XPIDL_LINK)"
$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/link-manifests.py \
$(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/components/components.manifest \

View File

@ -23,6 +23,7 @@ SIGN_EXCLUDES := \
endif # Windows
ifeq (Darwin, $(OS_ARCH))
MOZ_INTERNAL_SIGNING_FORMAT := dmg
MOZ_EXTERNAL_SIGNING_FORMAT := gpg
endif # Darwin

View File

@ -70,7 +70,7 @@ GeckoStart(void *data, const nsXREAppData *appData)
}
targs.AppendElement(static_cast<char *>(nsnull));
int result = XRE_main(targs.Length() - 1, targs.Elements(), appData);
int result = XRE_main(targs.Length() - 1, targs.Elements(), appData, 0);
if (result)
LOG("XRE_main returned %d", result);

View File

@ -3912,7 +3912,7 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
}
int
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData, PRUint32 aFlags)
{
XREMain main;
return main.XRE_main(argc, argv, aAppData);

View File

@ -746,3 +746,21 @@ XRE_InstallX11ErrorHandler()
InstallX11ErrorHandler();
}
#endif
#ifdef XP_WIN
static WindowsEnvironmentType
sWindowsEnvironmentType = WindowsEnvironmentType_Desktop;
void
SetWindowsEnvironment(WindowsEnvironmentType aEnvID)
{
sWindowsEnvironmentType = aEnvID;
}
WindowsEnvironmentType
XRE_GetWindowsEnvironment()
{
return sWindowsEnvironmentType;
}
#endif // XP_WIN

View File

@ -271,7 +271,7 @@ main(int argc, char **argv)
directory.forget(&webShellAppData->directory);
// There is only XUL.
result = XRE_main(argc, argv, webShellAppData);
result = XRE_main(argc, argv, webShellAppData, 0);
XRE_FreeAppData(webShellAppData);
}

View File

@ -302,7 +302,7 @@ namespace {
directory.forget(&webShellAppData->directory);
// There is only XUL.
XRE_main(*pargc, *pargv, webShellAppData);
XRE_main(*pargc, *pargv, webShellAppData, 0);
}
return true;

View File

@ -303,15 +303,21 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
do {
MSG msg;
bool uiMessage = PeekUIMessage(&msg);
// Give priority to keyboard and mouse messages.
if (PeekUIMessage(&msg) ||
::PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) {
if (uiMessage ||
PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) {
gotMessage = true;
if (msg.message == WM_QUIT) {
::PostQuitMessage(msg.wParam);
Exit();
} else {
mozilla::HangMonitor::NotifyActivity();
// If we had UI activity we would be processing it now so we know we
// have either kUIActivity or kActivityNoUIAVail.
mozilla::HangMonitor::NotifyActivity(
uiMessage ? mozilla::HangMonitor::kUIActivity :
mozilla::HangMonitor::kActivityNoUIAVail);
::TranslateMessage(&msg);
::DispatchMessageW(&msg);
}

View File

@ -124,6 +124,14 @@
*/
#define XRE_UPDATE_ROOT_DIR "UpdRootD"
/**
* Platform flag values for XRE_main.
*
* XRE_MAIN_FLAG_USE_METRO - On Windows, use the winrt backend. Defaults
* to win32 backend.
*/
#define XRE_MAIN_FLAG_USE_METRO 0x01
/**
* Begin an XUL application. Does not return until the user exits the
* application.
@ -134,14 +142,16 @@
*
* @param aAppData Information about the application to be run.
*
* @param aFlags Platform specific flags.
*
* @return A native result code suitable for returning from main().
*
* @note If the binary is linked against the standalone XPCOM glue,
* XPCOMGlueStartup() should be called before this method.
*
*/
XRE_API(int,
XRE_main, (int argc, char* argv[], const nsXREAppData* sAppData))
XRE_main, (int argc, char* argv[], const nsXREAppData* aAppData,
PRUint32 aFlags))
/**
* Given a path relative to the current working directory (or an absolute
@ -429,8 +439,25 @@ XRE_API(void,
XRE_API(void,
XRE_TelemetryAccumulate, (int aID, PRUint32 aSample))
XRE_API(void,
XRE_InitOmnijar, (nsILocalFile* greOmni,
nsILocalFile* appOmni))
#ifdef XP_WIN
/**
* Valid environment types for XRE_GetWindowsEnvironment.
*/
enum WindowsEnvironmentType {
WindowsEnvironmentType_Desktop = 0,
WindowsEnvironmentType_Metro = 1
};
/**
* Retrieve the Windows desktop environment libXUL is running
* under. Valid after a call to XRE_main.
*/
XRE_API(WindowsEnvironmentType,
XRE_GetWindowsEnvironment, ())
#endif // XP_WIN
#endif // _nsXULAppAPI_h__

View File

@ -50,7 +50,7 @@ bool gShutdown;
// The timestamp of the last event notification, or PR_INTERVAL_NO_WAIT if
// we're currently not processing events.
volatile PRIntervalTime gTimestamp;
volatile PRIntervalTime gTimestamp = PR_INTERVAL_NO_WAIT;
#ifdef REPORT_CHROME_HANGS
// Main thread ID used in reporting chrome hangs under Windows
@ -307,15 +307,70 @@ Shutdown()
gMonitor = NULL;
}
void
NotifyActivity()
static bool
IsUIMessageWaiting()
{
NS_ASSERTION(NS_IsMainThread(), "HangMonitor::Notify called from off the main thread.");
#ifndef XP_WIN
return false;
#else
#define NS_WM_IMEFIRST WM_IME_SETCONTEXT
#define NS_WM_IMELAST WM_IME_KEYUP
BOOL haveUIMessageWaiting = FALSE;
MSG msg;
haveUIMessageWaiting |= ::PeekMessageW(&msg, NULL, WM_KEYFIRST,
WM_IME_KEYLAST, PM_NOREMOVE);
haveUIMessageWaiting |= ::PeekMessageW(&msg, NULL, NS_WM_IMEFIRST,
NS_WM_IMELAST, PM_NOREMOVE);
haveUIMessageWaiting |= ::PeekMessageW(&msg, NULL, WM_MOUSEFIRST,
WM_MOUSELAST, PM_NOREMOVE);
return haveUIMessageWaiting;
#endif
}
void
NotifyActivity(ActivityType activityType)
{
NS_ASSERTION(NS_IsMainThread(),
"HangMonitor::Notify called from off the main thread.");
// Determine the activity type more specifically
if (activityType == kGeneralActivity) {
activityType = IsUIMessageWaiting() ? kActivityUIAVail :
kActivityNoUIAVail;
}
// Calculate the cumulative amount of lag time since the last UI message
static PRUint32 cumulativeUILagMS = 0;
switch(activityType) {
case kActivityNoUIAVail:
cumulativeUILagMS = 0;
break;
case kActivityUIAVail:
case kUIActivity:
if (gTimestamp != PR_INTERVAL_NO_WAIT) {
cumulativeUILagMS += PR_IntervalToMilliseconds(PR_IntervalNow() -
gTimestamp);
}
break;
}
// This is not a locked activity because PRTimeStamp is a 32-bit quantity
// which can be read/written atomically, and we don't want to pay locking
// penalties here.
gTimestamp = PR_IntervalNow();
// If we have UI activity we should reset the timer and report it if it is
// significant enough.
if (activityType == kUIActivity) {
// The minimum amount of lag time that we should report for telemetry data.
// Mozilla's UI responsiveness goal is 50ms
static const PRUint32 kUIResponsivenessThresholdMS = 50;
if (cumulativeUILagMS > kUIResponsivenessThresholdMS) {
mozilla::Telemetry::Accumulate(mozilla::Telemetry::EVENTLOOP_UI_LAG,
cumulativeUILagMS);
}
cumulativeUILagMS = 0;
}
}
void

View File

@ -8,6 +8,23 @@
namespace mozilla { namespace HangMonitor {
/**
* Signifies the type of activity in question
*/
enum ActivityType {
/* There is activity and it is known to be UI related activity. */
kUIActivity,
/* There is non UI activity and no UI activity is pending */
kActivityNoUIAVail,
/* There is non UI activity and UI activity is known to be pending */
kActivityUIAVail,
/* There is non UI activity and UI activity pending is unknown */
kGeneralActivity
};
/**
* Start monitoring hangs. Should be called by the XPCOM startup process only.
*/
@ -19,12 +36,14 @@ void Startup();
void Shutdown();
/**
* Notify the hang monitor of new activity which should reset its internal
* timer.
* Notify the hang monitor of activity which will reset its internal timer.
*
* @param activityType The type of activity being reported.
* @see ActivityType
*/
void NotifyActivity();
void NotifyActivity(ActivityType activityType = kGeneralActivity);
/**
/*
* Notify the hang monitor that the browser is now idle and no detection should
* be done.
*/

View File

@ -347,5 +347,5 @@ int main(int argc, char* argv[])
return 2;
}
return XRE_main(argc, argv, appData);
return XRE_main(argc, argv, appData, 0);
}

View File

@ -480,7 +480,7 @@ main(int argc, char **argv)
#endif
}
retval = XRE_main(argc, argv, appData);
retval = XRE_main(argc, argv, appData, 0);
}
NS_LogTerm();