Merge m-c to inbound, a=merge CLOSED TREE

This commit is contained in:
Wes Kocher 2015-10-20 15:28:33 -07:00
commit 78455f02c4
138 changed files with 2157 additions and 664 deletions

View File

@ -15,7 +15,7 @@
<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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>

View File

@ -15,7 +15,7 @@
<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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>

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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

View File

@ -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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>

View File

@ -15,7 +15,7 @@
<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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

View File

@ -15,7 +15,7 @@
<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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "3491a49da4d4ce45b8a682e95d0ce68892c2b8ea",
"git_revision": "11eb5d4cb2675d359d277ae17772bc75f7ccedbc",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "6458b8861154bf7e28971ce85d49e404ac96da29",
"revision": "6575311e4b9daab959d80f17cf77bea4c91660a6",
"repo_path": "integration/gaia-central"
}

View File

@ -15,7 +15,7 @@
<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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>

View File

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>

View File

@ -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="3491a49da4d4ce45b8a682e95d0ce68892c2b8ea"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="11eb5d4cb2675d359d277ae17772bc75f7ccedbc"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>

View File

@ -800,6 +800,18 @@
@RESPATH@/res/table-remove-row-active.gif
@RESPATH@/res/table-remove-row-hover.gif
@RESPATH@/res/table-remove-row.gif
@RESPATH@/res/accessiblecaret.png
@RESPATH@/res/accessiblecaret@1.5x.png
@RESPATH@/res/accessiblecaret@2.25x.png
@RESPATH@/res/accessiblecaret@2x.png
@RESPATH@/res/accessiblecaret_tilt_left.png
@RESPATH@/res/accessiblecaret_tilt_left@1.5x.png
@RESPATH@/res/accessiblecaret_tilt_left@2.25x.png
@RESPATH@/res/accessiblecaret_tilt_left@2x.png
@RESPATH@/res/accessiblecaret_tilt_right.png
@RESPATH@/res/accessiblecaret_tilt_right@1.5x.png
@RESPATH@/res/accessiblecaret_tilt_right@2.25x.png
@RESPATH@/res/accessiblecaret_tilt_right@2x.png
@RESPATH@/res/text_caret.png
@RESPATH@/res/text_caret@1.5x.png
@RESPATH@/res/text_caret@2.25x.png

View File

@ -676,7 +676,7 @@
<hbox id="nav-bar-customization-target" flex="1">
<toolbaritem id="urlbar-container" flex="400" persist="width"
title="&locationItem.title;" removable="false"
removable="false"
class="chromeclass-location" overflows="false">
<toolbarbutton id="back-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&backCmd.label;"
@ -799,16 +799,13 @@
<toolbarbutton id="urlbar-go-button"
class="chromeclass-toolbar-additional"
onclick="gURLBar.handleCommand(event);"
aria-label="&goEndCap.tooltip;"
tooltiptext="&goEndCap.tooltip;"/>
<toolbarbutton id="urlbar-reload-button"
class="chromeclass-toolbar-additional"
command="Browser:ReloadOrDuplicate"
onclick="checkForMiddleClick(this, event);"
aria-label="&reloadButton.tooltip;"
tooltiptext="&reloadButton.tooltip;"/>
<toolbarbutton id="urlbar-stop-button"
aria-label="&stopButton.tooltip;"
class="chromeclass-toolbar-additional"
command="Browser:Stop"
tooltiptext="&stopButton.tooltip;"/>

View File

@ -3,5 +3,7 @@ support-files =
file_dom_notifications.html
[browser_notification_open_settings.js]
[browser_notification_remove_permission.js]
skip-if = e10s
[browser_notification_tab_switching.js]
skip-if = buildapp == 'mulet' || e10s # Bug 1100662 - content access causing uncaught exception - Error: cannot ipc non-cpow object at chrome://mochitests/content/browser/browser/base/content/test/general/browser_notification_tab_switching.js:32 (or in RemoteAddonsChild.jsm)

View File

@ -0,0 +1,79 @@
"use strict";
var tab;
var notification;
var notificationURL = "http://example.org/browser/browser/base/content/test/alerts/file_dom_notifications.html";
var alertWindowClosed = false;
var permRemoved = false;
function test () {
waitForExplicitFinish();
let pm = Services.perms;
registerCleanupFunction(function() {
pm.remove(makeURI(notificationURL), "desktop-notification");
gBrowser.removeTab(tab);
window.restore();
});
pm.add(makeURI(notificationURL), "desktop-notification", pm.ALLOW_ACTION);
tab = gBrowser.addTab(notificationURL);
gBrowser.selectedTab = tab;
tab.linkedBrowser.addEventListener("load", onLoad, true);
}
function onLoad() {
tab.linkedBrowser.removeEventListener("load", onLoad, true);
let win = tab.linkedBrowser.contentWindow.wrappedJSObject;
notification = win.showNotification2();
notification.addEventListener("show", onAlertShowing);
}
function onAlertShowing() {
info("Notification alert showing");
notification.removeEventListener("show", onAlertShowing);
let alertWindow = Services.wm.getMostRecentWindow("alert:alert");
if (!alertWindow) {
ok(true, "Notifications don't use XUL windows on all platforms.");
notification.close();
finish();
return;
}
ok(Services.perms.testExactPermission(makeURI(notificationURL), "desktop-notification"),
"Permission should exist prior to removal");
let disableForOriginMenuItem = alertWindow.document.getElementById("disableForOriginMenuItem");
is(disableForOriginMenuItem.localName, "menuitem", "menuitem found");
Services.obs.addObserver(permObserver, "perm-changed", false);
alertWindow.addEventListener("beforeunload", onAlertClosing);
disableForOriginMenuItem.click();
info("Clicked on disable-for-origin menuitem")
}
function permObserver(subject, topic, data) {
if (topic != "perm-changed") {
return;
}
let permission = subject.QueryInterface(Ci.nsIPermission);
is(permission.type, "desktop-notification", "desktop-notification permission changed");
is(data, "deleted", "desktop-notification permission deleted");
Services.obs.removeObserver(permObserver, "perm-changed");
permRemoved = true;
if (alertWindowClosed) {
finish();
}
}
function onAlertClosing(event) {
event.target.removeEventListener("beforeunload", onAlertClosing);
alertWindowClosed = true;
if (permRemoved) {
finish();
}
}

View File

@ -60,7 +60,7 @@ function onAlertShowing() {
let alertWindow = Services.wm.getMostRecentWindow("alert:alert");
if (!alertWindow) {
todo(false, "Notifications don't use XUL windows on all platforms.");
ok(true, "Notifications don't use XUL windows on all platforms.");
notification.close();
newWindowOpenedFromTab.close();
finish();

View File

@ -749,6 +749,18 @@
@RESPATH@/res/table-remove-row-active.gif
@RESPATH@/res/table-remove-row-hover.gif
@RESPATH@/res/table-remove-row.gif
@RESPATH@/res/accessiblecaret.png
@RESPATH@/res/accessiblecaret@1.5x.png
@RESPATH@/res/accessiblecaret@2.25x.png
@RESPATH@/res/accessiblecaret@2x.png
@RESPATH@/res/accessiblecaret_tilt_left.png
@RESPATH@/res/accessiblecaret_tilt_left@1.5x.png
@RESPATH@/res/accessiblecaret_tilt_left@2.25x.png
@RESPATH@/res/accessiblecaret_tilt_left@2x.png
@RESPATH@/res/accessiblecaret_tilt_right.png
@RESPATH@/res/accessiblecaret_tilt_right@1.5x.png
@RESPATH@/res/accessiblecaret_tilt_right@2.25x.png
@RESPATH@/res/accessiblecaret_tilt_right@2x.png
@RESPATH@/res/text_caret.png
@RESPATH@/res/text_caret@1.5x.png
@RESPATH@/res/text_caret@2.25x.png

View File

@ -218,8 +218,6 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY urlbar.toggleAutocomplete.label "Toggle the autocomplete popup">
<!ENTITY locationItem.title "Location">
<!ENTITY searchItem.title "Search">
<!-- Toolbar items -->

View File

@ -125,3 +125,8 @@
shown in the inspector contextual-menu for the item that lets users take
a screenshot of the currently selected node. -->
<!ENTITY inspectorScreenshotNode.label "Screenshot Node">
<!-- LOCALIZATION NOTE (inspectorDuplicateNode.label): This is the label
shown in the inspector contextual-menu for the item that lets users
duplicate the currently selected node. -->
<!ENTITY inspectorDuplicateNode.label "Duplicate Node">

View File

@ -893,7 +893,7 @@ toolbar .toolbarbutton-1:-moz-any(@primaryToolbarButtons@) > :-moz-any(.toolbarb
transition: opacity 0.15s ease;
}
#navigator-toolbox:not(:hover) .urlbar-history-dropmarker {
#navigator-toolbox:not(:hover) #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
opacity: 0;
}

View File

@ -4,7 +4,7 @@
%filter substitution
%define toolbarHighlight rgba(255,255,255,.3)
%define toolbarHighlight rgba(255,255,255,.4)
%define fgTabTexture linear-gradient(transparent 2px, @toolbarHighlight@ 2px, @toolbarHighlight@)
%define fgTabTextureLWT @fgTabTexture@
%define fgTabBackgroundColor -moz-dialog

View File

@ -1697,7 +1697,7 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-button {
transition: opacity 0.15s ease;
}
#navigator-toolbox:not(:hover) .urlbar-history-dropmarker {
#navigator-toolbox:not(:hover) #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
opacity: 0;
}

