This commit is contained in:
Phil Ringnalda 2015-09-11 22:04:40 -07:00
Родитель 1462347083 fa1f3135f2
Коммит 42095e9f99
46 изменённых файлов: 901 добавлений и 117 удалений

Просмотреть файл

@ -12,10 +12,10 @@
<!--original fetch url was https://git.mozilla.org/releases-->
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
<!-- B2G specific things. -->
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -12,10 +12,10 @@
<!--original fetch url was https://git.mozilla.org/releases-->
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
<!-- B2G specific things. -->
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -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="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>

Просмотреть файл

@ -12,10 +12,10 @@
<!--original fetch url was https://git.mozilla.org/releases-->
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
<!-- B2G specific things. -->
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -129,10 +129,10 @@
<!-- Emulator specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="72ffdf71c68a96309212eb13d63560d66db14c9e"/>
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="8d4018ebd33ac3f1a043b2d54bc578028656a659"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="96f78964a9a317a6c8b494ab71e10e0276d02490"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="b2d449276b015d8fe6cd9ea60c389c7e6975f841"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="f37bd545063039e30a92f2550ae78c0e6e4e2d08"/>
<project name="platform_external_wpa_supplicant_8" path="external/wpa_supplicant_8" remote="b2g" revision="0c6a6547cd1fd302fa2b0f6e375654df36bf0ec4"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="3453472769d6e9b43c84f98b56f8c63afe2b129e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="7132bc11fbc68acfebcd509095562ca04fad5584"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="5f4b68c799927b6e078f987b12722c3a6ccd4a45"/>
<project name="platform/development" path="development" revision="5968ff4e13e0d696ad8d972281fc27ae5a12829b"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="0951179277915335251c5e11d242e4e1a8c2236f"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -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="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>

Просмотреть файл

@ -12,10 +12,10 @@
<!--original fetch url was https://git.mozilla.org/releases-->
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
<!-- B2G specific things. -->
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "758c75ee087ea3722213ea2c185cca1d952c8a29",
"git_revision": "e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "df25432ca94953b1b9072fe01b705ebbf34478d1",
"revision": "c0f536773eca24b5eaf30ceffe3bb8d41c51827f",
"repo_path": "integration/gaia-central"
}

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="758c75ee087ea3722213ea2c185cca1d952c8a29"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e938ac2795efeeb2ecec8c47b33c9f7f8183e4eb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -117,7 +117,7 @@ skip-if = os == 'linux' # bug 1186322
[browser_perf-recording-selected-03.js]
skip-if = os == 'linux' # bug 1186322
[browser_perf-recording-selected-04.js]
skip-if = os == 'linux' # bug 1186322
skip-if = os == 'linux' || debug # bug 1186322 for Linux, bug 1203895 for leaks
[browser_perf-theme-toggle-01.js]
[browser_profiler_tree-abstract-01.js]
[browser_profiler_tree-abstract-02.js]

Просмотреть файл

@ -158,6 +158,7 @@ static const nsAttrValue::EnumTable kMozAudioChannelAttributeTable[] = {
{ "telephony", (int16_t)AudioChannel::Telephony },
{ "ringer", (int16_t)AudioChannel::Ringer },
{ "publicnotification", (int16_t)AudioChannel::Publicnotification },
{ "system", (int16_t)AudioChannel::System },
{ nullptr }
};

Просмотреть файл

@ -7892,9 +7892,9 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
// pixel an integer, and we want the adjusted value.
float fullZoom = context ? context->DeviceContext()->GetFullZoom() : 1.0;
fullZoom = (fullZoom == 0.0) ? 1.0 : fullZoom;
nsIWidget *widget = nsContentUtils::WidgetForDocument(this);
float widgetScale = widget ? widget->GetDefaultScale().scale : 1.0f;
CSSToLayoutDeviceScale layoutDeviceScale(widgetScale * fullZoom);
CSSToLayoutDeviceScale layoutDeviceScale(
(float)nsPresContext::AppUnitsPerCSSPixel() /
context->AppUnitsPerDevPixel());
CSSToScreenScale defaultScale = layoutDeviceScale
* LayoutDeviceToScreenScale(1.0);

Просмотреть файл

@ -333,7 +333,7 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
} else if (type.EqualsLiteral("x-bt/MAP-event-report")) {
HandleEventReport(pktHeaders);
} else if (type.EqualsLiteral("x-bt/messageStatus")) {
HandleMessageStatus(pktHeaders);
HandleSetMessageStatus(pktHeaders);
}
}
break;
@ -350,8 +350,8 @@ BluetoothMapSmsManager::MasDataHandler(UnixSocketBuffer* aMessage)
HandleSmsMmsFolderListing(pktHeaders);
} else if (type.EqualsLiteral("x-bt/MAP-msg-listing")) {
HandleSmsMmsMsgListing(pktHeaders);
} else if (type.EqualsLiteral("x-bt/message")) {
// TODO: Implement this feature in Bug 1166679
} else if (type.EqualsLiteral("x-bt/message")) {
HandleSmsMmsGetMessage(pktHeaders);
} else {
BT_LOGR("Unknown MAP request type: %s",
NS_ConvertUTF16toUTF8(type).get());
@ -785,6 +785,40 @@ BluetoothMapSmsManager::AppendBtNamedValueByTagId(
AppendNamedValue(aValues, "filterPriority", filterPriority);
break;
}
case Map::AppParametersTagId::Attachment: {
uint8_t attachment = *((uint8_t *)buf);
// convert big endian to little endian
attachment = (attachment >> 8) | (attachment << 8);
BT_LOGR("msg filter attachment: %d", attachment);
AppendNamedValue(aValues, "attachment", attachment);
break;
}
case Map::AppParametersTagId::Charset: {
uint8_t charset = *((uint8_t *)buf);
// convert big endian to little endian
charset = (charset >> 8) | (charset << 8);
BT_LOGR("msg filter charset: %d", charset);
AppendNamedValue(aValues, "charset", charset);
break;
}
case Map::AppParametersTagId::StatusIndicator: {
uint8_t statusIndicator = *((uint8_t *)buf);
// convert big endian to little endian
statusIndicator = (statusIndicator >> 8) | (statusIndicator << 8);
BT_LOGR("msg filter statusIndicator: %d", statusIndicator);
AppendNamedValue(aValues, "statusIndicator",
static_cast<uint32_t>(statusIndicator));
break;
}
case Map::AppParametersTagId::StatusValue: {
uint8_t statusValue = *((uint8_t *)buf);
// convert big endian to little endian
statusValue = (statusValue >> 8) | (statusValue << 8);
BT_LOGR("msg filter statusvalue: %d", statusValue);
AppendNamedValue(aValues, "statusValue",
static_cast<uint32_t>(statusValue));
break;
}
default:
BT_LOGR("Unsupported AppParameterTag: %x", aTagId);
break;
@ -823,6 +857,29 @@ BluetoothMapSmsManager::HandleSmsMmsMsgListing(const ObexHeaderSet& aHeader)
data);
}
void
BluetoothMapSmsManager::HandleSmsMmsGetMessage(const ObexHeaderSet& aHeader)
{
MOZ_ASSERT(NS_IsMainThread());
BluetoothService* bs = BluetoothService::Get();
NS_ENSURE_TRUE_VOID(bs);
InfallibleTArray<BluetoothNamedValue> data;
nsString name;
aHeader.GetName(name);
AppendNamedValue(data, "handle", name);
AppendBtNamedValueByTagId(aHeader, data,
Map::AppParametersTagId::Attachment);
AppendBtNamedValueByTagId(aHeader, data,
Map::AppParametersTagId::Charset);
bs->DistributeSignal(NS_LITERAL_STRING(MAP_GET_MESSAGE_REQ_ID),
NS_LITERAL_STRING(KEY_ADAPTER),
data);
}
void
BluetoothMapSmsManager::BuildDefaultFolderStructure()
{
@ -898,9 +955,29 @@ BluetoothMapSmsManager::HandleEventReport(const ObexHeaderSet& aHeader)
}
void
BluetoothMapSmsManager::HandleMessageStatus(const ObexHeaderSet& aHeader)
BluetoothMapSmsManager::HandleSetMessageStatus(const ObexHeaderSet& aHeader)
{
// TODO: Handle MessageStatus update in Bug 1186836
MOZ_ASSERT(NS_IsMainThread());
BluetoothService* bs = BluetoothService::Get();
NS_ENSURE_TRUE_VOID(bs);
InfallibleTArray<BluetoothNamedValue> data;
nsString name;
aHeader.GetName(name);
/* The Name header shall contain the handle of the message the status of which
* shall be modified. The handle shall be represented by a null-terminated
* Unicode text string with 16 hexadecimal digits.
*/
AppendNamedValue(data, "handle", name);
AppendBtNamedValueByTagId(aHeader, data,
Map::AppParametersTagId::StatusIndicator);
AppendBtNamedValueByTagId(aHeader, data,
Map::AppParametersTagId::StatusValue);
bs->DistributeSignal(NS_LITERAL_STRING(MAP_SET_MESSAGE_STATUS_REQ_ID),
NS_LITERAL_STRING(KEY_ADAPTER), data);
}
void

