merge b2g-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-09-08 12:59:09 +02:00
commit 73d872a4e5
24 changed files with 215 additions and 46 deletions

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="fe92ddd450e03b38edb2d465de7897971d68ac68">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="facdb3593e63dcbb740709303a5b2527113c50a0"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="fe92ddd450e03b38edb2d465de7897971d68ac68">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="fe92ddd450e03b38edb2d465de7897971d68ac68">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="facdb3593e63dcbb740709303a5b2527113c50a0"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "e7a7c126f48f4ea3bded1f2e9ee5e4f79ae1be9e",
"revision": "c1fd0c75afd4ccbc7f32465d50d3022eaa55e7b6",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="facdb3593e63dcbb740709303a5b2527113c50a0"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c7de02ef1e0ad97d86e5bbef2d19828a236aea27"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c71fd5d8c9c7cb021c97e5e9fbb29f92b50a084d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="6969df171e5295f855f12d12db0382048e6892e7"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -4074,8 +4074,8 @@ ArrayBufferBuilder::mapToFileInPackage(const nsCString& aFile,
return rv;
}
nsZipItem* zipItem = zip->GetItem(aFile.get());
if (NS_FAILED(rv)) {
return rv;
if (!zipItem) {
return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST;
}
// If file was added to the package as stored(uncompressed), map to the

View File

@ -633,10 +633,23 @@ this.DOMApplicationRegistry = {
yield this.loadCurrentRegistry();
try {
let systemManifestURL =
Services.prefs.getCharPref("b2g.system_manifest_url");
let systemAppFound =
this.webapps.some(v => v.manifestURL == systemManifestURL);
// We configured a system app but can't find it. That prevents us
// from starting so we clear our registry to start again from scratch.
if (!systemAppFound) {
runUpdate = true;
}
} catch(e) {} // getCharPref will throw on non-b2g platforms. That's ok.
if (runUpdate) {
// Run migration before uninstall of core apps happens.
Services.obs.notifyObservers(null, "webapps-before-update-merge", null);
Services.obs.notifyObservers(null, "webapps-before-update-merge", null);
#ifdef MOZ_WIDGET_GONK
yield this.installSystemApps();

View File

@ -871,13 +871,17 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType,
InitDirs();
#ifdef MOZ_WIDGET_GONK
nsresult rv;
nsString volMountPoint;
if (DeviceStorageTypeChecker::IsVolumeBased(aStorageType)) {
nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID);
NS_ENSURE_TRUE_VOID(vs);
nsresult rv;
nsCOMPtr<nsIVolume> vol;
rv = vs->GetVolumeByName(aStorageName, getter_AddRefs(vol));
if(NS_FAILED(rv)) {
printf_stderr("##### DeviceStorage: GetVolumeByName('%s') failed\n",
NS_LossyConvertUTF16toASCII(aStorageName).get());
}
NS_ENSURE_SUCCESS_VOID(rv);
vol->GetMountPoint(volMountPoint);
}
@ -886,7 +890,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType,
// Picture directory
if (aStorageType.EqualsLiteral(DEVICESTORAGE_PICTURES)) {
#ifdef MOZ_WIDGET_GONK
NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
if(NS_FAILED(rv)) {
printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n",
NS_LossyConvertUTF16toASCII(volMountPoint).get(),
NS_LossyConvertUTF16toASCII(aStorageType).get());
}
#else
f = sDirs->pictures;
#endif
@ -895,7 +904,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType,
// Video directory
else if (aStorageType.EqualsLiteral(DEVICESTORAGE_VIDEOS)) {
#ifdef MOZ_WIDGET_GONK
NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
if(NS_FAILED(rv)) {
printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n",
NS_LossyConvertUTF16toASCII(volMountPoint).get(),
NS_LossyConvertUTF16toASCII(aStorageType).get());
}
#else
f = sDirs->videos;
#endif
@ -904,7 +918,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType,
// Music directory
else if (aStorageType.EqualsLiteral(DEVICESTORAGE_MUSIC)) {
#ifdef MOZ_WIDGET_GONK
NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
if(NS_FAILED(rv)) {
printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n",
NS_LossyConvertUTF16toASCII(volMountPoint).get(),
NS_LossyConvertUTF16toASCII(aStorageType).get());
}
#else
f = sDirs->music;
#endif
@ -919,7 +938,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType,
// default SDCard
else if (aStorageType.EqualsLiteral(DEVICESTORAGE_SDCARD)) {
#ifdef MOZ_WIDGET_GONK
NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
rv = NS_NewLocalFile(volMountPoint, false, getter_AddRefs(f));
if(NS_FAILED(rv)) {
printf_stderr("##### DeviceStorage: NS_NewLocalFile failed StorageType: '%s' path '%s'\n",
NS_LossyConvertUTF16toASCII(volMountPoint).get(),
NS_LossyConvertUTF16toASCII(aStorageType).get());
}
#else
f = sDirs->sdcard;
#endif
@ -945,6 +969,12 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType,
if (f) {
f->Clone(aFile);
} else {
// This should never happen unless something is severely wrong. So
// scream a little.
printf_stderr("##### GetRootDirectoryForType('%s', '%s') failed #####",
NS_LossyConvertUTF16toASCII(aStorageType).get(),
NS_LossyConvertUTF16toASCII(aStorageName).get());
}
}

View File

@ -55,7 +55,7 @@ function SettingsLock(aSettingsManager) {
"Settings:Clear:OK", "Settings:Clear:KO",
"Settings:Set:OK", "Settings:Set:KO",
"Settings:Finalize:OK", "Settings:Finalize:KO"]);
this.sendMessage("Settings:CreateLock", {lockID: this._id, isInternalLock: false});
this.sendMessage("Settings:CreateLock", {lockID: this._id, isServiceLock: false});
Services.tm.currentThread.dispatch(this._closeHelper.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
}

View File

@ -601,7 +601,7 @@ let SettingsRequestManager = {
p.reject("Invalid operation: " + currentTask.operation);
}
p.then(function(ret) {
ret.task.defer.resolve(ret.results);
ret.task.defer.resolve("results" in ret ? ret.results : null);
}.bind(currentTask), function(ret) {
ret.task.defer.reject(ret.error);
});

View File

@ -96,9 +96,10 @@ namespace system {
#define SYS_USB_CONFIG "sys.usb.config"
#define PERSIST_SYS_USB_CONFIG "persist.sys.usb.config"
#define USB_FUNC_ADB "adb"
#define USB_FUNC_MTP "mtp"
#define USB_FUNC_UMS "mass_storage"
#define USB_FUNC_ADB "adb"
#define USB_FUNC_MTP "mtp"
#define USB_FUNC_RNDIS "rndis"
#define USB_FUNC_UMS "mass_storage"
class AutoMounter;
@ -420,17 +421,21 @@ private:
// mass_storage has been configured and we can start sharing once the user
// enables it.
STATE_UMS_CONFIGURED,
// USB Tethering is enabled
STATE_RNDIS_CONFIGURED,
};
const char *StateStr(STATE aState)
{
switch (aState) {
case STATE_IDLE: return "IDLE";
case STATE_MTP_CONFIGURING: return "MTP_CONFIGURING";
case STATE_MTP_CONNECTED: return "MTP_CONNECTED";
case STATE_MTP_STARTED: return "MTP_STARTED";
case STATE_UMS_CONFIGURING: return "UMS_CONFIGURING";
case STATE_UMS_CONFIGURED: return "UMS_CONFIGURED";
case STATE_IDLE: return "IDLE";
case STATE_MTP_CONFIGURING: return "MTP_CONFIGURING";
case STATE_MTP_CONNECTED: return "MTP_CONNECTED";
case STATE_MTP_STARTED: return "MTP_STARTED";
case STATE_UMS_CONFIGURING: return "UMS_CONFIGURING";
case STATE_UMS_CONFIGURED: return "UMS_CONFIGURED";
case STATE_RNDIS_CONFIGURED: return "RNDIS_CONFIGURED";
}
return "STATE_???";
}
@ -660,6 +665,7 @@ AutoMounter::UpdateState()
bool mtpAvail = false;
bool mtpConfigured = false;
bool mtpEnabled = false;
bool rndisConfigured = false;
bool usbCablePluggedIn = IsUsbCablePluggedIn();
if (access(ICS_SYS_USB_FUNCTIONS, F_OK) == 0) {
@ -690,6 +696,8 @@ AutoMounter::UpdateState()
mtpConfigured = false;
mtpEnabled = false;
}
rndisConfigured = strstr(functionsStr, USB_FUNC_RNDIS) != nullptr;
}
bool enabled = mtpEnabled || umsEnabled;
@ -704,9 +712,9 @@ AutoMounter::UpdateState()
}
}
DBG("UpdateState: ums:A%dC%dE%d mtp:A%dC%dE%d mode:%d usb:%d mState:%s",
DBG("UpdateState: ums:A%dC%dE%d mtp:A%dC%dE%d rndis:%d mode:%d usb:%d mState:%s",
umsAvail, umsConfigured, umsEnabled,
mtpAvail, mtpConfigured, mtpEnabled,
mtpAvail, mtpConfigured, mtpEnabled, rndisConfigured,
mMode, usbCablePluggedIn, StateStr(mState));
switch (mState) {
@ -717,6 +725,11 @@ AutoMounter::UpdateState()
// UEvent when the usb cable is plugged in.
break;
}
if (rndisConfigured) {
// USB Tethering uses RNDIS. We'll just wait until its turned off.
SetState(STATE_RNDIS_CONFIGURED);
break;
}
if (mtpEnabled) {
if (mtpConfigured) {
// The USB layer has already been configured. Now we can go ahead
@ -726,7 +739,7 @@ AutoMounter::UpdateState()
StartMtpServer();
SetState(STATE_MTP_STARTED);
} else {
// The MTP USB layer is configuring. Wait for it to finish
// We need to configure USB to use mtp. Wait for it to be configured
// before we start the MTP server.
SetUsbFunction(USB_FUNC_MTP);
SetState(STATE_MTP_CONFIGURING);
@ -752,6 +765,11 @@ AutoMounter::UpdateState()
// the MTP server.
StartMtpServer();
SetState(STATE_MTP_STARTED);
break;
}
if (rndisConfigured) {
SetState(STATE_RNDIS_CONFIGURED);
break;
}
break;
@ -764,6 +782,10 @@ AutoMounter::UpdateState()
"mtpConfigured = %d mtpEnabled = %d usbCablePluggedIn: %d",
mtpConfigured, mtpEnabled, usbCablePluggedIn);
StopMtpServer();
if (rndisConfigured) {
SetState(STATE_RNDIS_CONFIGURED);
break;
}
if (umsAvail) {
// Switch back to UMS
SetUsbFunction(USB_FUNC_UMS);
@ -790,6 +812,10 @@ AutoMounter::UpdateState()
}
SetState(STATE_UMS_CONFIGURED);
}
if (rndisConfigured) {
SetState(STATE_RNDIS_CONFIGURED);
break;
}
break;
case STATE_UMS_CONFIGURED:
@ -805,6 +831,18 @@ AutoMounter::UpdateState()
break;
}
}
if (rndisConfigured) {
SetState(STATE_RNDIS_CONFIGURED);
break;
}
SetState(STATE_IDLE);
break;
case STATE_RNDIS_CONFIGURED:
if (usbCablePluggedIn && rndisConfigured) {
// Normal state when RNDIS is enabled.
break;
}
SetState(STATE_IDLE);
break;