View File

@ -1410,7 +1410,7 @@ html|*.urlbar-input:-moz-lwtheme::-moz-placeholder,
transition: opacity 0.15s ease;
}
#navigator-toolbox:not(:hover) .urlbar-history-dropmarker {
#navigator-toolbox:not(:hover) #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
opacity: 0;
}

View File

@ -4,7 +4,7 @@
%filter substitution
%define toolbarHighlight rgba(255,255,255,.3)
%define toolbarHighlight rgba(255,255,255,.4)
%define fgTabTexture linear-gradient(transparent 2px, @toolbarHighlight@ 2px, @toolbarHighlight@)
%define fgTabBackgroundColor -moz-dialog
%define fgTabTextureLWT @fgTabTexture@

View File

@ -99,13 +99,7 @@ if test -n "$USE_ICU"; then
MOZ_ICU_DBG_SUFFIX=d
fi
;;
Android)
if test -z "$gonkdir"; then
AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
fi
ICU_LIB_NAMES="icui18n icuuc icudata"
;;
Darwin|Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD|SunOS)
Darwin|Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD|SunOS|Android)
ICU_LIB_NAMES="icui18n icuuc icudata"
;;
*)
@ -279,6 +273,8 @@ if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
if test -n "$gonkdir"; then
ICU_CXXFLAGS="-I$gonkdir/abi/cpp/include $ICU_CXXFLAGS"
elif test "$OS_TARGET" = Android -a "$MOZ_ANDROID_CXX_STL" = mozstlport; then
ICU_CXXFLAGS="-I$_topsrcdir/build/gabi++/include $ICU_CXXFLAGS"
fi
if test -z "$MOZ_SHARED_ICU"; then

55
build/gabi++/Android.mk Normal file
View File

@ -0,0 +1,55 @@
LOCAL_PATH:= $(call my-dir)
libgabi++_cflags := \
-I$(LOCAL_PATH)/include
libgabi++_common_src_files := \
src/array_type_info.cc \
src/class_type_info.cc \
src/delete.cc \
src/dynamic_cast.cc \
src/enum_type_info.cc \
src/function_type_info.cc \
src/new.cc \
src/pbase_type_info.cc \
src/pointer_type_info.cc \
src/pointer_to_member_type_info.cc \
src/si_class_type_info.cc \
src/type_info.cc \
src/vmi_class_type_info.cc
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES:= $(libgabi++_common_src_files)
LOCAL_MODULE:= libgabi++
LOCAL_CFLAGS := $(libgabi++_cflags)
LOCAL_RTTI_FLAG := -frtti
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES:= $(libgabi++_common_src_files)
LOCAL_MODULE:= libgabi++
LOCAL_CFLAGS := $(libgabi++_cflags)
LOCAL_RTTI_FLAG := -frtti
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
include $(BUILD_STATIC_LIBRARY)

View File

@ -0,0 +1 @@
This copy of libgabi++ is from Android 5.0 source code on https://android.googlesource.com/platform/abi/cpp/. Tag is android-5.0.0_r1.

View File

@ -0,0 +1,183 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
#ifndef __GABIXX_CXXABI_H__
#define __GABIXX_CXXABI_H__
#include <typeinfo>
namespace __cxxabiv1
{
extern "C" void __cxa_pure_virtual();
// Derived types of type_info below are based on 2.9.5 of C++ ABI.
// Typeinfo for fundamental types.
class __fundamental_type_info : public std::type_info
{
public:
~__fundamental_type_info();
};
// Typeinfo for array types.
class __array_type_info : public std::type_info
{
public:
~__array_type_info();
};
// Typeinfo for function types.
class __function_type_info : public std::type_info
{
public:
~__function_type_info();
};
// Typeinfo for enum types.
class __enum_type_info : public std::type_info
{
public:
~__enum_type_info();
};
// Typeinfo for classes with no bases.
class __class_type_info : public std::type_info
{
public:
~__class_type_info();
enum class_type_info_code
{
CLASS_TYPE_INFO_CODE,
SI_CLASS_TYPE_INFO_CODE,
VMI_CLASS_TYPE_INFO_CODE
};
virtual class_type_info_code
code() const { return CLASS_TYPE_INFO_CODE; }
};
// Typeinfo for classes containing only a single, public, non-virtual base at
// offset zero.
class __si_class_type_info : public __class_type_info
{
public:
~__si_class_type_info();
const __class_type_info *__base_type;
virtual __class_type_info::class_type_info_code
code() const { return SI_CLASS_TYPE_INFO_CODE; }
};
struct __base_class_type_info
{
public:
const __class_type_info *__base_type;
// All but the lower __offset_shift bits of __offset_flags are a signed
// offset. For a non-virtual base, this is the offset in the object of the
// base subobject. For a virtual base, this is the offset in the virtual
// table of the virtual base offset for the virtual base referenced
// (negative).
long __offset_flags;
enum __offset_flags_masks
{
__virtual_mask = 0x1,
__public_mask = 0x2,
__offset_shift = 8
};
bool inline
is_virtual() const { return (__offset_flags & __virtual_mask) != 0; }
bool inline
is_public() const { return (__offset_flags & __public_mask) != 0; }
// FIXME: Right-shift of signed integer is implementation dependent.
long inline
offset() const { return __offset_flags >> __offset_shift; }
long inline
flags() const { return __offset_flags & ((1L << __offset_shift) - 1); }
};
// Typeinfo for classes with bases that do not satisfy the
// __si_class_type_info constraints.
class __vmi_class_type_info : public __class_type_info
{
public:
~__vmi_class_type_info();
unsigned int __flags;
unsigned int __base_count;
__base_class_type_info __base_info[1];
enum __flags_masks
{
__non_diamond_repeat_mask = 0x1,
__diamond_shaped_mask = 0x2
};
virtual __class_type_info::class_type_info_code
code() const { return VMI_CLASS_TYPE_INFO_CODE; }
};
class __pbase_type_info : public std::type_info
{
public:
~__pbase_type_info();
unsigned int __flags;
const std::type_info *__pointee;
enum __masks
{
__const_mask = 0x1,
__volatile_mask = 0x2,
__restrict_mask = 0x4,
__incomplete_mask = 0x8,
__incomplete_class_mask = 0x10
};
};
class __pointer_type_info : public __pbase_type_info
{
public:
~__pointer_type_info();
};
class __pointer_to_member_type_info : public __pbase_type_info
{
public:
~__pointer_to_member_type_info();
};
}
namespace abi = __cxxabiv1;
#endif /* defined(__GABIXX_CXXABI_H__) */

56
build/gabi++/include/new Normal file
View File

@ -0,0 +1,56 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// new: Dynamic storage management.
#ifndef __GABIXX_NEW__
#define __GABIXX_NEW__
#include <cstddef>
namespace std
{
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
}
// FIXME: Need to handle exceptions.
void* operator new(std::size_t size) throw(/*std::bad_alloc*/);
void* operator new(std::size_t size, const std::nothrow_t&) throw();
void operator delete(void* ptr) throw();
void operator delete(void*, const std::nothrow_t&) throw();
void* operator new[](std::size_t size) throw(/*std::bad_alloc*/);
void* operator new[](std::size_t size, const std::nothrow_t&) throw();
void operator delete[](void* ptr) throw();
void operator delete[](void* const, std::nothrow_t&) throw();
void* operator new(std::size_t size, void* ptr) throw();
void* operator new[](std::size_t size, void* ptr) throw();
void operator delete(void* ptr, void*) throw();
void operator delete[](void* ptr, void*) throw();
#endif // __GABIXX_NEW__

View File

@ -0,0 +1,76 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// typeinfo: RTTI support header.
//
// References:
// Itanium C++ ABI at http://www.codesourcery.com/public/cxx-abi/abi.html.
// IHI0041A C++ Application Binary Interface for the ARM architecture.
// Linux Standard Base C++ Specification for S390X 4.1.
//
#ifndef __GABIXX_TYPEINFO__
#define __GABIXX_TYPEINFO__
namespace std
{
// Defintion of type_info based on example in C++ ABI section 2.9.3
class type_info
{
public:
virtual
~type_info();
// Whether two type_infos corresponds to the same types.
bool
operator==(const type_info &ti) const;
// Whether two type_infos corresponds to the different types.
bool
operator!=(const type_info &ti) const;
bool
before(const type_info &ti) const;
// Return name of type.
const char*
name() const { return __type_name; }
private:
// Assignment of type_info is not allowed.
type_info (const type_info& rhs);
type_info&
operator=(const type_info& rhs);
// Mangled name of type.
const char *__type_name;
};
} // namespace std
#endif // _GABIXX_TYPEINFO_