Просмотреть файл

@ -94,9 +94,10 @@ private:
void HandleNotificationRegistration(const ObexHeaderSet& aHeader);
void HandleEventReport(const ObexHeaderSet& aHeader);
void HandleMessageStatus(const ObexHeaderSet& aHeader);
void HandleSetMessageStatus(const ObexHeaderSet& aHeader);
void HandleSmsMmsFolderListing(const ObexHeaderSet& aHeader);
void HandleSmsMmsMsgListing(const ObexHeaderSet& aHeader);
void HandleSmsMmsGetMessage(const ObexHeaderSet& aHeader);
void AppendBtNamedValueByTagId(const ObexHeaderSet& aHeader,
InfallibleTArray<BluetoothNamedValue>& aValues,
const Map::AppParametersTagId aTagId);

Просмотреть файл

@ -191,6 +191,18 @@ extern bool gBluetoothDebugFlag;
*/
#define MAP_MESSAGES_LISTING_REQ_ID "mapmessageslistingreq"
/**
* When receiving a MAP request of 'get message' from a remote device,
* we'll dispatch an event.
*/
#define MAP_GET_MESSAGE_REQ_ID "mapgetmessagereq"
/**
* When receiving a MAP request of 'set message' from a remote device,
* we'll dispatch an event.
*/
#define MAP_SET_MESSAGE_STATUS_REQ_ID "mapsetmessagestatusreq"
/**
* When the value of a characteristic of a remote BLE device changes, we'll
* dispatch an event

Просмотреть файл

@ -150,7 +150,7 @@ static_assert(JS_STRUCTURED_CLONE_VERSION == 5,
"Need to update the major schema version.");
// Major schema version. Bump for almost everything.
const uint32_t kMajorSchemaVersion = 20;
const uint32_t kMajorSchemaVersion = 21;
// Minor schema version. Should almost always be 0 (maybe bump on release
// branches if we have to).
@ -3626,8 +3626,9 @@ UpgradeSchemaFrom18_0To19_0(mozIStorageConnection* aConnection)
MOZ_ASSERT(aConnection);
nsresult rv;
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom17_0To18_0",
js::ProfileEntry::Category::STORAGE);
PROFILER_LABEL("IndexedDB",
"UpgradeSchemaFrom18_0To19_0",
js::ProfileEntry::Category::STORAGE);
rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
"ALTER TABLE object_store_index "
@ -3734,7 +3735,7 @@ UpgradeSchemaFrom19_0To20_0(nsIFile* aFMDirectory,
MOZ_ASSERT(aConnection);
PROFILER_LABEL("IndexedDB",
"UpgradeSchemaFrom18_0To19_0",
"UpgradeSchemaFrom19_0To20_0",
js::ProfileEntry::Category::STORAGE);
#if defined(MOZ_B2G)
@ -3854,6 +3855,217 @@ UpgradeSchemaFrom19_0To20_0(nsIFile* aFMDirectory,
return NS_OK;
}
class UpgradeIndexDataValuesFunction final
: public mozIStorageFunction
{
public:
UpgradeIndexDataValuesFunction()
{
AssertIsOnIOThread();
}
NS_DECL_ISUPPORTS
private:
~UpgradeIndexDataValuesFunction()
{
AssertIsOnIOThread();
}
nsresult
ReadOldCompressedIDVFromBlob(const uint8_t* aBlobData,
uint32_t aBlobDataLength,
FallibleTArray<IndexDataValue>& aIndexValues);
NS_IMETHOD
OnFunctionCall(mozIStorageValueArray* aArguments,
nsIVariant** aResult) override;
};
NS_IMPL_ISUPPORTS(UpgradeIndexDataValuesFunction, mozIStorageFunction)
nsresult
UpgradeIndexDataValuesFunction::ReadOldCompressedIDVFromBlob(
const uint8_t* aBlobData,
uint32_t aBlobDataLength,
FallibleTArray<IndexDataValue>& aIndexValues)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(!IsOnBackgroundThread());
MOZ_ASSERT(aBlobData);
MOZ_ASSERT(aBlobDataLength);
MOZ_ASSERT(aIndexValues.IsEmpty());
const uint8_t* blobDataIter = aBlobData;
const uint8_t* blobDataEnd = aBlobData + aBlobDataLength;
int64_t indexId;
bool unique;
bool nextIndexIdAlreadyRead = false;
while (blobDataIter < blobDataEnd) {
if (!nextIndexIdAlreadyRead) {
ReadCompressedIndexId(&blobDataIter, blobDataEnd, &indexId, &unique);
}
nextIndexIdAlreadyRead = false;
if (NS_WARN_IF(blobDataIter == blobDataEnd)) {
IDB_REPORT_INTERNAL_ERR();
return NS_ERROR_FILE_CORRUPTED;
}
// Read key buffer length.
const uint64_t keyBufferLength =
ReadCompressedNumber(&blobDataIter, blobDataEnd);
if (NS_WARN_IF(blobDataIter == blobDataEnd) ||
NS_WARN_IF(keyBufferLength > uint64_t(UINT32_MAX)) ||
NS_WARN_IF(blobDataIter + keyBufferLength > blobDataEnd)) {
IDB_REPORT_INTERNAL_ERR();
return NS_ERROR_FILE_CORRUPTED;
}
nsCString keyBuffer(reinterpret_cast<const char*>(blobDataIter),
uint32_t(keyBufferLength));
blobDataIter += keyBufferLength;
IndexDataValue idv(indexId, unique, Key(keyBuffer));
if (blobDataIter < blobDataEnd) {
// Read either a sort key buffer length or an index id.
uint64_t maybeIndexId = ReadCompressedNumber(&blobDataIter, blobDataEnd);
// Locale-aware indexes haven't been around long enough to have any users,
// we can safely assume all sort key buffer lengths will be zero.
if (maybeIndexId != 0) {
if (maybeIndexId % 2) {
unique = true;
maybeIndexId--;
} else {
unique = false;
}
indexId = maybeIndexId/2;
nextIndexIdAlreadyRead = true;
}
}
if (NS_WARN_IF(!aIndexValues.InsertElementSorted(idv, fallible))) {
IDB_REPORT_INTERNAL_ERR();
return NS_ERROR_OUT_OF_MEMORY;
}
}
MOZ_ASSERT(blobDataIter == blobDataEnd);
return NS_OK;
}
NS_IMETHODIMP
UpgradeIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aArguments,
nsIVariant** aResult)
{
MOZ_ASSERT(aArguments);
MOZ_ASSERT(aResult);
PROFILER_LABEL("IndexedDB",
"UpgradeIndexDataValuesFunction::OnFunctionCall",
js::ProfileEntry::Category::STORAGE);
uint32_t argc;
nsresult rv = aArguments->GetNumEntries(&argc);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (argc != 1) {
NS_WARNING("Don't call me with the wrong number of arguments!");
return NS_ERROR_UNEXPECTED;
}
int32_t type;
rv = aArguments->GetTypeOfIndex(0, &type);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (type != mozIStorageStatement::VALUE_TYPE_BLOB) {
NS_WARNING("Don't call me with the wrong type of arguments!");
return NS_ERROR_UNEXPECTED;
}
const uint8_t* oldBlob;
uint32_t oldBlobLength;
rv = aArguments->GetSharedBlob(0, &oldBlobLength, &oldBlob);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
AutoFallibleTArray<IndexDataValue, 32> oldIdv;
rv = ReadOldCompressedIDVFromBlob(oldBlob, oldBlobLength, oldIdv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
UniqueFreePtr<uint8_t> newIdv;
uint32_t newIdvLength;
rv = MakeCompressedIndexDataValues(oldIdv, newIdv, &newIdvLength);
std::pair<uint8_t*, int> data(newIdv.get(), newIdvLength);
nsCOMPtr<nsIVariant> result = new storage::AdoptedBlobVariant(data);
newIdv.release();
result.forget(aResult);
return NS_OK;
}
nsresult
UpgradeSchemaFrom20_0To21_0(mozIStorageConnection* aConnection)
{
// This should have been part of the 18 to 19 upgrade, where we changed the
// layout of the index_data_values blobs but didn't upgrade the existing data.
// See bug 1202788.
AssertIsOnIOThread();
MOZ_ASSERT(aConnection);
PROFILER_LABEL("IndexedDB",
"UpgradeSchemaFrom20_0To21_0",
js::ProfileEntry::Category::STORAGE);
nsRefPtr<UpgradeIndexDataValuesFunction> function =
new UpgradeIndexDataValuesFunction();
NS_NAMED_LITERAL_CSTRING(functionName, "upgrade_idv");
nsresult rv = aConnection->CreateFunction(functionName, 1, function);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
"UPDATE object_data "
"SET index_data_values = upgrade_idv(index_data_values) "
"WHERE index_data_values IS NOT NULL;"
));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = aConnection->RemoveFunction(functionName);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = aConnection->SetSchemaVersion(MakeSchemaVersion(21, 0));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
nsresult
GetDatabaseFileURL(nsIFile* aDatabaseFile,
PersistenceType aPersistenceType,
@ -4346,7 +4558,7 @@ CreateStorageConnection(nsIFile* aDBFile,
}
} else {
// This logic needs to change next time we change the schema!
static_assert(kSQLiteSchemaVersion == int32_t((20 << 4) + 0),
static_assert(kSQLiteSchemaVersion == int32_t((21 << 4) + 0),
"Upgrade function needed due to schema version increase.");
while (schemaVersion != kSQLiteSchemaVersion) {
@ -4384,6 +4596,8 @@ CreateStorageConnection(nsIFile* aDBFile,
rv = UpgradeSchemaFrom18_0To19_0(connection);
} else if (schemaVersion == MakeSchemaVersion(19, 0)) {
rv = UpgradeSchemaFrom19_0To20_0(aFMDirectory, connection);
} else if (schemaVersion == MakeSchemaVersion(20, 0)) {
rv = UpgradeSchemaFrom20_0To21_0(connection);
} else {
IDB_WARNING("Unable to open IndexedDB database, no upgrade path is "
"available!");

Просмотреть файл

@ -43,12 +43,12 @@ function doTest(aApnSettings, aHaveV4Address, aHaveV6Address) {
if (aHaveV4Address) {
ok(ips.value.reduce(function(aFound, aAddress) {
return aFound || aAddress.indexOf(":") < 0;
}), "IPv4 address");
}, false), "IPv4 address");
}
if (aHaveV6Address) {
ok(ips.value.reduce(function(aFound, aAddress) {
return aFound || aAddress.indexOf(":") > 0;
}), "IPv6 address");
}, false), "IPv6 address");
}
})
.then(() => setDataEnabledAndWait(false));

Просмотреть файл

@ -344,18 +344,21 @@ PresentationSessionInfo::NotifyData(const nsACString& aData)
* Implementation of PresentationRequesterInfo
*
* During presentation session establishment, the sender expects the following
* after trying to establish the control channel: (The order between step 2 and
* 3 is not guaranteed.)
* after trying to establish the control channel: (The order between step 3 and
* 4 is not guaranteed.)
* 1. |Init| is called to open a socket |mServerSocket| for data transport
* channel and send the offer to the receiver via the control channel.
* 2.1 |OnSocketAccepted| of |nsIServerSocketListener| is called to indicate the
* channel.
* 2. |NotifyOpened| of |nsIPresentationControlChannelListener| is called to
* indicate the control channel is ready to use. Then send the offer to the
* receiver via the control channel.
* 3.1 |OnSocketAccepted| of |nsIServerSocketListener| is called to indicate the
* data transport channel is connected. Then initialize |mTransport|.
* 2.2 |NotifyTransportReady| of |nsIPresentationSessionTransportCallback| is
* 3.2 |NotifyTransportReady| of |nsIPresentationSessionTransportCallback| is
* called.
* 3. |OnAnswer| of |nsIPresentationControlChannelListener| is called to
* 4. |OnAnswer| of |nsIPresentationControlChannelListener| is called to
* indicate the receiver is ready. Close the control channel since it's no
* longer needed.
* 4. Once both step 2 and 3 are done, the presentation session is ready to use.
* 5. Once both step 3 and 4 are done, the presentation session is ready to use.
* So notify the listener of CONNECTED state.
*/
@ -385,26 +388,6 @@ PresentationRequesterInfo::Init(nsIPresentationControlChannel* aControlChannel)
return rv;
}
// Prepare and send the offer.
int32_t port;
rv = mServerSocket->GetPort(&port);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCString address;
rv = GetAddress(address);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsRefPtr<PresentationChannelDescription> description =
new PresentationChannelDescription(address, static_cast<uint16_t>(port));
rv = mControlChannel->SendOffer(description);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
@ -496,8 +479,22 @@ PresentationRequesterInfo::OnAnswer(nsIPresentationChannelDescription* aDescript
NS_IMETHODIMP
PresentationRequesterInfo::NotifyOpened()
{
// Do nothing and wait for receiver to be ready.
return NS_OK;
// Prepare and send the offer.
int32_t port;
nsresult rv = mServerSocket->GetPort(&port);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCString address;
rv = GetAddress(address);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsRefPtr<PresentationChannelDescription> description =
new PresentationChannelDescription(address, static_cast<uint16_t>(port));
return mControlChannel->SendOffer(description);
}
NS_IMETHODIMP
@ -666,24 +663,19 @@ PresentationResponderInfo::InitTransportAndSendAnswer()
// description for the answer, which is not actually checked at requester side.
nsCOMPtr<nsINetAddr> selfAddr;
rv = mTransport->GetSelfAddress(getter_AddRefs(selfAddr));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
NS_WARN_IF(NS_FAILED(rv));
nsCString address;
selfAddr->GetAddress(address);
uint16_t port;
selfAddr->GetPort(&port);
uint16_t port = 0;
if (NS_SUCCEEDED(rv)) {
selfAddr->GetAddress(address);
selfAddr->GetPort(&port);
}
nsCOMPtr<nsIPresentationChannelDescription> description =
new PresentationChannelDescription(address, port);
rv = mControlChannel->SendAnswer(description);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
return mControlChannel->SendAnswer(description);
}
nsresult
PresentationResponderInfo::UntrackFromService()