View File

@ -35,6 +35,8 @@
#include "nsTArray.h" // for nsAutoTArray
#include "TextRenderer.h" // for TextRenderer
#include <vector>
#include "GeckoProfiler.h" // for GeckoProfiler
#include "ProfilerMarkers.h" // for ProfilerMarkers
#define CULLING_LOG(...)
// #define CULLING_LOG(...) printf_stderr("CULLING: " __VA_ARGS__)
@ -115,7 +117,9 @@ static void DrawLayerInfo(const RenderTargetIntRect& aClipRect,
static void PrintUniformityInfo(Layer* aLayer)
{
static TimeStamp t0 = TimeStamp::Now();
if (!profiler_is_active()) {
return;
}
// Don't want to print a log for smaller layers
if (aLayer->GetEffectiveVisibleRegion().GetBounds().width < 300 ||
@ -127,10 +131,10 @@ static void PrintUniformityInfo(Layer* aLayer)
if (!transform.Is2D()) {
return;
}
Point translation = transform.As2D().GetTranslation();
printf_stderr("UniformityInfo Layer_Move %llu %p %s\n",
(unsigned long long)(TimeStamp::Now() - t0).ToMilliseconds(), aLayer,
ToString(translation).c_str());
LayerTranslationPayload* payload = new LayerTranslationPayload(aLayer, translation);
PROFILER_MARKER_PAYLOAD("LayerTranslation", payload);
}
/* all of the per-layer prepared data we need to maintain */

View File

@ -548,7 +548,7 @@ void nsCaret::ResetBlinking()
{
mIsBlinkOn = true;
if (mReadOnly) {
if (mReadOnly || !mVisible) {
StopBlinking();
return;
}

View File

@ -8,6 +8,7 @@
#include "ProfilerMarkers.h"
#include "gfxASurface.h"
#include "SyncProfile.h"
#include "Layers.h"
ProfilerMarkerPayload::ProfilerMarkerPayload(ProfilerBacktrace* aStack)
: mStack(aStack)
@ -124,9 +125,46 @@ IOMarkerPayload::streamPayloadImp(JSStreamWriter& b)
b.EndObject();
}
void
ProfilerJSEventMarker(const char *event)
{
PROFILER_MARKER(event);
}
LayerTranslationPayload::LayerTranslationPayload(mozilla::layers::Layer* aLayer,
mozilla::gfx::Point aPoint)
: ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr)
, mLayer(aLayer)
, mPoint(aPoint)
{
}
void
LayerTranslationPayload::streamPayloadImpl(JSStreamWriter& b)
{
const size_t bufferSize = 32;
char buffer[bufferSize];
snprintf(buffer, bufferSize, "%p", mLayer);
b.BeginObject();
b.NameValue("layer", buffer);
b.NameValue("x", mPoint.x);
b.NameValue("y", mPoint.y);
b.NameValue("category", "LayerTranslation");
b.EndObject();
}
TouchDataPayload::TouchDataPayload(const mozilla::ScreenIntPoint& aPoint)
: ProfilerMarkerPayload(mozilla::TimeStamp::Now(), mozilla::TimeStamp::Now(), nullptr)
{
mPoint = aPoint;
}
void
TouchDataPayload::streamPayloadImpl(JSStreamWriter& b)
{
b.BeginObject();
b.NameValue("x", mPoint.x);
b.NameValue("y", mPoint.y);
b.EndObject();
}

View File

@ -9,6 +9,13 @@
#include "JSStreamWriter.h"
#include "mozilla/TimeStamp.h"
#include "nsAutoPtr.h"
#include "Units.h" // For ScreenIntPoint
namespace mozilla {
namespace layers {
class Layer;
} // layers
} // mozilla
/**
* This is an abstract object that can be implied to supply
@ -122,4 +129,43 @@ private:
char* mFilename;
};
/**
* Contains the translation applied to a 2d layer so we can
* track the layer position at each frame.
*/
class LayerTranslationPayload : public ProfilerMarkerPayload
{
public:
LayerTranslationPayload(mozilla::layers::Layer* aLayer,
mozilla::gfx::Point aPoint);
protected:
virtual void
streamPayload(JSStreamWriter& b) { return streamPayloadImpl(b); }
private:
void streamPayloadImpl(JSStreamWriter& b);
mozilla::layers::Layer* mLayer;
mozilla::gfx::Point mPoint;
};
/**
* Tracks when touch events are processed by gecko, not when
* the touch actually occured in gonk/android.
*/
class TouchDataPayload : public ProfilerMarkerPayload
{
public:
TouchDataPayload(const mozilla::ScreenIntPoint& aPoint);
virtual ~TouchDataPayload() {}
protected:
virtual void
streamPayload(JSStreamWriter& b) { return streamPayloadImpl(b); }
private:
void streamPayloadImpl(JSStreamWriter& b);
mozilla::ScreenIntPoint mPoint;
};
#endif // PROFILER_MARKERS_H

View File

@ -15,6 +15,7 @@ if CONFIG['MOZ_ENABLE_PROFILER_SPS']:
EXPORTS += [
'GeckoProfilerFunc.h',
'GeckoProfilerImpl.h',
'JSStreamWriter.h',
'ProfilerMarkers.h',
'PseudoStack.h',
'shared-libraries.h',

View File

@ -19,6 +19,7 @@
#include "GeckoProfiler.h"
#include "GeckoTouchDispatcher.h"
#include "InputData.h"
#include "ProfilerMarkers.h"
#include "base/basictypes.h"
#include "gfxPrefs.h"
#include "libui/Input.h"
@ -379,7 +380,7 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch)
WidgetTouchEvent event = aMultiTouch.ToWidgetTouchEvent(nullptr);
nsEventStatus status = nsWindow::DispatchInputEvent(event, &captured);
if (mEnabledUniformityInfo) {
if (mEnabledUniformityInfo && profiler_is_active()) {
const char* touchAction = "Invalid";
switch (aMultiTouch.mType) {
case MultiTouchInput::MULTITOUCH_START:
@ -394,11 +395,9 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch)
break;
}
const SingleTouchData& firstTouch = aMultiTouch.mTouches[0];
const ScreenIntPoint& touchPoint = firstTouch.mScreenPoint;
LOG("UniformityInfo %s %llu %d %d", touchAction, systemTime(SYSTEM_TIME_MONOTONIC),
touchPoint.x, touchPoint.y);
const ScreenIntPoint& touchPoint = aMultiTouch.mTouches[0].mScreenPoint;
TouchDataPayload* payload = new TouchDataPayload(touchPoint);
PROFILER_MARKER_PAYLOAD(touchAction, payload);
}
if (!captured && (aMultiTouch.mTouches.Length() == 1)) {