36
build/gabi++/moz.build Normal file
View File

@ -0,0 +1,36 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Library('gabi++')
SOURCES += [
'src/array_type_info.cc',
'src/class_type_info.cc',
'src/delete.cc',
'src/dynamic_cast.cc',
'src/enum_type_info.cc',
'src/function_type_info.cc',
'src/fundamental_type_info.cc',
'src/new.cc',
'src/pbase_type_info.cc',
'src/pointer_to_member_type_info.cc',
'src/pointer_type_info.cc',
'src/si_class_type_info.cc',
'src/type_info.cc',
'src/vmi_class_type_info.cc',
]
LOCAL_INCLUDES += [
'include'
]
DISABLE_STL_WRAPPING = True
NO_VISIBILITY_FLAGS = True
CXXFLAGS += [
'-fexceptions',
'-frtti'
]

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// fundamental_type_info.cc: Methods for __fundamental_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__fundamental_type_info::~__fundamental_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// class_type_info.cc: Methods for __class_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__class_type_info::~__class_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,38 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// delete.cc: delete operator
#include <stdlib.h>
#include <new>
void
operator delete(void* ptr) throw()
{
if (ptr)
free(ptr);
}

View File

@ -0,0 +1,356 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// dynamic_cast.cc: RTTI support.
//
// References:
// Itanium C++ ABI at http://www.codesourcery.com/public/cxx-abi/abi.html
// IHI0041A C++ Application Binary Interface for the ARM architecture.
//
#include <cxxabi.h>
#include <cstddef>
#include <cassert>
namespace
{
// Adjust a pointer by an offset.
const void*
adjust_pointer(const void* p, std::ptrdiff_t off)
{
// FIXME: should we align pointer after adjustment?
const char *cp = reinterpret_cast<const char*>(p) + off;
return reinterpret_cast<const void*>(cp);
}
// Return the vtable pointer of a polymorphic object pointed by p.
inline const void*
get_vtable(const void* p)
{
return *reinterpret_cast<void*const*>(p);
}
// Return a pointer to a __class_type_info in a vtable.
inline const abi::__class_type_info*
get_class_type_info(const void* vtable)
{
const void* type_info_ptr = adjust_pointer(vtable, -sizeof(void*));
return *reinterpret_cast<abi::__class_type_info*const*>(type_info_ptr);
}
// Return offset to object in a vtable.
inline std::ptrdiff_t
get_offset_to_top(const void* vtable)
{
const void* type_info_ptr_address = adjust_pointer(vtable, -sizeof(void*));
const void* offset_to_top_address =
adjust_pointer(type_info_ptr_address, -sizeof(std::ptrdiff_t));
return *reinterpret_cast<const std::ptrdiff_t*>(offset_to_top_address);
}
// Return the virtual pointer to the most derived object of referred by a
// pointer p.
const void*
get_most_derived_object(const void* p)
{
const void* vtable = get_vtable(p);
std::ptrdiff_t offset_to_top = get_offset_to_top(vtable);
return adjust_pointer(p, offset_to_top);
}
// We assume that -1 cannot be a valid pointer to object.
const void * const ambiguous_object =
reinterpret_cast<const void*>(-1);
// Return a pointer to the subobject described by base_info.
const void*
get_subobject(const void* object,
const void* vtable,
const abi::__base_class_type_info* base_info)
{
long offset = base_info->offset();
if (base_info->is_virtual())
{
const std::ptrdiff_t* virtual_base_offset_address =
static_cast<const std::ptrdiff_t*> (adjust_pointer(vtable, offset));
offset = *virtual_base_offset_address;
}
return adjust_pointer(object, offset);
}
// Helper of __dyanmic_cast to walk the type tree of an object.
const void *
walk_object(const void *object,
const abi::__class_type_info *type,
const void *match_object,
const abi::__class_type_info *match_type)
{
if (*type == *match_type)
return (match_object == NULL || object == match_object) ? object : NULL;
switch(type->code())
{
case abi::__class_type_info::CLASS_TYPE_INFO_CODE:
// This isn't not the class you're looking for.
return NULL;
case abi::__class_type_info::SI_CLASS_TYPE_INFO_CODE:
// derived type has a single public base at offset 0.
{
const abi::__si_class_type_info* ti =
static_cast<const abi::__si_class_type_info*>(type);
return walk_object(object, ti->__base_type, match_object,
match_type);
}
case abi::__class_type_info::VMI_CLASS_TYPE_INFO_CODE:
{
const void* vtable = get_vtable(object);
const abi::__vmi_class_type_info* ti =
static_cast<const abi::__vmi_class_type_info*>(type);
// Look at all direct bases.
const void* result = NULL;
for (unsigned i = 0; i < ti->__base_count; ++i)
{
if (!ti->__base_info[i].is_public())
continue;
const void *subobject =
get_subobject(object, vtable, &ti->__base_info[i]);
const void* walk_subobject_result =
walk_object(subobject, ti->__base_info[i].__base_type,
match_object, match_type);
if (walk_subobject_result == ambiguous_object)
return ambiguous_object;
else if (walk_subobject_result != NULL)
{
if (result == NULL)
{
result = walk_subobject_result;
}
else if (result != walk_subobject_result)
return ambiguous_object;
}
}
return result;
}
default:
assert(0);
}
return NULL;
}
// Bookkeeping structure for derived-to-base cast in the general case.
struct cast_context
{
public:
const void* object;
const abi::__class_type_info *src_type;
const abi::__class_type_info *dst_type;
std::ptrdiff_t src2dst_offset;
const void* dst_object;
const void* result;
cast_context(const void* obj, const abi::__class_type_info *src,
const abi::__class_type_info *dst, std::ptrdiff_t offset)
: object(obj), src_type(src), dst_type(dst), src2dst_offset(offset),
dst_object(NULL), result(NULL)
{ }
};
// based-to-derive cast in the general case.
void
base_to_derived_cast(const void *object,
const abi::__class_type_info *type,
cast_context* context)
{
const void* saved_dst_object = context->dst_object;
bool is_dst_type = *type == *context->dst_type;
if (is_dst_type)
context->dst_object = object;
if (object == context->object
&& context->dst_object != NULL
&& *type == *context->src_type)
{
if (context->result == NULL)
context->result = context->dst_object;
else if (context->result != context->dst_object)
context->result = ambiguous_object;
context->dst_object = saved_dst_object;
return;
}
switch(type->code())
{
case abi::__class_type_info::CLASS_TYPE_INFO_CODE:
// This isn't not the class you're looking for.
break;
case abi::__class_type_info::SI_CLASS_TYPE_INFO_CODE:
// derived type has a single public base at offset 0.
{
const abi::__si_class_type_info* ti =
static_cast<const abi::__si_class_type_info*>(type);
base_to_derived_cast(object, ti->__base_type, context);
break;
}
case abi::__class_type_info::VMI_CLASS_TYPE_INFO_CODE:
{
const void* vtable = get_vtable(object);
const abi::__vmi_class_type_info* ti =
static_cast<const abi::__vmi_class_type_info*>(type);
// Look at all direct bases.
for (unsigned i = 0; i < ti->__base_count; ++i)
{
if (!ti->__base_info[i].is_public())
continue;
const void *subobject =
get_subobject(object, vtable, &ti->__base_info[i]);
base_to_derived_cast(subobject, ti->__base_info[i].__base_type,
context);
// FIXME: Use flags in base_info to optimize search.
if (context->result == ambiguous_object)
break;
}
break;
}
default:
assert(0);
}
context->dst_object = saved_dst_object;
}
} // namespace
namespace __cxxabiv1
{
#define DYNAMIC_CAST_NO_HINT -1
#define DYNAMIC_CAST_NOT_PUBLIC_BASE -2
#define DYNAMIC_CAST_MULTIPLE_PUBLIC_NONVIRTUAL_BASE -3
/* v: source address to be adjusted; nonnull, and since the
* source object is polymorphic, *(void**)v is a virtual pointer.
* src: static type of the source object.
* dst: destination type (the "T" in "dynamic_cast<T>(v)").
* src2dst_offset: a static hint about the location of the
* source subobject with respect to the complete object;
* special negative values are:
* -1: no hint
* -2: src is not a public base of dst
* -3: src is a multiple public base type but never a
* virtual base type
* otherwise, the src type is a unique public nonvirtual
* base type of dst at offset src2dst_offset from the
* origin of dst.
*/
extern "C" void*
__dynamic_cast (const void *v,
const abi::__class_type_info *src,
const abi::__class_type_info *dst,
std::ptrdiff_t src2dst_offset)
{
const void* most_derived_object = get_most_derived_object(v);
const void* vtable = get_vtable(most_derived_object);
const abi::__class_type_info* most_derived_class_type_info =
get_class_type_info(vtable);
// If T is not a public base type of the most derived class referred
// by v, the cast always fails.
void* t_object =
const_cast<void*>(walk_object(most_derived_object,
most_derived_class_type_info, NULL, dst));
if (t_object == NULL)
return NULL;
// C++ ABI 2.9.7 The dynamic_cast Algorithm:
//
// If, in the most derived object pointed (referred) to by v, v points
// (refers) to a public base class subobject of a T object [note: this can
// be checked at compile time], and if only one object of type T is derived
// from the subobject pointed (referred) to by v, the result is a pointer
// (an lvalue referring) to that T object.
// We knew that src is not a public base, so base-to-derived cast
// is not possible. This works even if there are multiple subobjects
// of type T in the most derived object.
if (src2dst_offset != DYNAMIC_CAST_NOT_PUBLIC_BASE)
{
// If it is known that v points to a public base class subobject
// of a T object, simply adjust the pointer by the offset.
if (t_object != ambiguous_object && src2dst_offset >= 0)
return const_cast<void*>(adjust_pointer(v, -src2dst_offset));
// If there is only one T type subobject, we only need to look at
// there. Otherwise, look for the subobject referred by v in the
// most derived object.
cast_context context(v, src, dst, src2dst_offset);
if (t_object != ambiguous_object)
base_to_derived_cast(t_object, dst, &context);
else
base_to_derived_cast(most_derived_object,
most_derived_class_type_info, &context);
if (context.result != NULL && context.result != ambiguous_object)
return const_cast<void*>(context.result);
}
// C++ ABI 2.9.7 The dynamic_cast Algorithm:
//
// Otherwise, if v points (refers) to a public base class subobject of the
// most derived object, and the type of the most derived object has an
// unambiguous public base class of type T, the result is a pointer (an
// lvalue referring) to the T subobject of the most derived object.
// Otherwise, the run-time check fails.
// Check to see if T is a unambiguous public base class.
if (t_object == ambiguous_object)
return NULL;
// See if v refers to a public base class subobject.
const void* v_object =
walk_object(most_derived_object, most_derived_class_type_info, v, src);
return v_object == v ? t_object : NULL;
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// enum_type_info.cc: Methods for __enum_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__enum_type_info::~__enum_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// function_type_info.cc: Methods for __function_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__function_type_info::~__function_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// array_type_info.cc: Methods for __array_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__array_type_info::~__array_type_info()
{
}
} // namespace __cxxabiv1

42
build/gabi++/src/new.cc Normal file
View File

@ -0,0 +1,42 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
#include <stdlib.h>
#include <new>
// FIXME: need to handle exceptions
void*
operator new(std::size_t size) throw (/*std::bad_alloc*/)
{
void* ptr = malloc(size);
#if 0
if (ptr == NULL)
throw std::bad_alloc();
#endif
return ptr;
}

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// pbase_type_info.cc: Methods for __pbase_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__pbase_type_info::~__pbase_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// pointer_to_member_type_info.cc: Methods for __pointer_to_member_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__pointer_to_member_type_info::~__pointer_to_member_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// pointer_type_info.cc: Methods for __pointer_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__pointer_type_info::~__pointer_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// si_class_type_info.cc: Methods for __si_class_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__si_class_type_info::~__si_class_type_info()
{
}
} // namespace __cxxabiv1