Просмотреть файл

@ -16,7 +16,7 @@ interface nsIPresentationChannelDescription: nsISupports
// Type of transport channel.
readonly attribute uint8_t type;
// Addresses for TCP channel.
// Addresses for TCP channel (as a list of nsISupportsCString).
// Should only be used while type == TYPE_TCP.
readonly attribute nsIArray tcpAddress;

Просмотреть файл

@ -264,8 +264,8 @@ function ChannelDescription(aInit) {
this._tcpAddresses = Cc["@mozilla.org/array;1"]
.createInstance(Ci.nsIMutableArray);
for (let address of aInit.tcpAddress) {
let wrapper = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
let wrapper = Cc["@mozilla.org/supports-cstring;1"]
.createInstance(Ci.nsISupportsCString);
wrapper.data = address;
this._tcpAddresses.appendElement(wrapper, false);
}
@ -313,7 +313,7 @@ function discriptionAsJson(aDescription) {
let addresses = aDescription.tcpAddress.QueryInterface(Ci.nsIArray);
json.tcpAddress = [];
for (let idx = 0; idx < addresses.length; idx++) {
let address = addresses.queryElementAt(idx, Ci.nsISupportsString);
let address = addresses.queryElementAt(idx, Ci.nsISupportsCString);
json.tcpAddress.push(address.data);
}
json.tcpPort = aDescription.tcpPort;
@ -541,11 +541,11 @@ TCPControlChannel.prototype = {
break;
}
case "requestSession:Offer": {
this._listener.onOffer(new ChannelDescription(aMsg.offer));
this._onOffer(aMsg.offer);
break;
}
case "requestSession:Answer": {
this._listener.onAnswer(new ChannelDescription(aMsg.answer));
this._onAnswer(aMsg.answer);
break;
}
}

Просмотреть файл

@ -100,9 +100,41 @@ const mockedControlChannel = {
return this._listener;
},
sendOffer: function(offer) {
sendAsyncMessage('offer-sent');
var isValid = false;
try {
var addresses = offer.tcpAddress;
if (addresses.length > 0) {
for (var i = 0; i < addresses.length; i++) {
// Ensure CString addresses are used. Otherwise, an error will be thrown.
addresses.queryElementAt(i, Ci.nsISupportsCString);
}
isValid = true;
}
} catch (e) {
isValid = false;
}
sendAsyncMessage('offer-sent', isValid);
},
sendAnswer: function(answer) {
var isValid = false;
try {
var addresses = answer.tcpAddress;
if (addresses.length > 0) {
for (var i = 0; i < addresses.length; i++) {
// Ensure CString addresses are used. Otherwise, an error will be thrown.
addresses.queryElementAt(i, Ci.nsISupportsCString);
}
isValid = true;
}
} catch (e) {
isValid = false;
}
sendAsyncMessage('answer-sent', isValid);
this._listener.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyTransportReady();
},
close: function(reason) {
@ -120,6 +152,10 @@ const mockedControlChannel = {
sendAsyncMessage('answer-received');
this._listener.QueryInterface(Ci.nsIPresentationControlChannelListener).onAnswer(mockedChannelDescription);
},
simulateNotifyOpened: function() {
sendAsyncMessage('control-channel-opened');
this._listener.QueryInterface(Ci.nsIPresentationControlChannelListener).notifyOpened();
},
};
const mockedDevice = {
@ -337,6 +373,10 @@ addMessageListener('trigger-incoming-transport', function() {
mockedServerSocket.simulateOnSocketAccepted(mockedServerSocket, mockedSocketTransport);
});
addMessageListener('trigger-control-channel-open', function(reason) {
mockedControlChannel.simulateNotifyOpened();
});
addMessageListener('trigger-control-channel-close', function(reason) {
mockedControlChannel.close(reason);
});

Просмотреть файл

@ -62,6 +62,11 @@ function setup() {
info("An offer is received.");
});
gScript.addMessageListener('answer-sent', function answerSentHandler(aIsValid) {
gScript.removeMessageListener('answer-sent', answerSentHandler);
ok(aIsValid, "A valid answer is sent.");
});
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed normally.");

Просмотреть файл

@ -111,6 +111,11 @@ function setup() {
info("An offer is received.");
});
gScript.addMessageListener('answer-sent', function answerSentHandler(aIsValid) {
gScript.removeMessageListener('answer-sent', answerSentHandler);
ok(aIsValid, "A valid answer is sent.");
});
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed normally.");