View File

@ -0,0 +1,75 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// type_info.cc: Methods for std::type_info.
//
#include <cxxabi.h>
#ifdef __ARM_EABI__
// ARM EABI requires string comprison for mangled type names for type_info
// equality.
#include <string.h>
#endif
#include <typeinfo>
namespace std
{
type_info::~type_info()
{
}
bool
type_info::operator==(const type_info& rhs) const
{
#ifdef __ARM_EABI__
// IHI0041A CPPABI 3.2.5.6. Because of weak linkage and share libraries,
// we perform string comparison.
return strcmp(this->__type_name, rhs.__type_name) == 0;
#else
return this == &rhs;
#endif
}
bool
type_info::operator!=(const type_info& rhs) const
{
return !this->operator==(rhs);
}
bool
type_info::before(const type_info& rhs) const
{
#ifdef __ARM_EABI__
// IHI0041A CPPABI 3.2.5.6. Because of weak linkage and share libraries,
// we perform string comparison.
return strcmp(this->__type_name, rhs.__type_name) < 0;
#else
return this < &rhs;
#endif
}
} // end namespace std

View File

@ -0,0 +1,37 @@
// Copyright (C) 2011 The Android Open Source Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//
// vmi_class_type_info.cc: Methods for __vmi_class_type_info.
#include <cxxabi.h>
namespace __cxxabiv1
{
__vmi_class_type_info::~__vmi_class_type_info()
{
}
} // namespace __cxxabiv1

8
build/gabi++/use_rtti.mk Normal file
View File

@ -0,0 +1,8 @@
# To use RTTI, "include abi/cpp/use_rtti.mk" in your target.
LOCAL_C_INCLUDES := \
abi/cpp/include \
$(LOCAL_C_INCLUDES)
LOCAL_RTTI_FLAG := -frtti
LOCAL_SHARED_LIBRARIES += libgabi++

View File

@ -17,6 +17,8 @@ else:
if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_ANDROID_CXX_STL'] == 'mozstlport':
DIRS += ['stlport']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android' and CONFIG['ENABLE_INTL_API']:
DIRS += ['gabi++']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
DIRS += ['annotationProcessors']

View File

@ -21,3 +21,7 @@ else:
OS_LIBS += [
'gabi++',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android' and CONFIG['MOZ_ANDROID_CXX_STL'] == 'mozstlport':
USE_LIBS += [
'gabi++'
]

View File

@ -9110,12 +9110,10 @@ dnl ========================================================
dnl ICU Support
dnl ========================================================
# Internationalization isn't built or exposed by default in non-desktop
# builds. Bugs to enable:
#
# Android: bug 864843
# Internationalization is not built or exposed on Fennec.
# See Bug 1215256
if test "$MOZ_WIDGET_TOOLKIT" = "android"; then
if test "$MOZ_BUILD_APP" = "mobile/android"; then
_INTL_API=no
else
_INTL_API=yes

View File

@ -654,6 +654,9 @@ InspectorPanel.prototype = {
!this.selection.isPseudoElementNode();
let isEditableElement = isSelectionElement &&
!this.selection.isAnonymousNode();
let isDuplicatableElement = isSelectionElement &&
!this.selection.isAnonymousNode() &&
!this.selection.isRoot();
let isScreenshotable = isSelectionElement &&
this.canGetUniqueSelector &&
this.selection.nodeFront.isTreeDisplayed;
@ -683,6 +686,7 @@ InspectorPanel.prototype = {
// "Copy outer HTML", "Scroll Into View" & "Screenshot Node" as appropriate
let unique = this.panelDoc.getElementById("node-menu-copyuniqueselector");
let screenshot = this.panelDoc.getElementById("node-menu-screenshotnode");
let duplicateNode = this.panelDoc.getElementById("node-menu-duplicatenode");
let copyInnerHTML = this.panelDoc.getElementById("node-menu-copyinner");
let copyOuterHTML = this.panelDoc.getElementById("node-menu-copyouter");
let scrollIntoView = this.panelDoc.getElementById("node-menu-scrollnodeintoview");
@ -700,10 +704,20 @@ InspectorPanel.prototype = {
expandAll.removeAttribute("disabled");
}
this._target.actorHasMethod("domwalker", "duplicateNode").then(value => {
duplicateNode.hidden = !value;
});
this._target.actorHasMethod("domnode", "scrollIntoView").then(value => {
scrollIntoView.hidden = !value;
});
if (isDuplicatableElement) {
duplicateNode.removeAttribute("disabled");
}
else {
duplicateNode.setAttribute("disabled", "true");
}
if (isSelectionElement) {
unique.removeAttribute("disabled");
copyInnerHTML.removeAttribute("disabled");
@ -1177,6 +1191,20 @@ InspectorPanel.prototype = {
this.selection.nodeFront.scrollIntoView();
},
/**
* Duplicate the selected node
*/
duplicateNode: function() {
let selection = this.selection;
if (!selection.isElementNode() ||
selection.isRoot() ||
selection.isAnonymousNode() ||
selection.isPseudoElementNode()) {
return;
}
this.walker.duplicateNode(selection.nodeFront).catch(e => console.error(e));
},
/**
* Delete the selected node.
*/

View File

@ -103,6 +103,9 @@
<menuitem id="node-menu-screenshotnode"
label="&inspectorScreenshotNode.label;"
oncommand="inspector.screenshotNode()" />
<menuitem id="node-menu-duplicatenode"
label="&inspectorDuplicateNode.label;"
oncommand="inspector.duplicateNode()"/>
<menuitem id="node-menu-delete"
label="&inspectorHTMLDelete.label;"
accesskey="&inspectorHTMLDelete.accesskey;"

View File

@ -4,17 +4,14 @@ http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests for menuitem functionality that doesn't fit into any specific category
const TEST_URL = TEST_URL_ROOT + "doc_inspector_menu.html";
add_task(function* () {
let { inspector, toolbox, testActor } = yield openInspectorForURL(TEST_URL);
yield testShowDOMProperties();
yield testDuplicateNode();
yield testDeleteNode();
yield testDeleteRootNode();
yield testScrollIntoView();
function* testShowDOMProperties() {
info("Testing 'Show DOM Properties' menu item.");
let showDOMPropertiesNode = inspector.panelDoc.getElementById("node-menu-showdomproperties");
@ -29,20 +26,38 @@ add_task(function* () {
let webconsoleUI = toolbox.getPanel("webconsole").hud.ui;
let messagesAdded = webconsoleUI.once("new-messages");
yield messagesAdded;
info("Checking if 'inspect($0)' was evaluated");
ok(webconsoleUI.jsterm.history[0] === 'inspect($0)');
yield toolbox.toggleSplitConsole();
}
function* testDuplicateNode() {
info("Testing 'Duplicate Node' menu item for normal elements.");
yield selectNode(".duplicate", inspector);
is((yield testActor.getNumberOfElementMatches(".duplicate")), 1,
"There should initially be 1 .duplicate node");
let menuItem = inspector.panelDoc.getElementById("node-menu-duplicatenode");
ok(menuItem, "'Duplicate node' menu item should exist");
info("Triggering 'Duplicate Node' and waiting for inspector to update");
let updated = inspector.once("markupmutation");
dispatchCommandEvent(menuItem);
yield updated;
is((yield testActor.getNumberOfElementMatches(".duplicate")), 2,
"The duplicated node should be in the markup.");
let container = yield getContainerForSelector(".duplicate + .duplicate",
inspector);
ok(container, "A MarkupContainer should be created for the new node");
}
function* testDeleteNode() {
info("Testing 'Delete Node' menu item for normal elements.");
yield selectNode("#delete", inspector);
let deleteNode = inspector.panelDoc.getElementById("node-menu-delete");
ok(deleteNode, "the popup menu has a delete menu item");
let updated = inspector.once("inspector-updated");
info("Triggering 'Delete Node' and waiting for inspector to update");

View File

@ -15,6 +15,7 @@
</div>
<p data-id="copy">Paragraph for testing copy</p>
<p id="sensitivity">Paragraph for sensitivity</p>
<p class="duplicate">This will be duplicated</p>
<p id="delete">This has to be deleted</p>
<img id="copyimage" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVQYV2P4DwABAQEAWk1v8QAAAABJRU5ErkJggg==" />
<div id="hiddenElement" style="display: none;">

View File

@ -224,14 +224,14 @@ devtools.jar:
skin/themes/images/breadcrumbs-scrollbutton@2x.png (themes/images/breadcrumbs-scrollbutton@2x.png)
skin/themes/animationinspector.css (themes/animationinspector.css)
skin/themes/eyedropper.css (themes/eyedropper.css)
* skin/themes/canvasdebugger.css (themes/canvasdebugger.css)
skin/themes/canvasdebugger.css (themes/canvasdebugger.css)
skin/themes/debugger.css (themes/debugger.css)
* skin/themes/netmonitor.css (themes/netmonitor.css)
skin/themes/performance.css (themes/performance.css)
skin/themes/memory.css (themes/memory.css)
skin/themes/promisedebugger.css (themes/promisedebugger.css)
skin/themes/images/timeline-filter.svg (themes/images/timeline-filter.svg)
* skin/themes/scratchpad.css (themes/scratchpad.css)
skin/themes/scratchpad.css (themes/scratchpad.css)
skin/themes/shadereditor.css (themes/shadereditor.css)
skin/themes/storage.css (themes/storage.css)
* skin/themes/splitview.css (themes/splitview.css)

View File

@ -82,6 +82,21 @@ var TestActor = exports.TestActor = protocol.ActorClass({
}
return node;
},
/**
* Helper to get the number of elements matching a selector
* @param {string} CSS selector.
*/
getNumberOfElementMatches: protocol.method(function (selector,
root=this.content.document) {
return root.querySelectorAll(selector).length;
}, {
request: {
selector: Arg(0, "string"),
},
response: {
value: RetVal("number")
}
}),
/**
* Get a value for a given attribute name, on one of the elements of the box

View File

@ -2,14 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
%filter substitution
%define darkCheckerboardBackground #000
%define lightCheckerboardBackground #fff
%define checkerboardCell rgba(128,128,128,0.2)
%define checkerboardPattern linear-gradient(45deg, @checkerboardCell@ 25%, transparent 25%, transparent 75%, @checkerboardCell@ 75%, @checkerboardCell@), linear-gradient(45deg, @checkerboardCell@ 25%, transparent 25%, transparent 75%, @checkerboardCell@ 75%, @checkerboardCell@)
%define gutterWidth 3em
%define gutterPaddingStart 22px
:root {
--gutter-width: 3em;
--gutter-padding-start: 22px;
--checkerboard-pattern: linear-gradient(45deg, rgba(128,128,128,0.2) 25%, transparent 25%, transparent 75%, rgba(128,128,128,0.2) 75%, rgba(128,128,128,0.2)),
linear-gradient(45deg, rgba(128,128,128,0.2) 25%, transparent 25%, transparent 75%, rgba(128,128,128,0.2) 75%, rgba(128,128,128,0.2));
}
/* Reload and waiting notices */
.notice-container {
@ -35,22 +33,9 @@
/* Snapshots pane */
#snapshots-pane > tabs {
-moz-border-end: 1px solid;
}
#snapshots-pane > tabs,
#snapshots-pane .devtools-toolbar {
-moz-border-end: 1px solid;
}
.theme-dark #snapshots-pane > tabs,
.theme-dark #snapshots-pane .devtools-toolbar {
-moz-border-end-color: black; /* Match the splitter color. */
}
.theme-light #snapshots-pane > tabs,
.theme-light #snapshots-pane .devtools-toolbar {
-moz-border-end-color: #aaa; /* Match the splitter color. */
-moz-border-end: 1px solid var(--theme-splitter-color);
}
#record-snapshot {
@ -65,7 +50,7 @@
.snapshot-item-thumbnail {
image-rendering: -moz-crisp-edges;
background-image: @checkerboardPattern@;
background-image: var(--checkerboard-pattern);
background-size: 12px 12px, 12px 12px;
background-position: 0px 0px, 6px 6px;
background-repeat: repeat, repeat;
@ -75,12 +60,8 @@
transform: scaleY(-1);
}
.theme-dark .snapshot-item-thumbnail {
background-color: @darkCheckerboardBackground@;
}
.theme-light .snapshot-item-thumbnail {
background-color: @lightCheckerboardBackground@;
.snapshot-item-thumbnail {
background-color: var(--theme-body-background);
}
.snapshot-item-details {
@ -234,9 +215,9 @@
}
.call-item-gutter {
width: calc(@gutterWidth@ + @gutterPaddingStart@);
-moz-padding-start: @gutterPaddingStart@;
-moz-padding-end: 4px;
width: calc(var(--gutter-width) + var(--gutter-padding-start));
padding-inline-start: var(--gutter-padding-start);
padding-inline-end: 4px;
padding-top: 2px;
padding-bottom: 2px;
-moz-border-end: 1px solid;
@ -300,7 +281,7 @@
}
.call-item-stack {
-moz-padding-start: calc(@gutterWidth@ + @gutterPaddingStart@);
-moz-padding-start: calc(var(--gutter-width) + var(--gutter-padding-start));
padding-bottom: 10px;
}
@ -345,20 +326,13 @@
/* Rendering preview */
#screenshot-container {
background-image: @checkerboardPattern@;
background-color: var(--theme-body-background);
background-image: var(--checkerboard-pattern);
background-size: 30px 30px, 30px 30px;
background-position: 0px 0px, 15px 15px;
background-repeat: repeat, repeat;
}
.theme-dark #screenshot-container {
background-color: @darkCheckerboardBackground@;
}
.theme-light #screenshot-container {
background-color: @lightCheckerboardBackground@;
}
@media (min-width: 701px) {
#screenshot-container {
width: 30vw;
@ -403,22 +377,22 @@
/* Snapshot filmstrip */
#snapshot-filmstrip {
border-top: 1px solid var(--theme-splitter-color);
overflow: hidden;
}
.theme-dark #snapshot-filmstrip {
border-top: 1px solid #000;
color: var(--theme-selection-color);
}
.theme-light #snapshot-filmstrip {
border-top: 1px solid #aaa;
color: var(--theme-body-color-alt);
}
.filmstrip-thumbnail {
image-rendering: -moz-crisp-edges;
background-image: @checkerboardPattern@;
background-color: var(--theme-body-background);
background-image: var(--checkerboard-pattern);
background-size: 12px 12px, 12px 12px;
background-position: 0px -1px, 6px 5px;
background-repeat: repeat, repeat;
@ -426,6 +400,7 @@
cursor: pointer;
padding-top: 1px;
padding-bottom: 1px;
border-inline-end: 1px solid var(--theme-splitter-color);
transition: opacity 0.1s ease-in-out;
}
@ -433,18 +408,6 @@
transform: scaleY(-1);
}
.theme-dark .filmstrip-thumbnail {
background-color: @darkCheckerboardBackground@;
}
.theme-light .filmstrip-thumbnail {
background-color: @lightCheckerboardBackground@;
}
.filmstrip-thumbnail {
-moz-border-end: 1px solid var(--theme-splitter-color)
}
#snapshot-filmstrip > .filmstrip-thumbnail:hover,
#snapshot-filmstrip:not(:hover) > .filmstrip-thumbnail[highlighted] {
border: 1px solid var(--theme-highlight-blue);

View File

@ -1,8 +1,6 @@
%if 0
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
#scratchpad-sidebar > tabs {
height: 0;

View File

@ -67,14 +67,7 @@
.stylesheet-sidebar {
max-width: 400px;
min-width: 100px;
}
.theme-light .stylesheet-sidebar {
border-color: #aaa; /* Splitters */
}
.theme-dark .stylesheet-sidebar {
border-color: #000; /* Splitters */
border-color: var(--theme-splitter-color);
}
.theme-light .media-rule-label {

View File

@ -563,47 +563,21 @@
}
.devtools-sidebar-tabs tabs > tab:first-child {
-moz-border-start-width: 0;
border-inline-start-width: 0;
}
.theme-dark .devtools-sidebar-tabs tabs > tab:hover {
background: hsla(206,37%,4%,.2);
.devtools-sidebar-tabs tabs > tab:hover {
background: rgba(0, 0, 0, 0.12);
}
.theme-dark .devtools-sidebar-tabs tabs > tab:hover:active {
background: hsla(206,37%,4%,.4);
.devtools-sidebar-tabs tabs > tab:hover:active {
background: rgba(0, 0, 0, 0.2);
}
.theme-dark .devtools-sidebar-tabs tabs > tab[selected] + tab:hover {
background: hsla(206,37%,4%,.2);
}
.theme-dark .devtools-sidebar-tabs tabs > tab[selected] + tab:hover:active {
background: hsla(206,37%,4%,.4);
}
.theme-dark .devtools-sidebar-tabs tabs > tab[selected],
.theme-dark .devtools-sidebar-tabs tabs > tab[selected]:hover:active {
.devtools-sidebar-tabs tabs > tab[selected],
.devtools-sidebar-tabs tabs > tab[selected]:hover:active {
color: var(--theme-selection-color);
background: #1d4f73;
}
.theme-light .devtools-sidebar-tabs tabs > tab:hover {
background: #ddd;
}
.theme-light .devtools-sidebar-tabs tabs > tab:hover:active {
background: #ddd;
}
.theme-light .devtools-sidebar-tabs tabs > tab[selected] + tab:hover {
background: #ddd;
}
.theme-light .devtools-sidebar-tabs tabs > tab[selected],
.theme-light .devtools-sidebar-tabs tabs > tab[selected]:hover:active {
color: var(--theme-selection-color);
background: #4c9ed9;
background: var(--theme-selection-background);
}
/* Toolbox - moved from toolbox.css.

View File

@ -30,10 +30,10 @@ svg {
}
.theme-dark .edgePath path {
stroke: #b6babf; /* Grey foreground text */
stroke: var(--theme-body-color-alt);
}
.theme-light .edgePath path {
stroke: #aaaaaa; /* Splitters */
stroke: var(--theme-splitter-color);
}
/* AudioParam connection edges */
@ -42,27 +42,21 @@ g.edgePath.param-connection {
}
.theme-dark .edgePath.param-connection path {
stroke: #b6babf; /* Grey foreground text */
stroke: var(--theme-body-color-alt);
}
.theme-light .edgePath.param-connection path {
stroke: #aaaaaa; /* Splitters */
stroke: var(--theme-splitter-color);
}
/* Labels in AudioParam connection should have background that match
* the main background so there's whitespace around the label, on top of the
* dotted lines. */
.theme-dark g.edgeLabel rect {
fill: #14171a;
g.edgeLabel rect {
fill: var(--theme-body-background);
}
.theme-light g.edgeLabel rect {
fill: #fcfcfc; /* Background - Editor */
}
.theme-dark g.edgeLabel tspan {
g.edgeLabel tspan {
fill: var(--theme-body-color-alt);
}
.theme-light g.edgeLabel tspan {
fill: #585959; /* Grey foreground text */
}
/* Audio Nodes */
.nodes rect {
@ -219,11 +213,8 @@ text {
background-color: transparent;
}
.theme-dark #audio-node-toolbar toolbarbutton[checked] {
background-color: #1d4f73; /* Select Highlight Blue */
}
.theme-light #audio-node-toolbar toolbarbutton[checked] {
background-color: #4c9ed9; /* Select Highlight Blue */
#audio-node-toolbar toolbarbutton[checked] {
background-color: var(--theme-selection-background);
}
/* don't invert checked buttons so we can have white icons on light theme */

View File

@ -26,7 +26,7 @@ a {
.message > .prefix,
.message > .timestamp {
flex: none;
color: GrayText;
color: var(--theme-comment);
margin: 3px 6px 0 0;
}
@ -131,11 +131,6 @@ a {
margin-top: 0;
}
.jsterm-input-container {
border-top-width: 1px;
border-top-style: solid;
}
#output-wrapper {
direction: ltr;
overflow: auto;
@ -253,11 +248,11 @@ a {
}
.message[category=network].mixed-content .url {
color: #FF0000;
color: var(--theme-highlight-red);
}
.message .learn-more-link {
color: -moz-nativehyperlinktext;
color: var(--theme-highlight-blue);
margin: 0 6px;
}
@ -360,6 +355,18 @@ a {
}
/* JSTerm Styles */
.jsterm-input-container {
background-color: var(--theme-tab-toolbar-background);
border-top: 1px solid var(--theme-splitter-color);
}
.theme-light .jsterm-input-container {
/* For light theme use a white background for the input - it looks better
than off-white */
background-color: #fff;
border-top-color: #e0e0e0;
}
.jsterm-input-node,
.jsterm-complete-node {
border: none;
@ -368,10 +375,15 @@ a {
background-color: transparent;
}
.jsterm-complete-node {
color: var(--theme-comment);
}
.jsterm-input-node {
background-image: -moz-image-rect(url("chrome://devtools/skin/themes/images/commandline-icon.png"), 0, 32, 16, 16);
background-repeat: no-repeat;
background-size: 16px 16px;
color: var(--theme-content-color1);
}
@media (min-resolution: 1.1dppx) {
@ -398,7 +410,7 @@ a {
margin-top: 5px;
margin-bottom: 15px;
-moz-margin-end: 15px;
border: 1px solid rgba(128, 128, 128, .5);
border: 1px solid var(--theme-splitter-color);
border-radius: 3px;
}
@ -442,6 +454,11 @@ a {
.navigation-marker .url {
-moz-padding-end: 9px;
text-decoration: none;
background: var(--theme-body-background);
}
.theme-light .navigation-marker .url {
background: #fff;
}
.stacktrace {
@ -451,7 +468,7 @@ a {
margin: 5px 0 0 0;
max-height: 10em;
overflow-y: auto;
border: 1px solid rgb(200,200,200);
border: 1px solid var(--theme-splitter-color);
border-radius: 3px;
}
@ -514,49 +531,6 @@ a {
background-position: -16px 0;
}
.jsterm-input-container {
background-color: var(--theme-tab-toolbar-background);
border-color: var(--theme-body-background);
}
.jsterm-input-node {
color: var(--theme-content-color1);
}
.jsterm-complete-node {
color: var(--theme-comment);
}
.navigation-marker .url {
background: var(--theme-body-background);
}
.theme-dark .inlined-variables-view iframe {
border-color: #333;
}
.theme-dark .stacktrace {
border-color: #333;
}
.theme-light .jsterm-input-container {
/* For light theme use a white background for the input - it looks better
than off-white */
background-color: #fff;
border-color: ThreeDShadow;
}
.theme-light .navigation-marker .url {
background: #fff;
}
.theme-light .inlined-variables-view iframe {
border-color: #ccc;
}
.theme-light .stacktrace {
border-color: #ccc;
}
@media (max-width: 500px) {
.message > .timestamp {
display: none;

View File

@ -2592,6 +2592,21 @@ var WalkerActor = protocol.ActorClass({
response: RetVal("disconnectedNodeArray")
}),
/**
* Duplicate a specified node
*
* @param {NodeActor} node The node to duplicate.
*/
duplicateNode: method(function({rawNode}) {
let clonedNode = rawNode.cloneNode(true);
rawNode.parentNode.insertBefore(clonedNode, rawNode.nextSibling);
}, {
request: {
node: Arg(0, "domnode")
},
response: {}
}),
/**
* Test whether a node is a document or a document element.
*

View File

@ -57,6 +57,7 @@ skip-if = buildapp == 'mulet'
[test_inspector-changeattrs.html]
[test_inspector-changevalue.html]
[test_inspector-dead-nodes.html]
[test_inspector-duplicate-node.html]
[test_inspector_getImageData.html]
skip-if = buildapp == 'mulet'
[test_inspector_getImageDataFromURL.html]

View File

@ -80,12 +80,11 @@
<select multiple><option>one</option><option>two</option></select>
<div id="pseudo"><span>middle</span></div>
<div id="pseudo-empty"></div>
<div id="shadow">light dom</div>
<object>
<div id="1"></div>
</object>
<div class="node-to-duplicate"></div>
<div id="scroll-into-view" style="margin-top: 1000px;">scroll</div>
</body>
</html>

View File

@ -0,0 +1,75 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1208864
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1208864</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
<script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
<script type="application/javascript;version=1.8">
const inspector = require("devtools/server/actors/inspector");
window.onload = function() {
SimpleTest.waitForExplicitFinish();
runNextTest();
}
var gInspectee = null;
var gClient = null;
var gWalker = null;
function assertOwnership() {
assertOwnershipTrees(gWalker);
}
addTest(function setup() {
let url = document.getElementById("inspectorContent").href;
attachURL(url, function(err, client, tab, doc) {
gInspectee = doc;
let {InspectorFront} = require("devtools/server/actors/inspector");
let inspector = InspectorFront(client, tab);
promiseDone(inspector.getWalker().then(walker => {
ok(walker, "getWalker() should return an actor.");
gClient = client;
gWalker = walker;
}).then(runNextTest));
});
});
addTest(Task.async(function* testDuplicateNode() {
let className = ".node-to-duplicate";
let matches = yield gWalker.querySelectorAll(gWalker.rootNode, className);
is(matches.length, 1, "There should initially be one node to duplicate.");
let nodeFront = yield gWalker.querySelector(gWalker.rootNode, className);
yield gWalker.duplicateNode(nodeFront);
matches = yield gWalker.querySelectorAll(gWalker.rootNode, className);
is(matches.length, 2, "The node should now be duplicated.");
runNextTest();
}));
addTest(function cleanup() {
delete gWalker;
delete gInspectee;
delete gClient;
runNextTest();
});
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1208864">Mozilla Bug 1208864</a>
<a id="inspectorContent" target="_blank" href="inspector-traversal-data.html">Test Document</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -458,6 +458,25 @@ exports.dbg_assert = function dbg_assert(cond, e) {
}
};
exports.defineLazyGetter(this, "AppConstants", () => {
const scope = {};
Cu.import("resource://gre/modules/AppConstants.jsm", scope);
return scope.AppConstants;
});
/**
* No operation. The empty function.
*/
exports.noop = function () { };
function reallyAssert(condition, message) {
if (!condition) {
const err = new Error("Assertion failure: " + message);
exports.reportException("DevToolsUtils.assert", err);
throw err;
}
}
/**
* DevToolsUtils.assert(condition, message)
*
@ -477,23 +496,11 @@ exports.dbg_assert = function dbg_assert(cond, e) {
* This is an improvement over `dbg_assert`, which doesn't actually cause any
* fatal behavior, and is therefore much easier to accidentally ignore.
*/
exports.defineLazyGetter(exports, "assert", () => {
function noop(condition, msg) { }
function assert(condition, message) {
if (!condition) {
const err = new Error("Assertion failure: " + message);
exports.reportException("DevToolsUtils.assert", err);
throw err;
}
}
const scope = {};
Cu.import("resource://gre/modules/AppConstants.jsm", scope);
const { DEBUG, DEBUG_JS_MODULES } = scope.AppConstants;
return (DEBUG || DEBUG_JS_MODULES || exports.testing) ? assert : noop;
});
Object.defineProperty(exports, "assert", {
get: () => (AppConstants.DEBUG || AppConstants.DEBUG_JS_MODULES || this.testing)
? reallyAssert
: exports.noop,
})
/**
* Defines a getter on a specified object for a module. The module will not

View File

@ -10,6 +10,7 @@
#include "mozilla/ErrorResult.h"
#include "mozilla/devtools/DeserializedNode.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/HashFunctions.h"
#include "mozilla/Maybe.h"
#include "mozilla/RefCounted.h"
@ -139,6 +140,15 @@ public:
void TakeCensus(JSContext* cx, JS::HandleObject options,
JS::MutableHandleValue rval, ErrorResult& rv);
dom::Nullable<uint64_t> GetCreationTime() {
static const uint64_t maxTime = uint64_t(1) << 53;
if (timestamp.isSome() && timestamp.ref() <= maxTime) {
return dom::Nullable<uint64_t>(timestamp.ref());
}
return dom::Nullable<uint64_t>();
}
};
// A `CoreDumpWriter` is given the data we wish to save in a core dump and

View File

@ -0,0 +1,29 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// HeapSnapshot.prototype.creationTime returns the expected time.
function waitForTenMilliseconds() {
const start = Date.now();
while (Date.now() - start < 10) ;
}
function run_test() {
const start = Date.now() * 1000;
do_print("start = " + start);
// Because Date.now() is less precise than the snapshot's time stamp, give it
// a little bit of head room.
waitForTenMilliseconds();
const path = ChromeUtils.saveHeapSnapshot({ runtime: true });
waitForTenMilliseconds();
const end = Date.now() * 1000;
do_print("end = " + end);
const snapshot = ChromeUtils.readHeapSnapshot(path);
do_print("snapshot.creationTime = " + snapshot.creationTime);
ok(snapshot.creationTime >= start);
ok(snapshot.creationTime <= end);
}

View File

@ -25,6 +25,7 @@ support-files =
[test_HeapAnalyses_takeCensus_03.js]
[test_HeapAnalyses_takeCensus_04.js]
[test_HeapAnalyses_takeCensus_05.js]
[test_HeapSnapshot_creationTime_01.js]
[test_HeapSnapshot_takeCensus_01.js]
[test_HeapSnapshot_takeCensus_02.js]
[test_HeapSnapshot_takeCensus_03.js]

View File

@ -9,6 +9,11 @@ const DevToolsUtils = require("devtools/shared/DevToolsUtils");
// Register a console listener, so console messages don't just disappear
// into the ether.
// If for whatever reason the test needs to post console errors that aren't
// failures, set this to true.
var ALLOW_CONSOLE_ERRORS = false;
var errorCount = 0;
var listener = {
observe: function (aMessage) {
@ -35,7 +40,10 @@ var listener = {
while (DebuggerServer.xpcInspector.eventLoopNestLevel > 0) {
DebuggerServer.xpcInspector.exitNestedEventLoop();
}
do_throw("head_dbg.js got console message: " + string + "\n");
if (!ALLOW_CONSOLE_ERRORS) {
do_throw("head_devtools.js got console message: " + string + "\n");
}
}
};

View File

@ -0,0 +1,36 @@
/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Test DevToolsUtils.assert
ALLOW_CONSOLE_ERRORS = true;
function run_test() {
// Enable assertions.
DevToolsUtils.testing = true;
const { assert } = DevToolsUtils;
equal(typeof assert, "function");
try {
assert(true, "this assertion should not fail");
} catch (e) {
// If you catch assertion failures in practice, I will hunt you down. I get
// email notifications every time it happens.
ok(false, "Should not get an error for an assertion that should not fail. Got "
+ DevToolsUtils.safeErrorString(e));
}
let assertionFailed = false;
try {
assert(false, "this assertion should fail");
} catch (e) {
ok(e.message.startsWith("Assertion failure:"),
"Should be an assertion failure error");
assertionFailed = true;
}
ok(assertionFailed,
"The assertion should have failed, which should throw an error when assertions are enabled.");
}

View File

@ -6,6 +6,7 @@ skip-if = toolkit == 'android' || toolkit == 'gonk'
support-files =
exposeLoader.js
[test_assert.js]
[test_fetch-chrome.js]
[test_fetch-file.js]
[test_fetch-http.js]

View File

@ -91,7 +91,7 @@ BluetoothHfpManager::OnGetServiceChannel(const nsAString& aDeviceAddress,
}
void
BluetoothHfpManager::OnUpdateSdpRecords(const nsAString& aDeviceAddress)
BluetoothHfpManager::OnUpdateSdpRecords(const BluetoothAddress& aDeviceAddress)
{
MOZ_ASSERT(false);
}

View File

@ -240,12 +240,6 @@ TelephonyListener::EnumerateCallState(nsITelephonyCallInfo* aInfo)
return HandleCallInfo(aInfo, false);
}
NS_IMETHODIMP
TelephonyListener::ConferenceCallStateChanged(uint16_t aCallState)
{
return NS_OK;
}
NS_IMETHODIMP
TelephonyListener::EnumerateCallStateComplete()
{

View File

@ -40,7 +40,7 @@ const TYPED_ARRAY_THINGS = new Set([
]);
this.SETTINGSDB_NAME = "settings";
this.SETTINGSDB_VERSION = 5;
this.SETTINGSDB_VERSION = 6;
this.SETTINGSSTORE_NAME = "settings";
Cu.import("resource://gre/modules/IndexedDBHelper.jsm");

View File

@ -723,6 +723,7 @@ Telephony::WindowAudioCaptureChanged()
NS_IMETHODIMP
Telephony::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllInfo)
{
// Update call state
nsresult rv;
for (uint32_t i = 0; i < aLength; ++i) {
rv = HandleCallInfo(aAllInfo[i]);
@ -731,6 +732,9 @@ Telephony::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllInfo)
}
}
// Update conference state
mGroup->ChangeState();
rv = HandleAudioAgentState();
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -744,17 +748,6 @@ Telephony::EnumerateCallState(nsITelephonyCallInfo* aInfo)
return HandleCallInfo(aInfo);
}
NS_IMETHODIMP
Telephony::ConferenceCallStateChanged(uint16_t aCallState)
{
// The current design of Telephony Stack gaurantees that the calls within a
// call group are updated before this method being called, so we can let a
// call update its state by its own, and we can discard |aCallState| here.
// Anyway, this method is going to be deprecated in Bug 1155072.
mGroup->ChangeState();
return NS_OK;
}
NS_IMETHODIMP
Telephony::EnumerateCallStateComplete()
{

View File

@ -369,7 +369,6 @@ function TelephonyService() {
this._isDialing = false;
this._cachedDialRequest = null;
this._currentCalls = {};
this._currentConferenceState = nsITelephonyService.CALL_STATE_UNKNOWN;
this._audioStates = [];
this._ussdSessions = [];
@ -2040,7 +2039,6 @@ TelephonyService.prototype = {
calls.push(call);
}
this._handleCallStateChanged(aClientId, calls);
this._handleConferenceCallStateChanged(nsITelephonyService.CALL_STATE_CONNECTED);
aCallback.notifySuccess();
});
@ -2084,7 +2082,6 @@ TelephonyService.prototype = {
parentCall.isSwitchable = true;
parentCall.isMergeable = true;
this._handleCallStateChanged(aClientId, [childCall, parentCall]);
this._handleConferenceCallStateChanged(nsITelephonyService.CALL_STATE_UNKNOWN);
},
// See 3gpp2, S.R0006-522-A v1.0. Table 4, XID 6S.
@ -2128,11 +2125,24 @@ TelephonyService.prototype = {
return;
}
let foreground = this._currentConferenceState == nsITelephonyService.CALL_STATE_CONNECTED;
this._sendToRilWorker(aClientId,
foreground ? "hangUpForeground" : "hangUpBackground",
null,
// Find a conference call, and send the corresponding request to RIL worker.
for (let index in this._currentCalls[aClientId]) {
let call = this._currentCalls[aClientId][index];
if (!call.isConference) {
continue;
}
let command = call.state === nsITelephonyService.CALL_STATE_CONNECTED ?
"hangUpForeground" : "hangUpBackground";
this._sendToRilWorker(aClientId, command, null,
this._defaultCallbackHandler.bind(this, aCallback));
return;
}
// There is no conference call.
if (DEBUG) debug("hangUpConference: " +
"No conference call in modem[" + aClientId + "].");
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
},
_switchConference: function(aClientId, aCallback) {
@ -2354,12 +2364,6 @@ TelephonyService.prototype = {
this._handleCallStateChanged(aClientId, [...changedCalls]);
// Should handle conferenceCallStateChange after callStateChanged and
// callDisconnected.
if (newConferenceState != this._currentConferenceState) {
this._handleConferenceCallStateChanged(newConferenceState);
}
this._updateAudioState(aClientId);
// Handle cached dial request.
@ -2439,12 +2443,6 @@ TelephonyService.prototype = {
[aClientId, callIndex, notification]);
},
_handleConferenceCallStateChanged: function(aState) {
if (DEBUG) debug("handleConferenceCallStateChanged: " + aState);
this._currentConferenceState = aState;
this._notifyAllListeners("conferenceCallStateChanged", [aState]);
},
notifyUssdReceived: function(aClientId, aMessage, aSessionEnded) {
if (DEBUG) {
debug("notifyUssdReceived for " + aClientId + ": " +

View File

@ -97,7 +97,6 @@ this.TelephonyUtils = {
resolve();
}
},
conferenceCallStateChanged: function() {},
supplementaryServiceNotification: function() {},
notifyError: function() {},
notifyCdmaCallWaiting: function() {},

View File

@ -129,8 +129,6 @@ child:
NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);
NotifyConferenceCallStateChanged(uint16_t aCallState);
NotifyConferenceError(nsString aName, nsString aMessage);
NotifySupplementaryService(uint32_t aClientId, int32_t aCallIndex,

View File

@ -80,15 +80,6 @@ TelephonyChild::RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
return true;
}
bool
TelephonyChild::RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState)
{
MOZ_ASSERT(mService);
mService->ConferenceCallStateChanged(aCallState);
return true;
}
bool
TelephonyChild::RecvNotifyConferenceError(const nsString& aName,
const nsString& aMessage)

View File

@ -41,9 +41,6 @@ protected:
RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
const IPCCdmaWaitingCallData& aData) override;
virtual bool
RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState) override;
virtual bool
RecvNotifyConferenceError(const nsString& aName,
const nsString& aMessage) override;

View File

@ -376,15 +376,6 @@ TelephonyIPCService::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** a
return NS_OK;
}
NS_IMETHODIMP
TelephonyIPCService::ConferenceCallStateChanged(uint16_t aCallState)
{
for (uint32_t i = 0; i < mListeners.Length(); i++) {
mListeners[i]->ConferenceCallStateChanged(aCallState);
}
return NS_OK;
}
NS_IMETHODIMP
TelephonyIPCService::EnumerateCallStateComplete()
{

View File

@ -286,15 +286,6 @@ TelephonyParent::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllI
return SendNotifyCallStateChanged(allInfo) ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
TelephonyParent::ConferenceCallStateChanged(uint16_t aCallState)
{
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
return SendNotifyConferenceCallStateChanged(aCallState) ? NS_OK
: NS_ERROR_FAILURE;
}
NS_IMETHODIMP
TelephonyParent::EnumerateCallStateComplete()
{
@ -381,12 +372,6 @@ TelephonyRequestParent::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo*
MOZ_CRASH("Not a TelephonyParent!");
}
NS_IMETHODIMP
TelephonyRequestParent::ConferenceCallStateChanged(uint16_t aCallState)
{
MOZ_CRASH("Not a TelephonyParent!");
}
NS_IMETHODIMP
TelephonyRequestParent::EnumerateCallStateComplete()
{

View File

@ -7,7 +7,7 @@
interface nsIMobileCallForwardingOptions;
interface nsITelephonyCallInfo;
[scriptable, uuid(80faf34e-286b-4487-bd55-135bd92668b9)]
[scriptable, uuid(baa9f5f3-5cab-40e0-81e9-ae0abd917907)]
interface nsITelephonyListener : nsISupports
{
/**
@ -29,17 +29,6 @@ interface nsITelephonyListener : nsISupports
void callStateChanged(in unsigned long length,
[array, size_is(length)] in nsITelephonyCallInfo allInfo);
/**
* Called when participants of a conference call have been updated, and the
* conference call state changes.
*
* @param callState
* Possible values are: nsITelephonyService::CALL_STATE_UNKNOWN,
* nsITelephonyService::CALL_STATE_HELD,
* nsITelephonyService::CALL_STATE_CONNECTED.
*/
void conferenceCallStateChanged(in unsigned short callState);
/**
* Notify when RIL receives supplementary service notification.
*

View File

@ -45,7 +45,6 @@ function waitForStateChanged(aPredicate) {
}
},
conferenceCallStateChanged: function() {},
supplementaryServiceNotification: function() {},
notifyError: function() {},
notifyCdmaCallWaiting: function() {},

View File

@ -9,6 +9,12 @@
*/
[ChromeOnly, Exposed=(Window,System,Worker)]
interface HeapSnapshot {
/**
* A time stamp of when the heap snapshot was taken, if available. Units are
* microseconds since midnight (00:00:00) 1 January 1970 UTC.
*/
readonly attribute unsigned long long? creationTime;
/**
* Take a census of the heap snapshot.
*

View File

@ -27,6 +27,18 @@ UNIFIED_SOURCES += [
FINAL_LIBRARY = 'xul'
RESOURCE_FILES += [
'res/accessiblecaret.png',
'res/accessiblecaret@1.5x.png',
'res/accessiblecaret@2.25x.png',
'res/accessiblecaret@2x.png',
'res/accessiblecaret_tilt_left.png',
'res/accessiblecaret_tilt_left@1.5x.png',
'res/accessiblecaret_tilt_left@2.25x.png',
'res/accessiblecaret_tilt_left@2x.png',
'res/accessiblecaret_tilt_right.png',
'res/accessiblecaret_tilt_right@1.5x.png',
'res/accessiblecaret_tilt_right@2.25x.png',
'res/accessiblecaret_tilt_right@2x.png',
'res/EditorOverride.css',
'res/grabber.gif',
'res/table-add-column-after-active.gif',

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

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