Просмотреть файл

@ -41,6 +41,12 @@ function testStartSession() {
gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
info("A control channel is established.");
gScript.sendAsyncMessage('trigger-control-channel-open');
});
gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
info("The control channel is opened.");
});
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
@ -48,9 +54,9 @@ function testStartSession() {
info("The control channel is closed. " + aReason);
});
gScript.addMessageListener('offer-sent', function offerSentHandler() {
gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
gScript.removeMessageListener('offer-sent', offerSentHandler);
info("An offer is sent out.");
ok(aIsValid, "A valid offer is sent out.");
gScript.sendAsyncMessage('trigger-incoming-transport');
});

Просмотреть файл

@ -41,6 +41,12 @@ function testStartSession() {
gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
info("A control channel is established.");
gScript.sendAsyncMessage('trigger-control-channel-open');
});
gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
info("The control channel is opened.");
});
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
@ -48,9 +54,9 @@ function testStartSession() {
info("The control channel is closed. " + aReason);
});
gScript.addMessageListener('offer-sent', function offerSentHandler() {
gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
gScript.removeMessageListener('offer-sent', offerSentHandler);
info("An offer is sent out.");
ok(aIsValid, "A valid offer is sent out.");
gScript.sendAsyncMessage('trigger-incoming-answer');
});

Просмотреть файл

@ -76,6 +76,12 @@ function testStartSessionUnexpectedControlChannelCloseBeforeDataTransportInit()
gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
info("A control channel is established.");
gScript.sendAsyncMessage('trigger-control-channel-open');
});
gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
info("The control channel is opened.");
});
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
@ -83,9 +89,9 @@ function testStartSessionUnexpectedControlChannelCloseBeforeDataTransportInit()
info("The control channel is closed. " + aReason);
});
gScript.addMessageListener('offer-sent', function offerSentHandler() {
gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
gScript.removeMessageListener('offer-sent', offerSentHandler);
info("An offer is sent out.");
ok(aIsValid, "A valid offer is sent out.");
gScript.sendAsyncMessage('trigger-control-channel-close', SpecialPowers.Cr.NS_ERROR_FAILURE);
});
@ -113,6 +119,12 @@ function testStartSessionUnexpectedControlChannelCloseBeforeDataTransportReady()
gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
info("A control channel is established.");
gScript.sendAsyncMessage('trigger-control-channel-open');
});
gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
info("The control channel is opened.");
});
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
@ -120,9 +132,9 @@ function testStartSessionUnexpectedControlChannelCloseBeforeDataTransportReady()
info("The control channel is closed. " + aReason);
});
gScript.addMessageListener('offer-sent', function offerSentHandler() {
gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
gScript.removeMessageListener('offer-sent', offerSentHandler);
info("An offer is sent out.");
ok(aIsValid, "A valid offer is sent out.");
gScript.sendAsyncMessage('trigger-incoming-transport');
});
@ -161,6 +173,12 @@ function testStartSessionUnexpectedDataTransportClose() {
gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
info("A control channel is established.");
gScript.sendAsyncMessage('trigger-control-channel-open');
});
gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
info("The control channel is opened.");
});
gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
@ -168,9 +186,9 @@ function testStartSessionUnexpectedDataTransportClose() {
info("The control channel is closed. " + aReason);
});
gScript.addMessageListener('offer-sent', function offerSentHandler() {
gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
gScript.removeMessageListener('offer-sent', offerSentHandler);
info("An offer is sent out.");
ok(aIsValid, "A valid offer is sent out.");
gScript.sendAsyncMessage('trigger-incoming-transport');
});

Просмотреть файл

@ -29,8 +29,8 @@ function TestDescription(aType, aTcpAddress, aTcpPort) {
this.tcpAddress = Cc["@mozilla.org/array;1"]
.createInstance(Ci.nsIMutableArray);
for (let address of aTcpAddress) {
let wrapper = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
let wrapper = Cc["@mozilla.org/supports-cstring;1"]
.createInstance(Ci.nsISupportsCString);
wrapper.data = address;
this.tcpAddress.appendElement(wrapper, false);
}
@ -91,7 +91,7 @@ function testPresentationServer() {
this.status = 'onOffer';
let offer = aOffer.QueryInterface(Ci.nsIPresentationChannelDescription);
Assert.strictEqual(offer.tcpAddress.queryElementAt(0,Ci.nsISupportsString).data,
Assert.strictEqual(offer.tcpAddress.queryElementAt(0,Ci.nsISupportsCString).data,
OFFER_ADDRESS,
'expected offer address array');
Assert.equal(offer.tcpPort, OFFER_PORT, 'expected offer port');
@ -148,7 +148,7 @@ function testPresentationServer() {
Assert.equal(this.status, 'opened', '2. presenterControlChannel: get answer, close channel');
let answer = aAnswer.QueryInterface(Ci.nsIPresentationChannelDescription);
Assert.strictEqual(answer.tcpAddress.queryElementAt(0,Ci.nsISupportsString).data,
Assert.strictEqual(answer.tcpAddress.queryElementAt(0,Ci.nsISupportsCString).data,
ANSWER_ADDRESS,
'expected answer address array');
Assert.equal(answer.tcpPort, ANSWER_PORT, 'expected answer port');

349
gfx/doc/B2GInputFlow.svg Normal file
Просмотреть файл

@ -0,0 +1,349 @@
<?xml version="1.0"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1000" height="800">
<title>Touch input event flow on B2G</title>
<g id="arrows"></g>
<style type="text/css"><![CDATA[
text {
fill: black;
text-anchor: middle;
white-space: pre-line;
font-size: 14px;
}
rect {
fill: none;
}
line {
stroke: black;
}
.parentinput rect {
stroke: black;
}
text.parentinput {
fill: black;
text-anchor: start;
}
.parentmain rect {
stroke: orange;
}
text.parentmain {
fill: orange;
text-anchor: start;
}
.parentcompositor rect {
stroke: green;
}
text.parentcompositor {
fill: green;
text-anchor: start;
}
.childmain rect {
stroke: red;
}
text.childmain {
fill: red;
text-anchor: start;
}
.bothmain rect {
stroke: blue;
}
text.bothmain {
fill: blue;
text-anchor: start;
}
]]></style>
<script type="text/javascript"><![CDATA[
var svg = "http://www.w3.org/2000/svg";
var maxY = 0;
function breaks(text) {
var count = 0;
for (var i = text.length - 1; i >= 0; i--) {
if (text.charAt(i) == '\n') {
count++;
}
}
return count;
}
function makeAction(text, x, y, thread) {
maxY = Math.max(maxY, y);
var g = document.createElementNS(svg, "g");
g.setAttribute("class", "action " + thread);
g.setAttribute("transform", "translate(" + x + ", " + (y + 30) + ")");
var r = document.createElementNS(svg, "rect");
r.setAttribute("width", "100");
r.setAttribute("height", "40");
var t = document.createElementNS(svg, "text");
t.setAttribute("x", "50");
t.setAttribute("y", 25 - (7 * breaks(text)));
t.appendChild(document.createTextNode(text));
g.appendChild(r);
g.appendChild(t);
return g;
}
function makeChoice(text, x, y, thread) {
maxY = Math.max(maxY, y);
var g = document.createElementNS(svg, "g");
g.setAttribute("class", "choice " + thread);
g.setAttribute("transform", "translate(" + (x + 15) + ", " + (y + 15) + ")");
var g2 = document.createElementNS(svg, "g");
g2.setAttribute("transform", "rotate(-45, 35, 35)");
var r = document.createElementNS(svg, "rect");
r.setAttribute("width", "70");
r.setAttribute("height", "70");
g2.appendChild(r);
var t = document.createElementNS(svg, "text");
t.setAttribute("x", "35");
t.setAttribute("y", 40 - (7 * breaks(text)));
t.appendChild(document.createTextNode(text));
g.appendChild(g2);
g.appendChild(t);
return g;
}
function makeLabelChoice(label, point) {
var t = document.createElementNS(svg, "text");
t.setAttribute("x", point.x);
t.setAttribute("y", point.y);
t.appendChild(document.createTextNode(label));
return t;
}
function makeLine(sx, sy, ex, ey) {
maxY = Math.max(maxY, sy, ey);
var l = document.createElementNS(svg, "line");
l.setAttribute("x1", sx);
l.setAttribute("y1", sy);
l.setAttribute("x2", ex);
l.setAttribute("y2", ey);
return l;
}
function makeArrow(start, end) {
var g = document.createElementNS(svg, "g");
g.appendChild(makeLine(start.x, start.y, end.x, end.y));
if (start.x != end.x) {
start.x = end.x + (4 * Math.sign(start.x - end.x));
g.appendChild(makeLine(start.x, start.y - 4, end.x, end.y));
g.appendChild(makeLine(start.x, start.y + 4, end.x, end.y));
} else if (start.y != end.y) {
start.y = end.y + (4 * Math.sign(start.y - end.y));
g.appendChild(makeLine(start.x - 4, start.y, end.x, end.y));
g.appendChild(makeLine(start.x + 4, start.y, end.x, end.y));
}
return g;
}
function makeVHArrow(start, end) {
var g = document.createElementNS(svg, "g");
g.appendChild(makeLine(start.x, start.y, start.x, end.y));
start.y = end.y;
g.appendChild(makeArrow(start, end));
return g;
}
function makeHVArrow(start, end) {
var g = document.createElementNS(svg, "g");
g.appendChild(makeLine(start.x, start.y, end.x, start.y));
start.x = end.x;
g.appendChild(makeArrow(start, end));
return g;
}
function makeVHVArrow(start, end, length) {
var g = document.createElementNS(svg, "g");
g.appendChild(makeLine(start.x, start.y, start.x, start.y + length));
start.y += length;
g.appendChild(makeLine(start.x, start.y, end.x, start.y));
start.x = end.x;
g.appendChild(makeArrow(start, end));
return g;
}
function makeHVHArrow(start, end, length) {
var g = document.createElementNS(svg, "g");
g.appendChild(makeLine(start.x, start.y, start.x + length, start.y));
start.x += length;
g.appendChild(makeLine(start.x, start.y, start.x, end.y));
start.y = end.y;
g.appendChild(makeArrow(start, end));
return g;
}
function translation(group) {
var r = new RegExp("translate\\((\\d+), (\\d+)\\)");
var result = r.exec(group.getAttribute("transform"));
return { x: parseInt(result[1]), y: parseInt(result[2]) };
}
function isAction(group) {
return group.classList.contains("action");
}
function isChoice(group) {
return group.classList.contains("choice");
}
function offset(point, x, y) {
point.x += x;
point.y += y;
return point;
}
function rightOf(group) {
var t = translation(group);
if (isAction(group)) {
return offset(t, 100, 20);
}
if (isChoice(group)) {
return offset(t, 85, 35);
}
return t;
}
function leftOf(group) {
var t = translation(group);
if (isAction(group)) {
return offset(t, 0, 20);
}
if (isChoice(group)) {
return offset(t, -15, 35);
}
return t;
}
function topOf(group) {
var t = translation(group);
if (isAction(group)) {
return offset(t, 50, 0);
}
if (isChoice(group)) {
return offset(t, 35, -15);
}
return t;
}
function bottomOf(group) {
var t = translation(group);
if (isAction(group)) {
return offset(t, 50, 40);
}
if (isChoice(group)) {
return offset(t, 35, 85);
}
return t;
}
function midpoint(start, end) {
return { x: (start.x + end.x) / 2,
y: (start.y + end.y) / 2 };
}
function makeLegend(label, thread) {
var t = document.createElementNS(svg, "text");
t.setAttribute("x", "10");
t.setAttribute("y", maxY);
t.setAttribute("class", thread);
maxY += 15;
t.appendChild(document.createTextNode(label));
return t;
}
var android = makeAction("Android/Gonk", 20, 0, "parentinput");
var sendNative = makeAction("DOMWindowUtils\nsendNativeTouchPoint", 20, 100, "parentmain");
var apzHitTest = makeAction("APZ hit test", 150, 0, "parentcompositor");
var apzUntransform = makeAction("APZ\nuntransform", 300, 0, "parentcompositor");
var apzGesture = makeAction("APZ gesture\ndetection", 450, 0, "parentcompositor");
var apzTransform = makeAction("APZ transform\nupdate", 600, 0, "parentcompositor");
var compositor = makeAction("Compositor", 750, 0, "parentcompositor");
var nsAppShell = makeAction("nsAppShell", 150, 100, "parentmain");
var rootHitTest = makeAction("Gecko hit test\n(root process)", 300, 100, "parentmain");
var rootEsm = makeAction("Gecko ESM\n(root process)", 450, 100, "parentmain");
var isEdgeGesture = makeChoice("Edge gesture?", 300, 200, "parentmain");
var edgeConsume = makeAction("Consume\nevent block", 150, 200, "parentmain");
var bepjsm = makeAction("BEParent.jsm\nsendTouchEvent", 450, 200, "parentmain");
var iframeSend = makeAction("HTMLIFrameElement\nsendTouchEvent", 20, 275, "parentmain");
var isApzTarget = makeChoice("Target\nhas APZ?", 600, 200, "parentmain");
var sendTouchEvent = makeAction("Target\nsendTouchEventToWindow", 750, 100, "parentmain");
var injectTouch = makeAction("injectTouchEvent", 750, 200, "parentmain");
var targetESM = makeAction("Target window\nESM", 750, 450, "bothmain");
var tabParent = makeAction("TabParent", 750, 350, "parentmain");
var geckoUntransform = makeAction("Gecko\nuntransform", 600, 350, "parentmain");
var tabChild = makeAction("TabChild", 450, 350, "childmain");
var isApzcEnabled = makeChoice("APZ\nenabled?", 300, 350, "childmain");
var tabGesture = makeAction("TabChild gesture\ndetection", 150, 350, "childmain");
var childHitTest = makeAction("Gecko hit test\n(child process)", 300, 450, "childmain");
var childEsm = makeAction("Gecko ESM\n(child process)", 450, 450, "childmain");
var childContent = makeAction("Content\n(child process)", 600, 450, "childmain");
document.documentElement.appendChild(android);
document.documentElement.appendChild(sendNative);
document.documentElement.appendChild(apzHitTest);
document.documentElement.appendChild(apzUntransform);
document.documentElement.appendChild(apzGesture);
document.documentElement.appendChild(apzTransform);
document.documentElement.appendChild(compositor);
document.documentElement.appendChild(nsAppShell);
document.documentElement.appendChild(rootHitTest);
document.documentElement.appendChild(rootEsm);
document.documentElement.appendChild(isEdgeGesture);
document.documentElement.appendChild(edgeConsume);
document.documentElement.appendChild(bepjsm);
document.documentElement.appendChild(iframeSend);
document.documentElement.appendChild(isApzTarget);
document.documentElement.appendChild(sendTouchEvent);
document.documentElement.appendChild(injectTouch);
document.documentElement.appendChild(targetESM);
document.documentElement.appendChild(tabParent);
document.documentElement.appendChild(geckoUntransform);
document.documentElement.appendChild(tabChild);
document.documentElement.appendChild(isApzcEnabled);
document.documentElement.appendChild(tabGesture);
document.documentElement.appendChild(childHitTest);
document.documentElement.appendChild(childEsm);
document.documentElement.appendChild(childContent);
document.documentElement.appendChild(makeLabelChoice("Y", offset(leftOf(isEdgeGesture), -5, -5)));
document.documentElement.appendChild(makeLabelChoice("N", offset(rightOf(isEdgeGesture), 5, -5)));
document.documentElement.appendChild(makeLabelChoice("N", offset(topOf(isApzTarget), 8, -10)));
document.documentElement.appendChild(makeLabelChoice("Y", offset(rightOf(isApzTarget), 10, 14)));
document.documentElement.appendChild(makeLabelChoice("N", offset(leftOf(isApzcEnabled), -5, -5)));
document.documentElement.appendChild(makeLabelChoice("Y", offset(bottomOf(isApzcEnabled), 10, 14)));
var arrows = document.getElementById('arrows');
arrows.appendChild(makeArrow(rightOf(android), leftOf(apzHitTest)));
arrows.appendChild(makeVHVArrow(topOf(sendNative), midpoint(rightOf(android), leftOf(apzHitTest)), -20));
arrows.appendChild(makeArrow(rightOf(apzHitTest), leftOf(apzUntransform)));
arrows.appendChild(makeArrow(rightOf(apzUntransform), leftOf(apzGesture)));
arrows.appendChild(makeArrow(rightOf(apzGesture), leftOf(apzTransform)));
arrows.appendChild(makeArrow(rightOf(apzTransform), leftOf(compositor)));
arrows.appendChild(makeVHVArrow(midpoint(leftOf(apzUntransform), rightOf(apzGesture)), topOf(nsAppShell), 40));
arrows.appendChild(makeArrow(rightOf(nsAppShell), leftOf(rootHitTest)));
arrows.appendChild(makeArrow(rightOf(rootHitTest), leftOf(rootEsm)));
arrows.appendChild(makeVHVArrow(bottomOf(rootEsm), topOf(isEdgeGesture), 15));
arrows.appendChild(makeArrow(leftOf(isEdgeGesture), rightOf(edgeConsume)));
arrows.appendChild(makeArrow(rightOf(isEdgeGesture), leftOf(bepjsm), 20));
arrows.appendChild(makeHVArrow(rightOf(iframeSend), bottomOf(bepjsm)));
arrows.appendChild(makeArrow(rightOf(bepjsm), leftOf(isApzTarget)));
arrows.appendChild(makeArrow(rightOf(isApzTarget), leftOf(injectTouch)));
arrows.appendChild(makeArrow(bottomOf(injectTouch), topOf(tabParent)));
arrows.appendChild(makeVHArrow(topOf(isApzTarget), leftOf(sendTouchEvent)));
arrows.appendChild(makeHVHArrow(rightOf(sendTouchEvent), rightOf(targetESM), 30));
arrows.appendChild(makeArrow(leftOf(tabParent), rightOf(geckoUntransform)));
arrows.appendChild(makeArrow(leftOf(geckoUntransform), rightOf(tabChild)));
arrows.appendChild(makeArrow(leftOf(tabChild), rightOf(isApzcEnabled)));
arrows.appendChild(makeArrow(leftOf(isApzcEnabled), rightOf(tabGesture)));
arrows.appendChild(makeArrow(bottomOf(isApzcEnabled), topOf(childHitTest)));
arrows.appendChild(makeVHArrow(bottomOf(tabGesture), leftOf(childHitTest)));
arrows.appendChild(makeArrow(rightOf(childHitTest), leftOf(childEsm)));
arrows.appendChild(makeArrow(rightOf(childEsm), leftOf(childContent)));
arrows.appendChild(makeVHVArrow(midpoint(leftOf(apzGesture), rightOf(apzTransform)), topOf(tabChild), 300));
document.documentElement.appendChild(makeLegend("Main process input thread", "parentinput"));
document.documentElement.appendChild(makeLegend("Main process main thread", "parentmain"));
document.documentElement.appendChild(makeLegend("Main process compositor thread", "parentcompositor"));
document.documentElement.appendChild(makeLegend("Child process main thread", "childmain"));
document.documentElement.appendChild(makeLegend("Undetermined process main thread", "bothmain"));
]]></script>
</svg>

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Просмотреть файл

@ -7,6 +7,7 @@
#include <cutils/properties.h>
#include "MDNSResponderOperator.h"
#include "nsICancelable.h"
#include "nsXULAppAPI.h"
#include "private/pprio.h"
namespace mozilla {
@ -14,7 +15,7 @@ namespace net {
namespace {
void
inline void
StartService()
{
char value[PROPERTY_VALUE_MAX] = { '\0' };
@ -38,7 +39,39 @@ StopService()
property_set("ctl.stop", "mdnsd");
}
class ServiceCounter
{
public:
static bool IsServiceRunning()
{
return !!sUseCount;
}
private:
static uint32_t sUseCount;
protected:
ServiceCounter()
{
MOZ_ASSERT(NS_IsMainThread());
if (!sUseCount++) {
StartService();
}
}
virtual ~ServiceCounter()
{
MOZ_ASSERT(NS_IsMainThread());
if (!--sUseCount) {
StopService();
}
}
};
uint32_t ServiceCounter::sUseCount = 0;
class DiscoveryRequest final : public nsICancelable
, private ServiceCounter
{
public:
NS_DECL_ISUPPORTS
@ -75,6 +108,7 @@ DiscoveryRequest::Cancel(nsresult aReason)
}
class RegisterRequest final : public nsICancelable
, private ServiceCounter
{
public:
NS_DECL_ISUPPORTS
@ -124,7 +158,10 @@ nsDNSServiceDiscovery::~nsDNSServiceDiscovery()
nsresult
nsDNSServiceDiscovery::Init()
{
StartService();
if (!XRE_IsParentProcess()) {
MOZ_ASSERT(false, "nsDNSServiceDiscovery can only be used in parent process");
return NS_ERROR_FAILURE;
}
return NS_OK;
}
@ -140,6 +177,7 @@ nsDNSServiceDiscovery::StartDiscovery(const nsACString& aServiceType,
return rv;
}
nsCOMPtr<nsICancelable> req = new DiscoveryRequest(this, aListener);
nsRefPtr<BrowseOperator> browserOp = new BrowseOperator(aServiceType,
aListener);
if (NS_WARN_IF(NS_FAILED(rv = browserOp->Start()))) {
@ -148,7 +186,6 @@ nsDNSServiceDiscovery::StartDiscovery(const nsACString& aServiceType,
mDiscoveryMap.Put(aListener, browserOp);
nsCOMPtr<nsICancelable> req = new DiscoveryRequest(this, aListener);
req.forget(aRetVal);
return NS_OK;
@ -185,6 +222,7 @@ nsDNSServiceDiscovery::RegisterService(nsIDNSServiceInfo* aServiceInfo,
return rv;
}
nsCOMPtr<nsICancelable> req = new RegisterRequest(this, aListener);
nsRefPtr<RegisterOperator> registerOp = new RegisterOperator(aServiceInfo,
aListener);
if (NS_WARN_IF(NS_FAILED(rv = registerOp->Start()))) {
@ -193,7 +231,6 @@ nsDNSServiceDiscovery::RegisterService(nsIDNSServiceInfo* aServiceInfo,
mRegisterMap.Put(aListener, registerOp);
nsCOMPtr<nsICancelable> req = new RegisterRequest(this, aListener);
req.forget(aRetVal);
return NS_OK;
@ -222,6 +259,10 @@ NS_IMETHODIMP
nsDNSServiceDiscovery::ResolveService(nsIDNSServiceInfo* aServiceInfo,
nsIDNSServiceResolveListener* aListener)
{
if (!ServiceCounter::IsServiceRunning()) {
return NS_ERROR_FAILURE;
}
nsresult rv;
nsRefPtr<ResolveOperator> resolveOp = new ResolveOperator(aServiceInfo,

Просмотреть файл

@ -26,8 +26,8 @@ public:
explicit nsDNSServiceDiscovery() = default;
/*
** The mDNS service is started in this function. However, the function returns
** without waiting. Therefore, all operations before service started will fail
** The mDNS service is started on demand. If no one uses, mDNS service will not
** start. Therefore, all operations before service started will fail
** and get error code |kDNSServiceErr_ServiceNotRunning| defined in dns_sd.h.
**/
nsresult Init();

Просмотреть файл

@ -21,7 +21,7 @@ RUN git config --global user.email "mozilla@example.com" && \
git config --global user.name "mozilla"
# VCS Tools
RUN npm install -g taskcluster-vcs@2.3.9
RUN npm install -g taskcluster-vcs@2.3.12
# TODO enable worker
# TODO volume mount permissions will be an issue

Просмотреть файл

@ -1 +1 @@
0.5.8
0.5.9

Просмотреть файл

@ -250,7 +250,7 @@ EOF
peep install -r requirements.txt
# TC-VCS
npm install -g taskcluster-vcs@2.3.8
npm install -g taskcluster-vcs@2.3.12
# note that TC will replace workspace with a cache mount; there's no sense
# creating anything inside there

Просмотреть файл

@ -1,4 +1,4 @@
FROM taskcluster/builder:0.5.8
FROM taskcluster/builder:0.5.9
MAINTAINER Wander Lairson Costa <wcosta@mozilla.com>
ENV SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE /home/worker/socorro.token

Просмотреть файл

@ -1 +1 @@
0.0.19
0.0.20

Просмотреть файл

@ -31,7 +31,7 @@ RUN git config --global user.email "mozilla@example.com" && \
# Get node packages
RUN npm install -g taskcluster-vcs@2.3.9
RUN npm install -g taskcluster-vcs@2.3.12
WORKDIR /home/worker

Просмотреть файл

@ -1 +1 @@
0.0.6
0.0.7

Просмотреть файл

@ -18,7 +18,7 @@ RUN chmod u+x /usr/local/bin/linux64-minidump_stackwalk
RUN apt-get install -y python-pip && pip install virtualenv;
RUN mkdir Documents; mkdir Pictures; mkdir Music; mkdir Videos; mkdir artifacts
RUN npm install -g npm@^2.0.0
RUN npm install -g taskcluster-vcs@2.3.9
RUN npm install -g taskcluster-vcs@2.3.12
RUN npm install -g taskcluster-npm-cache@1.1.14
RUN rm -Rf .cache && mkdir -p .cache
ENV PATH $PATH:/home/worker/bin

Просмотреть файл

@ -1 +1 @@
0.3.7
0.3.8

Просмотреть файл

@ -11,7 +11,7 @@ RUN bash /tmp/system-setup.sh
# configure git and install tc-vcs
RUN git config --global user.email "nobody@mozilla.com" && \
git config --global user.name "mozilla"
RUN npm install -g taskcluster-vcs@2.3.9
RUN npm install -g taskcluster-vcs@2.3.12
# Ensure that build specific dependencies live in a single layer
ADD build-setup.sh /tmp/build-setup.sh

Просмотреть файл

@ -1 +1 @@
0.0.6
0.0.7

Просмотреть файл

@ -11,7 +11,7 @@ RUN bash /tmp/system-setup.sh
# configure git and install tc-vcs
RUN git config --global user.email "nobody@mozilla.com" && \
git config --global user.name "mozilla"
RUN npm install -g taskcluster-vcs@2.3.9
RUN npm install -g taskcluster-vcs@2.3.12
# Ensure that build specific dependencies live in a single layer
ADD build-setup.sh /tmp/build-setup.sh

Просмотреть файл

@ -1 +1 @@
0.0.6
0.0.7

Просмотреть файл

@ -189,6 +189,19 @@ def set_interactive_task(task, interactive):
payload["features"] = {}
payload["features"]["interactive"] = True
def remove_caches_from_task(task):
r"""Remove all caches but tc-vcs from the task.
:param task: task definition.
"""
try:
caches = task["task"]["payload"]["cache"]
for cache in caches.keys():
if cache != "tc-vcs":
caches.pop(cache)
except KeyError:
pass
@CommandProvider
class DecisionTask(object):
@Command('taskcluster-decision', category="ci",
@ -365,6 +378,10 @@ class Graph(object):
build_task = templates.load(build['task'], build_parameters)
set_interactive_task(build_task, interactive)
# try builds don't use cache
if project == "try":
remove_caches_from_task(build_task)
if params['revision_hash']:
decorate_task_treeherder_routes(build_task['task'],
treeherder_route)