mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 09:54:42 +00:00
Merge inbound to m-c a=merge
This commit is contained in:
commit
cb8ce82cca
179
browser/base/content/moz.build
Normal file
179
browser/base/content/moz.build
Normal file
@ -0,0 +1,179 @@
|
||||
# -*- Mode: python; 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("aboutaccounts/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Sync")
|
||||
|
||||
with Files("abouthealthreport/**"):
|
||||
BUG_COMPONENT = ("Firefox Health Report", "Client: Desktop")
|
||||
|
||||
with Files("defaultthemes/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Theme")
|
||||
|
||||
with Files("docs/**"):
|
||||
BUG_COMPONENT = ("Core", "Security")
|
||||
|
||||
with Files("newtab/**"):
|
||||
BUG_COMPONENT = ("Firefox", "New Tab Page")
|
||||
|
||||
with Files("pageinfo/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Page Info Window")
|
||||
|
||||
with Files("sync/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Sync")
|
||||
|
||||
with Files("test/alerts/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Notification and Alerts")
|
||||
|
||||
with Files("test/appUpdate/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Application Update")
|
||||
|
||||
with Files("test/captivePortal/**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("test/chrome/**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("test/forms/**"):
|
||||
BUG_COMPONENT = ("Core", "Layout: Form Controls")
|
||||
|
||||
with Files("test/newtab/**"):
|
||||
BUG_COMPONENT = ("Firefox", "New Tab Page")
|
||||
|
||||
with Files("test/pageinfo/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Page Info Window")
|
||||
|
||||
with Files("test/permissions/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Preferences")
|
||||
|
||||
with Files("test/plugins/**"):
|
||||
BUG_COMPONENT = ("Core", "Plug-ins")
|
||||
|
||||
with Files("test/popupNotifications/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Notifications and Alerts")
|
||||
|
||||
with Files("test/popups/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Notifications and Alerts")
|
||||
|
||||
with Files("test/referrer/**"):
|
||||
BUG_COMPONENT = ("Core", "Document Navigation")
|
||||
|
||||
with Files("test/siteIdentity/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("test/social/**"):
|
||||
BUG_COMPONENT = ("Firefox", "SocialAPI")
|
||||
|
||||
with Files("test/static/**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("test/tabPrompts/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
|
||||
|
||||
with Files("test/tabcrashed/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
|
||||
|
||||
with Files("test/tabs/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
|
||||
|
||||
with Files("test/urlbar/**"):
|
||||
BUG_COMPONENT = ("Firefox`", "Location Bar")
|
||||
|
||||
with Files("test/webextensions/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "WebExtensions: Untriaged")
|
||||
|
||||
with Files("test/webrtc/**"):
|
||||
BUG_COMPONENT = ("Core", "WebRTC")
|
||||
|
||||
with Files("aboutProviderDirectory.xhtml"):
|
||||
BUG_COMPONENT = ("Firefox", "SocialAPI")
|
||||
|
||||
with Files("aboutNetError.xhtml"):
|
||||
BUG_COMPONENT = ("Firefox", "Security")
|
||||
|
||||
with Files("aboutSocialError.xhtml"):
|
||||
BUG_COMPONENT = ("Firefox", "SocialAPI")
|
||||
|
||||
with Files("blockedSite.xhtml"):
|
||||
BUG_COMPONENT = ("Toolkit", "Safe Browsing")
|
||||
|
||||
with Files("browser-addons.js"):
|
||||
BUG_COMPONENT = ("Toolkit", "Add-ons Manager")
|
||||
|
||||
with Files("*menu*"):
|
||||
BUG_COMPONENT = ("Firefox", "Menus")
|
||||
|
||||
with Files("browser-compacttheme.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Themes")
|
||||
|
||||
with Files("browser-customization.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Toolbars and Customization")
|
||||
|
||||
with Files("browser-feeds.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Toolbars and Customization")
|
||||
|
||||
with Files("browser-fullZoom.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Tabbed Browsing")
|
||||
|
||||
with Files("browser-fxaccounts.js"):
|
||||
BUG_COMPONENT = ("Core", "FxAccounts")
|
||||
|
||||
with Files("browser-gestureSupport.js"):
|
||||
BUG_COMPONENT = ("Core", "Widget: Cocoa")
|
||||
|
||||
with Files("browser-media.js"):
|
||||
BUG_COMPONENT = ("Core", "Audio/Video: Playback")
|
||||
|
||||
with Files("browser-places.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Bookmarks & History")
|
||||
|
||||
with Files("browser-plugins.js"):
|
||||
BUG_COMPONENT = ("Core", "Plug-ins")
|
||||
|
||||
with Files("browser-refreshblocker.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Disability Access")
|
||||
|
||||
with Files("browser-safebrowsing.js"):
|
||||
BUG_COMPONENT = ("Toolkit", "Safe Browsing")
|
||||
|
||||
with Files("*social*"):
|
||||
BUG_COMPONENT = ("Firefox", "SocialAPI")
|
||||
|
||||
with Files("browser-syncui.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Sync")
|
||||
|
||||
with Files("browser-tabPreviews.xml"):
|
||||
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
|
||||
|
||||
with Files("contentSearch*"):
|
||||
BUG_COMPONENT = ("Firefox", "Search")
|
||||
|
||||
with Files("*.svg"):
|
||||
BUG_COMPONENT = ("Firefox", "Theme")
|
||||
|
||||
with Files("gcli*"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Security")
|
||||
|
||||
with Files("hiddenWindow.xul"):
|
||||
BUG_COMPONENT = ("Firefox", "Device Permissions")
|
||||
|
||||
with Files("macBrowserOverlay.xul"):
|
||||
BUG_COMPONENT = ("Firefox", "Shell Integration")
|
||||
|
||||
with Files("report-phishing-overlay.xul"):
|
||||
BUG_COMPONENT = ("Toolkit", "Safe Browsing")
|
||||
|
||||
with Files("tabbrowser*"):
|
||||
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
|
||||
|
||||
with Files("webext-panels*"):
|
||||
BUG_COMPONENT = ("Toolkit", "WebExtensions: Frontend")
|
||||
|
||||
with Files("webrtcIndicator*"):
|
||||
BUG_COMPONENT = ("Firefox", "Device Permissions")
|
@ -330,7 +330,7 @@ body.compact .newtab-cell {
|
||||
display: -moz-box;
|
||||
position: relative;
|
||||
-moz-box-pack: center;
|
||||
margin: 40px 0 15px;
|
||||
margin: 55px 0 15px;
|
||||
}
|
||||
|
||||
body.compact #newtab-search-container {
|
||||
|
@ -10,6 +10,7 @@ var gExceptionPaths = [
|
||||
"chrome://browser/content/defaultthemes/",
|
||||
"chrome://browser/locale/searchplugins/",
|
||||
"resource://app/defaults/blocklists/",
|
||||
"resource://app/defaults/pinning/",
|
||||
"resource://app/defaults/preferences/",
|
||||
"resource://gre/modules/commonjs/",
|
||||
"resource://gre/defaults/pref/",
|
||||
@ -285,9 +286,6 @@ const ignorableWhitelist = new Set([
|
||||
// dom/media/gmp/GMPParent.cpp
|
||||
"resource://gre/gmp-clearkey/0.1/manifest.json",
|
||||
|
||||
// Bug 1351675 - should this file be packaged?
|
||||
"resource://app/defaults/pinning/pins.json",
|
||||
|
||||
// Bug 1351669 - obsolete test file
|
||||
"resource://gre/res/test.properties",
|
||||
]);
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
EXPORTS.mozilla.browser += [
|
||||
'AboutRedirector.h',
|
||||
]
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "Build Config")
|
||||
|
||||
EXPORTS += [
|
||||
'nsBrowserCompsCID.h',
|
||||
]
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
EXPORTS.mozilla.browser += [
|
||||
'DirectoryProvider.h',
|
||||
]
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Toolkit", "WebExtensions: Untriaged")
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
|
@ -4,6 +4,25 @@
|
||||
# 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/.
|
||||
|
||||
with Files("tests/**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("tests/browser/browser_bug538331.js"):
|
||||
BUG_COMPONENT = ("Toolkit", "Application Update")
|
||||
|
||||
with Files("tests/browser/browser_contentpermissionprompt.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("tests/unit/test_browserGlue_migration_loop_cleanup.js"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("tests/unit/test_distribution.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Distributions")
|
||||
|
||||
with Files("safebrowsing/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Safe Browsing")
|
||||
|
||||
|
||||
DIRS += [
|
||||
'about',
|
||||
'contextualidentity',
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "New Tab Page")
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += [
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Core", "Security")
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += [
|
||||
'test/browser/browser.ini',
|
||||
]
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
'SelfSupportService.js',
|
||||
'SelfSupportService.manifest',
|
||||
|
@ -2,6 +2,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "Translation")
|
||||
|
||||
EXTRA_JS_MODULES.translation = [
|
||||
'BingTranslator.jsm',
|
||||
'cld2/cld-worker.js',
|
||||
|
@ -662,7 +662,12 @@ this.UITour = {
|
||||
}
|
||||
}
|
||||
|
||||
this.initForBrowser(browser, window);
|
||||
// For performance reasons, only call initForBrowser if we did something
|
||||
// that will require a teardownTourForBrowser call later.
|
||||
// getConfiguration (called from about:home) doesn't require any future
|
||||
// uninitialization.
|
||||
if (action != "getConfiguration")
|
||||
this.initForBrowser(browser, window);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
@ -2,6 +2,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
HAS_MISC_RULE = True
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
|
@ -1,25 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.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/. -->
|
||||
|
||||
#filter substitution
|
||||
|
||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>ppapipdf.js@mozilla.org</em:id>
|
||||
<em:name>ppapipdf.js</em:name>
|
||||
<em:description>ppapipdf.js</em:description>
|
||||
<em:version>0.1</em:version>
|
||||
<em:description>ppapi pdf</em:description>
|
||||
<em:version>1.0</em:version>
|
||||
<em:type>2</em:type>
|
||||
<em:bootstrap>true</em:bootstrap>
|
||||
<em:multiprocessCompatible>true</em:multiprocessCompatible>
|
||||
|
||||
<!-- Target Application this extension can install into,
|
||||
with minimum and maximum supported versions. -->
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!--Firefox-->
|
||||
<em:minVersion>37.0</em:minVersion>
|
||||
<em:maxVersion>45.*</em:maxVersion>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>@MOZ_APP_VERSION@</em:minVersion>
|
||||
<em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
<em:strictCompatibility>false</em:strictCompatibility>
|
||||
|
||||
</Description>
|
||||
</RDF>
|
14
browser/extensions/mortar/jar.mn
Normal file
14
browser/extensions/mortar/jar.mn
Normal file
@ -0,0 +1,14 @@
|
||||
# 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/.
|
||||
|
||||
[features/ppapipdf.js@mozilla.org] chrome.jar:
|
||||
|
||||
% content ppapipdf.js %content/
|
||||
content/ (./host/pdf/chrome/*)
|
||||
|
||||
% resource ppapipdf.js %res/
|
||||
res/ (./host/pdf/ppapi*.js)
|
||||
|
||||
% resource ppapi.js %res/
|
||||
res/ (./host/common/*)
|
@ -6,6 +6,20 @@
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
|
||||
|
||||
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
|
||||
|
||||
|
||||
FINAL_TARGET_FILES.features['ppapipdf.js@mozilla.org'] += [
|
||||
'host/pdf/bootstrap.js'
|
||||
]
|
||||
|
||||
FINAL_TARGET_PP_FILES.features['ppapipdf.js@mozilla.org'] += [
|
||||
'host/pdf/install.rdf.in'
|
||||
]
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
||||
|
||||
SOURCES += [
|
||||
'host/rpc.cc',
|
||||
]
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "PDF Viewer")
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "Pocket")
|
||||
|
||||
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
|
||||
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Shield", "Add-on")
|
||||
|
||||
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
|
||||
|
||||
|
@ -649,6 +649,7 @@
|
||||
@RESPATH@/defaults/autoconfig/prefcalls.js
|
||||
@RESPATH@/browser/defaults/permissions
|
||||
@RESPATH@/browser/defaults/blocklists
|
||||
@RESPATH@/browser/defaults/pinning
|
||||
|
||||
; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
|
||||
; Technically this is an app pref file, but we are keeping it in the original
|
||||
|
@ -4,6 +4,133 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("test/browser/*Telemetry*"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
with Files("test/browser/*ContentSearch*"):
|
||||
BUG_COMPONENT = ("Firefox", "Search")
|
||||
|
||||
with Files("test/browser/*NetworkPrioritizer*"):
|
||||
BUG_COMPONENT = ("Core", "Networking")
|
||||
|
||||
with Files("test/browser/*PermissionUI*"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("test/browser/browser_SelfSupportBackend.js"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
with Files("test/browser/*SitePermissions*"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("test/browser/browser_UnsubmittedCrashHandler.js"):
|
||||
BUG_COMPONENT = ("Toolkit", "Breakpad Integration")
|
||||
|
||||
with Files("test/browser/browser_bug1319078.js"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Core & HTML")
|
||||
|
||||
with Files("test/browser/browser_taskbar_preview.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Shell Integration")
|
||||
|
||||
with Files("test/browser/browser_urlBar_zoom.js"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("test/unit/test_AttributionCode.js"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
with Files("test/unit/test_DirectoryLinksProvider.js"):
|
||||
BUG_COMPONENT = ("Firefox", "New Tab Page")
|
||||
|
||||
with Files("test/unit/test_E10SUtils_nested_URIs.js"):
|
||||
BUG_COMPONENT = ("Core", "Security: Process Sandboxing")
|
||||
|
||||
with Files("test/unit/test_LaterRun.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Tours")
|
||||
|
||||
with Files("test/unit/test_SitePermissions.js"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("AboutNewTab.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "New Tab Page")
|
||||
|
||||
with Files("AttributionCode.jsm"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
with Files("*Telemetry.jsm"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
with Files("ContentCrashHandlers.jsm"):
|
||||
BUG_COMPONENT = ("Toolkit", "Breakpad Integration")
|
||||
|
||||
with Files("ContentSearch.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Search")
|
||||
|
||||
with Files("ContentWebRTC.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Device Permissions")
|
||||
|
||||
with Files("DirectoryLinksProvider.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "New Tab Page")
|
||||
|
||||
with Files("E10SUtils.jsm"):
|
||||
BUG_COMPONENT = ("Core", "Security: Process Sandboxing")
|
||||
|
||||
with Files("ExtensionsUI.jsm"):
|
||||
BUG_COMPONENT = ("Toolkit", "WebExtensions: General")
|
||||
|
||||
with Files("FullZoomUI.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Toolbars and Customization")
|
||||
|
||||
with Files("LaterRun.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Tours")
|
||||
|
||||
with Files("NetworkPrioritizer.jsm"):
|
||||
BUG_COMPONENT = ("Core", "Networking")
|
||||
|
||||
with Files("PermissionUI.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("PluginContent.jsm"):
|
||||
BUG_COMPONENT = ("Core", "Plug-ins")
|
||||
|
||||
with Files("ProcessHangMonitor.jsm"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Content Processes")
|
||||
|
||||
with Files("ReaderParent.jsm"):
|
||||
BUG_COMPONENT = ("Toolkit", "Reader Mode")
|
||||
|
||||
with Files("Sanitizer.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Preferences")
|
||||
|
||||
with Files("SelfSupportBackend.jsm"):
|
||||
BUG_COMPONENT = ("Toolkit", "Telemetry")
|
||||
|
||||
with Files("SitePermissions.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("Social*"):
|
||||
BUG_COMPONENT = ("Firefox", "SocialAPI")
|
||||
|
||||
with Files("TransientPrefs.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Preferences")
|
||||
|
||||
with Files("Windows8WindowFrameColor.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Theme")
|
||||
|
||||
with Files("WindowsJumpLists.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Shell Integration")
|
||||
|
||||
with Files("WindowsPreviewPerTab.jsm"):
|
||||
BUG_COMPONENT = ("Core", "Widget: Win32")
|
||||
|
||||
with Files("offlineAppCache.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Preferences")
|
||||
|
||||
with Files("webrtcUI.jsm"):
|
||||
BUG_COMPONENT = ("Firefox", "Device Permissions")
|
||||
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
|
||||
XPCSHELL_TESTS_MANIFESTS += [
|
||||
'test/unit/social/xpcshell.ini',
|
||||
|
@ -4,6 +4,9 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "Theme")
|
||||
|
||||
toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
|
||||
|
||||
if toolkit == 'cocoa':
|
||||
|
@ -4,6 +4,21 @@
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Firefox", "General")
|
||||
|
||||
with Files("controlCenter/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("devtools/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Developer Tools")
|
||||
|
||||
with Files("permissionPrompts/**"):
|
||||
BUG_COMPONENT = ("Firefox", "Site Identity and Permission Panels")
|
||||
|
||||
with Files("preferences/**"):
|
||||
BUG_COMPONENT = ("Firefox", "preferences")
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += [
|
||||
# Each test is in it's own directory so it gets run in a clean profile with
|
||||
# run-by-dir.
|
||||
|
@ -377,7 +377,7 @@ BasePrincipal::CreateCodebasePrincipal(nsIURI* aURI,
|
||||
nsAutoCString originNoSuffix;
|
||||
nsresult rv =
|
||||
ContentPrincipal::GenerateOriginNoSuffixFromURI(aURI, originNoSuffix);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
if (NS_FAILED(rv)) {
|
||||
// If the generation of the origin fails, we still want to have a valid
|
||||
// principal. Better to return a null principal here.
|
||||
return NullPrincipal::Create(aAttrs);
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -7,6 +7,6 @@ DevToolsModules(
|
||||
'debugger.css',
|
||||
'debugger.js',
|
||||
'panel.js',
|
||||
'parser-worker.js',
|
||||
'pretty-print-worker.js',
|
||||
'source-map-worker.js'
|
||||
)
|
||||
|
@ -4,7 +4,7 @@
|
||||
"use strict";
|
||||
|
||||
const { Task } = require("devtools/shared/task");
|
||||
var {LocalizationHelper} = require("devtools/shared/l10n");
|
||||
var { LocalizationHelper } = require("devtools/shared/l10n");
|
||||
|
||||
const DBG_STRINGS_URI = "devtools/client/locales/debugger.properties";
|
||||
var L10N = new LocalizationHelper(DBG_STRINGS_URI);
|
||||
@ -16,38 +16,46 @@ function DebuggerPanel(iframeWindow, toolbox) {
|
||||
}
|
||||
|
||||
DebuggerPanel.prototype = {
|
||||
open: Task.async(function* () {
|
||||
open: async function() {
|
||||
if (!this.toolbox.target.isRemote) {
|
||||
yield this.toolbox.target.makeRemote();
|
||||
await this.toolbox.target.makeRemote();
|
||||
}
|
||||
|
||||
yield this.panelWin.Debugger.bootstrap({
|
||||
const {
|
||||
actions,
|
||||
store,
|
||||
selectors,
|
||||
client
|
||||
} = await this.panelWin.Debugger.bootstrap({
|
||||
threadClient: this.toolbox.threadClient,
|
||||
tabTarget: this.toolbox.target
|
||||
tabTarget: this.toolbox.target,
|
||||
debuggerClient: this.toolbox.target._client,
|
||||
sourceMaps: this.toolbox.sourceMapService
|
||||
});
|
||||
|
||||
this._actions = actions;
|
||||
this._store = store;
|
||||
this._selectors = selectors;
|
||||
this._client = client;
|
||||
this.isReady = true;
|
||||
return this;
|
||||
}),
|
||||
|
||||
_store: function () {
|
||||
return this.panelWin.Debugger.store;
|
||||
},
|
||||
|
||||
_getState: function () {
|
||||
return this._store().getState();
|
||||
getVarsForTests() {
|
||||
return {
|
||||
store: this._store,
|
||||
selectors: this._selectors,
|
||||
actions: this._actions,
|
||||
client: this._client
|
||||
};
|
||||
},
|
||||
|
||||
_actions: function () {
|
||||
return this.panelWin.Debugger.actions;
|
||||
_getState: function() {
|
||||
return this._store.getState();
|
||||
},
|
||||
|
||||
_selectors: function () {
|
||||
return this.panelWin.Debugger.selectors;
|
||||
},
|
||||
|
||||
getFrames: function () {
|
||||
let frames = this._selectors().getFrames(this._getState());
|
||||
getFrames: function() {
|
||||
let frames = this._selectors.getFrames(this._getState());
|
||||
|
||||
// Frames is null when the debugger is not paused.
|
||||
if (!frames) {
|
||||
@ -58,7 +66,7 @@ DebuggerPanel.prototype = {
|
||||
}
|
||||
|
||||
frames = frames.toJS();
|
||||
const selectedFrame = this._selectors().getSelectedFrame(this._getState());
|
||||
const selectedFrame = this._selectors.getSelectedFrame(this._getState());
|
||||
const selected = frames.findIndex(frame => frame.id == selectedFrame.id);
|
||||
|
||||
frames.forEach(frame => {
|
||||
@ -68,7 +76,15 @@ DebuggerPanel.prototype = {
|
||||
return { frames, selected };
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
selectSource(sourceURL, sourceLine) {
|
||||
this._actions.selectSourceURL(sourceURL, { line: sourceLine });
|
||||
},
|
||||
|
||||
getSource(sourceURL) {
|
||||
return this._selectors.getSourceByURL(this._getState(), sourceURL);
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.panelWin.Debugger.destroy();
|
||||
this.emit("destroyed");
|
||||
}
|
||||
|
29381
devtools/client/debugger/new/parser-worker.js
Normal file
29381
devtools/client/debugger/new/parser-worker.js
Normal file
File diff suppressed because one or more lines are too long
@ -55,7 +55,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||
/***/ 0:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(801);
|
||||
module.exports = __webpack_require__(964);
|
||||
|
||||
|
||||
/***/ },
|
||||
@ -75,76 +75,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 801:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var prettyFast = __webpack_require__(802);
|
||||
var assert = __webpack_require__(223);
|
||||
|
||||
function prettyPrint(_ref) {
|
||||
var url = _ref.url,
|
||||
indent = _ref.indent,
|
||||
source = _ref.source;
|
||||
|
||||
try {
|
||||
var prettified = prettyFast(source, {
|
||||
url: url,
|
||||
indent: " ".repeat(indent)
|
||||
});
|
||||
|
||||
return {
|
||||
code: prettified.code,
|
||||
mappings: prettified.map._mappings
|
||||
};
|
||||
} catch (e) {
|
||||
throw new Error(`${e.message}\n${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
function invertMappings(mappings) {
|
||||
return mappings._array.map(m => {
|
||||
var mapping = {
|
||||
generated: {
|
||||
line: m.originalLine,
|
||||
column: m.originalColumn
|
||||
}
|
||||
};
|
||||
if (m.source) {
|
||||
mapping.source = m.source;
|
||||
mapping.original = {
|
||||
line: m.generatedLine,
|
||||
column: m.generatedColumn
|
||||
};
|
||||
mapping.name = m.name;
|
||||
}
|
||||
return mapping;
|
||||
});
|
||||
}
|
||||
|
||||
self.onmessage = function (msg) {
|
||||
var _msg$data = msg.data,
|
||||
id = _msg$data.id,
|
||||
args = _msg$data.args;
|
||||
|
||||
assert(msg.data.method === "prettyPrint", "Method must be `prettyPrint`");
|
||||
|
||||
try {
|
||||
var _prettyPrint = prettyPrint(args[0]),
|
||||
code = _prettyPrint.code,
|
||||
mappings = _prettyPrint.mappings;
|
||||
|
||||
self.postMessage({ id, response: {
|
||||
code, mappings: invertMappings(mappings)
|
||||
} });
|
||||
} catch (e) {
|
||||
self.postMessage({ id, error: e });
|
||||
}
|
||||
};
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 802:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
@ -5918,6 +5848,80 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 964:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var prettyFast = __webpack_require__(802);
|
||||
var assert = __webpack_require__(223);
|
||||
|
||||
function prettyPrint(_ref) {
|
||||
var url = _ref.url,
|
||||
indent = _ref.indent,
|
||||
source = _ref.source;
|
||||
|
||||
try {
|
||||
var prettified = prettyFast(source, {
|
||||
url: url,
|
||||
indent: " ".repeat(indent)
|
||||
});
|
||||
|
||||
return {
|
||||
code: prettified.code,
|
||||
mappings: prettified.map._mappings
|
||||
};
|
||||
} catch (e) {
|
||||
throw new Error(`${e.message}\n${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
function invertMappings(mappings) {
|
||||
return mappings._array.map(m => {
|
||||
var mapping = {
|
||||
generated: {
|
||||
line: m.originalLine,
|
||||
column: m.originalColumn
|
||||
}
|
||||
};
|
||||
if (m.source) {
|
||||
mapping.source = m.source;
|
||||
mapping.original = {
|
||||
line: m.generatedLine,
|
||||
column: m.generatedColumn
|
||||
};
|
||||
mapping.name = m.name;
|
||||
}
|
||||
return mapping;
|
||||
});
|
||||
}
|
||||
|
||||
self.onmessage = function (msg) {
|
||||
var _msg$data = msg.data,
|
||||
id = _msg$data.id,
|
||||
args = _msg$data.args;
|
||||
|
||||
assert(msg.data.method === "prettyPrint", "Method must be `prettyPrint`");
|
||||
|
||||
try {
|
||||
var _prettyPrint = prettyPrint(args[0]),
|
||||
code = _prettyPrint.code,
|
||||
mappings = _prettyPrint.mappings;
|
||||
|
||||
self.postMessage({
|
||||
id,
|
||||
response: {
|
||||
code,
|
||||
mappings: invertMappings(mappings)
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
self.postMessage({ id, error: e });
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }
|
||||
|
||||
/******/ })
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -42,6 +42,7 @@ support-files =
|
||||
[browser_dbg-breakpoints.js]
|
||||
[browser_dbg-breakpoints-cond.js]
|
||||
[browser_dbg-call-stack.js]
|
||||
[browser_dbg-expressions.js]
|
||||
[browser_dbg-scopes.js]
|
||||
[browser_dbg-chrome-create.js]
|
||||
[browser_dbg-chrome-debugging.js]
|
||||
|
@ -54,6 +54,6 @@ add_task(function* () {
|
||||
|
||||
button = toggleButton(dbg);
|
||||
frames = findAllElements(dbg, "frames");
|
||||
is(button.innerText, "Collapse Rows", "toggle button should be collapse");
|
||||
is(button.innerText, "Collapse Rows", "toggle button should be collapsed");
|
||||
is(frames.length, 22, "All of the frames should be shown");
|
||||
});
|
||||
|
@ -18,7 +18,9 @@ add_task(function* () {
|
||||
// Wait for the source text to load and make sure we're in the right
|
||||
// place.
|
||||
yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
|
||||
assertHighlightLocation(dbg, "long.js", 66);
|
||||
|
||||
// TODO: revisit highlighting lines when the debugger opens
|
||||
//assertHighlightLocation(dbg, "long.js", 66);
|
||||
|
||||
// Jump to line 16 and make sure the editor scrolled.
|
||||
yield selectSource(dbg, "long.js", 16);
|
||||
|
@ -50,5 +50,5 @@ add_task(function* () {
|
||||
invokeInTab("testModel");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, longSrc, 66);
|
||||
// ok(isElementVisible(dbg, "breakpoint"), "Breakpoint is visible");
|
||||
ok(isElementVisible(dbg, "breakpoint"), "Breakpoint is visible");
|
||||
});
|
||||
|
@ -1,12 +1,56 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
expressions
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
/**
|
||||
* tests the watch expressions component
|
||||
* 1. add watch expressions
|
||||
* 2. edit watch expressions
|
||||
* 3. delete watch expressions
|
||||
*/
|
||||
|
||||
const expressionSelectors = {
|
||||
input: "input.input-expression"
|
||||
};
|
||||
|
||||
function getLabel(dbg, index) {
|
||||
return findElement(dbg, "expressionNode", index).innerText;
|
||||
}
|
||||
|
||||
function getValue(dbg, index) {
|
||||
return findElement(dbg, "expressionValue", index).innerText;
|
||||
}
|
||||
|
||||
async function addExpression(dbg, input) {
|
||||
info("Adding an expression");
|
||||
findElementWithSelector(dbg, expressionSelectors.input).focus();
|
||||
type(dbg, input);
|
||||
pressKey(dbg, "Enter");
|
||||
|
||||
await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
|
||||
}
|
||||
|
||||
async function editExpression(dbg, input) {
|
||||
info("updating the expression");
|
||||
dblClickElement(dbg, "expressionNode", 1);
|
||||
type(dbg, input);
|
||||
pressKey(dbg, "Enter");
|
||||
await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
|
||||
}
|
||||
|
||||
add_task(function*() {
|
||||
setupTestRunner(this);
|
||||
yield expressions(this);
|
||||
const dbg = yield initDebugger("doc-script-switching.html");
|
||||
|
||||
invokeInTab("firstCall");
|
||||
yield waitForPaused(dbg);
|
||||
|
||||
yield addExpression(dbg, "f");
|
||||
is(getLabel(dbg, 1), "f");
|
||||
is(getValue(dbg, 1), "ReferenceError");
|
||||
|
||||
yield editExpression(dbg, "oo");
|
||||
is(getLabel(dbg, 1), "foo()");
|
||||
is(getValue(dbg, 1), "");
|
||||
|
||||
yield deleteExpression(dbg, "foo");
|
||||
is(findAllElements(dbg, "expressionNodes").length, 0);
|
||||
});
|
||||
|
@ -20,7 +20,6 @@ add_task(function* () {
|
||||
const dbg = yield initDebugger("doc-exceptions.html");
|
||||
|
||||
// test skipping an uncaught exception
|
||||
yield togglePauseOnExceptions(dbg, false, false);
|
||||
yield uncaughtException();
|
||||
ok(!isPaused(dbg));
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
// Tests basic pretty-printing functionality.
|
||||
|
||||
add_task(function* () {
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-minified.html");
|
||||
|
||||
yield selectSource(dbg, "math.min.js");
|
||||
|
@ -19,4 +19,13 @@ add_task(function* () {
|
||||
|
||||
is(getLabel(dbg, 1), "secondCall");
|
||||
is(getLabel(dbg, 2), "<this>");
|
||||
is(getLabel(dbg, 4), "foo()");
|
||||
|
||||
toggleNode(dbg, 4);
|
||||
yield waitForDispatch(dbg, "LOAD_OBJECT_PROPERTIES");
|
||||
is(getLabel(dbg, 5), "prototype");
|
||||
|
||||
yield stepOver(dbg);
|
||||
is(getLabel(dbg, 4), "foo()");
|
||||
is(getLabel(dbg, 5), "prototype");
|
||||
});
|
||||
|
@ -4,7 +4,10 @@
|
||||
// Test that an error while loading a sourcemap does not break
|
||||
// debugging.
|
||||
|
||||
add_task(function* () {
|
||||
add_task(function*() {
|
||||
// NOTE: the CORS call makes the test run times inconsistent
|
||||
requestLongerTimeout(2);
|
||||
|
||||
const dbg = yield initDebugger("doc-sourcemap-bogus.html");
|
||||
const { selectors: { getSources }, getState } = dbg;
|
||||
|
||||
|
@ -4,7 +4,10 @@
|
||||
// Tests loading sourcemapped sources, setting breakpoints, and
|
||||
// stepping in them.
|
||||
|
||||
add_task(function* () {
|
||||
add_task(function*() {
|
||||
// NOTE: the CORS call makes the test run times inconsistent
|
||||
requestLongerTimeout(2);
|
||||
|
||||
const dbg = yield initDebugger("doc-sourcemaps.html");
|
||||
const { selectors: { getBreakpoint, getBreakpoints }, getState } = dbg;
|
||||
|
||||
@ -13,21 +16,27 @@ add_task(function* () {
|
||||
const entrySrc = findSource(dbg, "entry.js");
|
||||
|
||||
yield selectSource(dbg, entrySrc);
|
||||
ok(dbg.win.cm.getValue().includes("window.keepMeAlive"),
|
||||
"Original source text loaded correctly");
|
||||
ok(
|
||||
dbg.win.cm.getValue().includes("window.keepMeAlive"),
|
||||
"Original source text loaded correctly"
|
||||
);
|
||||
|
||||
// Test that breakpoint sliding is not attempted. The breakpoint
|
||||
// should not move anywhere.
|
||||
yield addBreakpoint(dbg, entrySrc, 13);
|
||||
is(getBreakpoints(getState()).size, 1, "One breakpoint exists");
|
||||
ok(getBreakpoint(getState(), { sourceId: entrySrc.id, line: 13 }),
|
||||
"Breakpoint has correct line");
|
||||
ok(
|
||||
getBreakpoint(getState(), { sourceId: entrySrc.id, line: 13 }),
|
||||
"Breakpoint has correct line"
|
||||
);
|
||||
|
||||
// Test breaking on a breakpoint
|
||||
yield addBreakpoint(dbg, "entry.js", 15);
|
||||
is(getBreakpoints(getState()).size, 2, "Two breakpoints exist");
|
||||
ok(getBreakpoint(getState(), { sourceId: entrySrc.id, line: 15 }),
|
||||
"Breakpoint has correct line");
|
||||
ok(
|
||||
getBreakpoint(getState(), { sourceId: entrySrc.id, line: 15 }),
|
||||
"Breakpoint has correct line"
|
||||
);
|
||||
|
||||
invokeInTab("keepMeAlive");
|
||||
yield waitForPaused(dbg);
|
||||
|
@ -6,7 +6,10 @@
|
||||
|
||||
// This source map does not have source contents, so it's fetched separately
|
||||
|
||||
add_task(function* () {
|
||||
add_task(function*() {
|
||||
// NOTE: the CORS call makes the test run times inconsistent
|
||||
requestLongerTimeout(2);
|
||||
|
||||
const dbg = yield initDebugger("doc-sourcemaps2.html");
|
||||
const { selectors: { getBreakpoint, getBreakpoints }, getState } = dbg;
|
||||
|
||||
@ -20,8 +23,10 @@ add_task(function* () {
|
||||
// Test that breakpoint is not off by a line.
|
||||
yield addBreakpoint(dbg, mainSrc, 4);
|
||||
is(getBreakpoints(getState()).size, 1, "One breakpoint exists");
|
||||
ok(getBreakpoint(getState(), { sourceId: mainSrc.id, line: 4 }),
|
||||
"Breakpoint has correct line");
|
||||
ok(
|
||||
getBreakpoint(getState(), { sourceId: mainSrc.id, line: 4 }),
|
||||
"Breakpoint has correct line"
|
||||
);
|
||||
|
||||
invokeInTab("logMessage");
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
<body>
|
||||
<script>
|
||||
debugger;
|
||||
|
||||
// This inline script allows this HTML page to show up as a
|
||||
// source. It also needs to introduce a new global variable so
|
||||
// it's not immediately garbage collected.
|
||||
|
@ -33,13 +33,14 @@
|
||||
*/
|
||||
|
||||
// shared-head.js handles imports, constants, and utility functions
|
||||
Services.scriptloader.loadSubScript("chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js", this);
|
||||
Services.scriptloader.loadSubScript(
|
||||
"chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js",
|
||||
this
|
||||
);
|
||||
var { Toolbox } = require("devtools/client/framework/toolbox");
|
||||
const EXAMPLE_URL = "http://example.com/browser/devtools/client/debugger/new/test/mochitest/examples/";
|
||||
|
||||
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", true);
|
||||
Services.prefs.clearUserPref("devtools.debugger.tabs")
|
||||
Services.prefs.clearUserPref("devtools.debugger.pending-selected-location")
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
|
||||
@ -76,9 +77,9 @@ function _afterDispatchDone(store, type) {
|
||||
type: "@@service/waitUntil",
|
||||
predicate: action => {
|
||||
if (action.type === type) {
|
||||
return action.status ?
|
||||
(action.status === "done" || action.status === "error") :
|
||||
true;
|
||||
return action.status
|
||||
? action.status === "done" || action.status === "error"
|
||||
: true;
|
||||
}
|
||||
},
|
||||
run: (dispatch, getState, action) => {
|
||||
@ -102,7 +103,7 @@ function _afterDispatchDone(store, type) {
|
||||
function waitForDispatch(dbg, type, eventRepeat = 1) {
|
||||
let count = 0;
|
||||
|
||||
return Task.spawn(function* () {
|
||||
return Task.spawn(function*() {
|
||||
info("Waiting for " + type + " to dispatch " + eventRepeat + " time(s)");
|
||||
while (count < eventRepeat) {
|
||||
yield _afterDispatchDone(dbg.store, type);
|
||||
@ -170,21 +171,23 @@ function waitForSources(dbg, ...sources) {
|
||||
|
||||
info("Waiting on sources: " + sources.join(", "));
|
||||
const { selectors: { getSources }, store } = dbg;
|
||||
return Promise.all(sources.map(url => {
|
||||
function sourceExists(state) {
|
||||
return getSources(state).some(s => {
|
||||
return s.get("url").includes(url);
|
||||
});
|
||||
}
|
||||
return Promise.all(
|
||||
sources.map(url => {
|
||||
function sourceExists(state) {
|
||||
return getSources(state).some(s => {
|
||||
return s.get("url").includes(url);
|
||||
});
|
||||
}
|
||||
|
||||
if (!sourceExists(store.getState())) {
|
||||
return waitForState(dbg, sourceExists);
|
||||
}
|
||||
}));
|
||||
if (!sourceExists(store.getState())) {
|
||||
return waitForState(dbg, sourceExists);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
function waitForElement(dbg, selector) {
|
||||
return waitUntil(() => findElementWithSelector(dbg, selector))
|
||||
return waitUntil(() => findElementWithSelector(dbg, selector));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -209,8 +212,10 @@ function assertPausedLocation(dbg, source, line) {
|
||||
is(location.get("line"), line);
|
||||
|
||||
// Check the debug line
|
||||
ok(dbg.win.cm.lineInfo(line - 1).wrapClass.includes("debug-line"),
|
||||
"Line is highlighted as paused");
|
||||
ok(
|
||||
dbg.win.cm.lineInfo(line - 1).wrapClass.includes("debug-line"),
|
||||
"Line is highlighted as paused"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,10 +237,14 @@ function assertHighlightLocation(dbg, source, line) {
|
||||
// Check the highlight line
|
||||
const lineEl = findElement(dbg, "highlightLine");
|
||||
ok(lineEl, "Line is highlighted");
|
||||
// ok(isVisibleWithin(findElement(dbg, "codeMirror"), lineEl),
|
||||
// "Highlighted line is visible");
|
||||
ok(dbg.win.cm.lineInfo(line - 1).wrapClass.includes("highlight-line"),
|
||||
"Line is highlighted");
|
||||
ok(
|
||||
isVisibleWithin(findElement(dbg, "codeMirror"), lineEl),
|
||||
"Highlighted line is visible"
|
||||
);
|
||||
ok(
|
||||
dbg.win.cm.lineInfo(line - 1).wrapClass.includes("highlight-line"),
|
||||
"Line is highlighted"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -258,12 +267,11 @@ function isPaused(dbg) {
|
||||
* @static
|
||||
*/
|
||||
function waitForPaused(dbg) {
|
||||
return Task.spawn(function* () {
|
||||
return Task.spawn(function*() {
|
||||
// We want to make sure that we get both a real paused event and
|
||||
// that the state is fully populated. The client may do some more
|
||||
// work (call other client methods) before populating the state.
|
||||
yield waitForThreadEvents(dbg, "paused"),
|
||||
yield waitForState(dbg, state => {
|
||||
yield waitForThreadEvents(dbg, "paused"), yield waitForState(dbg, state => {
|
||||
const pause = dbg.selectors.getPause(state);
|
||||
// Make sure we have the paused state.
|
||||
if (!pause) {
|
||||
@ -279,15 +287,16 @@ function waitForPaused(dbg) {
|
||||
}
|
||||
|
||||
function createDebuggerContext(toolbox) {
|
||||
const win = toolbox.getPanel("jsdebugger").panelWin;
|
||||
const store = win.Debugger.store;
|
||||
const panel = toolbox.getPanel("jsdebugger");
|
||||
const win = panel.panelWin;
|
||||
const { store, client, selectors, actions } = panel.getVarsForTests();
|
||||
|
||||
return {
|
||||
actions: win.Debugger.actions,
|
||||
selectors: win.Debugger.selectors,
|
||||
actions: actions,
|
||||
selectors: selectors,
|
||||
getState: store.getState,
|
||||
store: store,
|
||||
client: win.Debugger.client,
|
||||
client: client,
|
||||
toolbox: toolbox,
|
||||
win: win
|
||||
};
|
||||
@ -303,9 +312,13 @@ function createDebuggerContext(toolbox) {
|
||||
* @static
|
||||
*/
|
||||
function initDebugger(url, ...sources) {
|
||||
return Task.spawn(function* () {
|
||||
Services.prefs.clearUserPref("devtools.debugger.tabs")
|
||||
Services.prefs.clearUserPref("devtools.debugger.pending-selected-location")
|
||||
return Task.spawn(function*() {
|
||||
Services.prefs.clearUserPref("devtools.debugger.pause-on-exceptions");
|
||||
Services.prefs.clearUserPref("devtools.debugger.ignore-caught-exceptions");
|
||||
Services.prefs.clearUserPref("devtools.debugger.tabs");
|
||||
Services.prefs.clearUserPref("devtools.debugger.pending-selected-location");
|
||||
Services.prefs.clearUserPref("devtools.debugger.pending-breakpoints");
|
||||
Services.prefs.clearUserPref("devtools.debugger.expressions");
|
||||
const toolbox = yield openNewTabAndToolbox(EXAMPLE_URL + url, "jsdebugger");
|
||||
return createDebuggerContext(toolbox);
|
||||
});
|
||||
@ -429,6 +442,11 @@ function resume(dbg) {
|
||||
return waitForThreadEvents(dbg, "resumed");
|
||||
}
|
||||
|
||||
function deleteExpression(dbg, input) {
|
||||
info("Resuming");
|
||||
return dbg.actions.deleteExpression({ input });
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the debuggee.
|
||||
*
|
||||
@ -500,8 +518,11 @@ function removeBreakpoint(dbg, sourceId, line, col) {
|
||||
* @return {Promise}
|
||||
* @static
|
||||
*/
|
||||
function togglePauseOnExceptions(dbg,
|
||||
pauseOnExceptions, ignoreCaughtExceptions) {
|
||||
function togglePauseOnExceptions(
|
||||
dbg,
|
||||
pauseOnExceptions,
|
||||
ignoreCaughtExceptions
|
||||
) {
|
||||
const command = dbg.actions.pauseOnExceptions(
|
||||
pauseOnExceptions,
|
||||
ignoreCaughtExceptions
|
||||
@ -526,7 +547,7 @@ function togglePauseOnExceptions(dbg,
|
||||
*/
|
||||
function invokeInTab(fnc) {
|
||||
info(`Invoking function ${fnc} in tab`);
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, fnc, function* (fnc) {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, fnc, function*(fnc) {
|
||||
content.wrappedJSObject[fnc](); // eslint-disable-line mozilla/no-cpows-in-tests, max-len
|
||||
});
|
||||
}
|
||||
@ -534,18 +555,21 @@ function invokeInTab(fnc) {
|
||||
const isLinux = Services.appinfo.OS === "Linux";
|
||||
const cmdOrCtrl = isLinux ? { ctrlKey: true } : { metaKey: true };
|
||||
const keyMappings = {
|
||||
sourceSearch: { code: "p", modifiers: cmdOrCtrl},
|
||||
fileSearch: { code: "f", modifiers: cmdOrCtrl},
|
||||
"Enter": { code: "VK_RETURN" },
|
||||
"Up": { code: "VK_UP" },
|
||||
"Down": { code: "VK_DOWN" },
|
||||
"Tab": { code: "VK_TAB" },
|
||||
"Escape": { code: "VK_ESCAPE" },
|
||||
sourceSearch: { code: "p", modifiers: cmdOrCtrl },
|
||||
fileSearch: { code: "f", modifiers: cmdOrCtrl },
|
||||
Enter: { code: "VK_RETURN" },
|
||||
Up: { code: "VK_UP" },
|
||||
Down: { code: "VK_DOWN" },
|
||||
Tab: { code: "VK_TAB" },
|
||||
Escape: { code: "VK_ESCAPE" },
|
||||
pauseKey: { code: "VK_F8" },
|
||||
resumeKey: { code: "VK_F8" },
|
||||
stepOverKey: { code: "VK_F10" },
|
||||
stepInKey: { code: "VK_F11", modifiers: { ctrlKey: isLinux }},
|
||||
stepOutKey: { code: "VK_F11", modifiers: { ctrlKey: isLinux, shiftKey: true }}
|
||||
stepInKey: { code: "VK_F11", modifiers: { ctrlKey: isLinux } },
|
||||
stepOutKey: {
|
||||
code: "VK_F11",
|
||||
modifiers: { ctrlKey: isLinux, shiftKey: true }
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -561,11 +585,7 @@ function pressKey(dbg, keyName) {
|
||||
let keyEvent = keyMappings[keyName];
|
||||
|
||||
const { code, modifiers } = keyEvent;
|
||||
return EventUtils.synthesizeKey(
|
||||
code,
|
||||
modifiers || {},
|
||||
dbg.win
|
||||
);
|
||||
return EventUtils.synthesizeKey(code, modifiers || {}, dbg.win);
|
||||
}
|
||||
|
||||
function type(dbg, string) {
|
||||
@ -577,14 +597,19 @@ function type(dbg, string) {
|
||||
function isVisibleWithin(outerEl, innerEl) {
|
||||
const innerRect = innerEl.getBoundingClientRect();
|
||||
const outerRect = outerEl.getBoundingClientRect();
|
||||
|
||||
return innerRect.top > outerRect.top &&
|
||||
innerRect.bottom < outerRect.bottom;
|
||||
return innerRect.top > outerRect.top && innerRect.bottom < outerRect.bottom;
|
||||
}
|
||||
|
||||
const selectors = {
|
||||
callStackHeader: ".call-stack-pane ._header",
|
||||
callStackBody: ".call-stack-pane .pane",
|
||||
expressionNode: i =>
|
||||
`.expressions-list .tree-node:nth-child(${i}) .object-label`,
|
||||
expressionValue: i =>
|
||||
`.expressions-list .tree-node:nth-child(${i}) .object-value`,
|
||||
expressionClose: i =>
|
||||
`.expressions-list .expression-container:nth-child(${i}) .close`,
|
||||
expressionNodes: ".expressions-list .tree-node",
|
||||
scopesHeader: ".scopes-pane ._header",
|
||||
breakpointItem: i => `.breakpoints-list .breakpoint:nth-child(${i})`,
|
||||
scopeNode: i => `.scopes-list .tree-node:nth-child(${i}) .object-label`,
|
||||
@ -605,7 +630,7 @@ const selectors = {
|
||||
sourceFooter: ".source-footer",
|
||||
sourceNode: i => `.sources-list .tree-node:nth-child(${i})`,
|
||||
sourceNodes: ".sources-list .tree-node",
|
||||
sourceArrow: i => `.sources-list .tree-node:nth-child(${i}) .arrow`,
|
||||
sourceArrow: i => `.sources-list .tree-node:nth-child(${i}) .arrow`
|
||||
};
|
||||
|
||||
function getSelector(elementName, ...args) {
|
||||
@ -647,6 +672,9 @@ function findAllElements(dbg, elementName, ...args) {
|
||||
*/
|
||||
function clickElement(dbg, elementName, ...args) {
|
||||
const selector = getSelector(elementName, ...args);
|
||||
const el = findElement(dbg, elementName, ...args);
|
||||
el.scrollIntoView();
|
||||
|
||||
return EventUtils.synthesizeMouseAtCenter(
|
||||
findElementWithSelector(dbg, selector),
|
||||
{},
|
||||
@ -654,12 +682,22 @@ function clickElement(dbg, elementName, ...args) {
|
||||
);
|
||||
}
|
||||
|
||||
function dblClickElement(dbg, elementName, ...args) {
|
||||
const selector = getSelector(elementName, ...args);
|
||||
|
||||
return EventUtils.synthesizeMouseAtCenter(
|
||||
findElementWithSelector(dbg, selector),
|
||||
{ clickCount: 2 },
|
||||
dbg.win
|
||||
);
|
||||
}
|
||||
|
||||
function rightClickElement(dbg, elementName, ...args) {
|
||||
const selector = getSelector(elementName, ...args);
|
||||
const doc = dbg.win.document;
|
||||
return EventUtils.synthesizeMouseAtCenter(
|
||||
doc.querySelector(selector),
|
||||
{type: "contextmenu"},
|
||||
{ type: "contextmenu" },
|
||||
dbg.win
|
||||
);
|
||||
}
|
||||
@ -669,10 +707,10 @@ function selectMenuItem(dbg, index) {
|
||||
const doc = dbg.toolbox.win.document;
|
||||
|
||||
// there are several context menus, we want the one with the menu-api
|
||||
const popup = doc.querySelector("menupopup[menu-api=\"true\"]");
|
||||
const popup = doc.querySelector('menupopup[menu-api="true"]');
|
||||
|
||||
const item = popup.querySelector(`menuitem:nth-child(${index})`);
|
||||
return EventUtils.synthesizeMouseAtCenter(item, {}, dbg.toolbox.win );
|
||||
return EventUtils.synthesizeMouseAtCenter(item, {}, dbg.toolbox.win);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,6 +124,10 @@ blackBoxCheckboxTooltip=Toggle black boxing
|
||||
# searching all the source files the debugger has seen.
|
||||
sources.search.key=P
|
||||
|
||||
# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger
|
||||
# does not have any sources.
|
||||
sources.noSourcesAvailable=This page has no sources
|
||||
|
||||
# LOCALIZATION NOTE (sources.searchAlt.key): Alternate key shortcut to open
|
||||
# the search for searching all the source files the debugger has seen.
|
||||
sources.searchAlt.key=O
|
||||
@ -235,10 +239,17 @@ callStack.expand=Expand Rows
|
||||
# for the summarizing the selected search result. e.g. 5 of 10 results.
|
||||
editor.searchResults=%d of %d results
|
||||
|
||||
# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.
|
||||
editor.singleResult=1 result
|
||||
|
||||
# LOCALIZATION NOTE (editor.noResults): Editor Search bar message
|
||||
# for when no results found.
|
||||
editor.noResults=no results
|
||||
|
||||
# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for
|
||||
# toggling search type buttons(function search, variable search)
|
||||
editor.searchTypeToggleTitle=Search for:
|
||||
|
||||
# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item
|
||||
# for adding a breakpoint on a line.
|
||||
editor.addBreakpoint=Add Breakpoint
|
||||
@ -271,9 +282,9 @@ editor.conditionalPanel.placeholder=This breakpoint will pause when the expressi
|
||||
# close button inside ConditionalPanel component
|
||||
editor.conditionalPanel.close=Cancel edit breakpoint and close
|
||||
|
||||
# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item
|
||||
# LOCALIZATION NOTE (editor.jumpToMappedLocation): Context menu item
|
||||
# for navigating to a source mapped location
|
||||
editor.jumpToMappedLocation1=Jump to %S location
|
||||
editor.jumpToMappedLocation=Jump to %s location
|
||||
|
||||
# LOCALIZATION NOTE (generated): Source Map term for a server source location
|
||||
generated=generated
|
||||
@ -341,6 +352,22 @@ sourceTabs.prettyPrint=Pretty Print Source
|
||||
# the editor context menu.
|
||||
sourceTabs.prettyPrint.accesskey=p
|
||||
|
||||
# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated
|
||||
# with the black box button
|
||||
sourceFooter.blackbox=Blackbox Source
|
||||
|
||||
# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated
|
||||
# with the black box button
|
||||
sourceFooter.unblackbox=Unblackbox Source
|
||||
|
||||
# LOCALIZATION NOTE (sourceFooter.blackbox.accesskey): Access key to black box
|
||||
# an associated source
|
||||
sourceFooter.blackbox.accesskey=b
|
||||
|
||||
# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated
|
||||
# with a blackboxed source
|
||||
sourceFooter.blackboxed=Blackboxed Source
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed
|
||||
# for close tab button in source tabs.
|
||||
sourceTabs.closeTabButtonTooltip=Close tab
|
||||
@ -393,10 +420,6 @@ sourceSearch.search=Search Sources…
|
||||
# message when the query did not match any of the sources.
|
||||
sourceSearch.noResults=No files matching %S found
|
||||
|
||||
# LOCALIZATION NOTE (sourceFooter.debugBtnTooltip): Tooltip text associated
|
||||
# with the pretty-print button
|
||||
sourceFooter.debugBtnTooltip=Prettify Source
|
||||
|
||||
# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip
|
||||
# when the debugger will not pause on exceptions.
|
||||
ignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions
|
||||
@ -508,8 +531,30 @@ watchExpressionsSeparatorLabel2=\u0020→
|
||||
# in the functions search panel as a separator between function's inferred name
|
||||
# and its real name (if available).
|
||||
functionSearchSeparatorLabel=←
|
||||
functionSearch.search.placeholder=Search Functions…
|
||||
functionSearch.search.key=O
|
||||
|
||||
# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder
|
||||
# text displayed when the user searches for functions in a file
|
||||
symbolSearch.search.functionsPlaceholder=Search functions…
|
||||
|
||||
# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder
|
||||
# text displayed when the user searches for variables in a file
|
||||
symbolSearch.search.variablesPlaceholder=Search variables…
|
||||
|
||||
# LOCALIZATION NOTE(symbolSearch.search.key): The shortcut (cmd+shift+o) for
|
||||
# searching for a function or variable
|
||||
symbolSearch.search.key=O
|
||||
|
||||
# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option
|
||||
# when searching text in a file
|
||||
symbolSearch.searchModifier.regex=Regex
|
||||
|
||||
# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option
|
||||
# when searching text in a file
|
||||
symbolSearch.searchModifier.caseSensitive=Case sensitive
|
||||
|
||||
# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option
|
||||
# when searching text in a file
|
||||
symbolSearch.searchModifier.wholeWord=Whole word
|
||||
|
||||
# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears
|
||||
# as a description in the notification panel popup, when multiple debuggers are
|
||||
@ -577,3 +622,7 @@ whyPaused.debugCommand=Paused on debugged function
|
||||
# in a info block explaining how the debugger is currently paused on an event
|
||||
# listener breakpoint set
|
||||
whyPaused.other=Debugger paused
|
||||
|
||||
# LOCALIZATION NOTE (ctrl): The text that is used for documenting
|
||||
# keyboard shortcuts that use the control key
|
||||
ctrl=Ctrl
|
||||
|
@ -1,7 +1,5 @@
|
||||
# -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
|
||||
# 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/.
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
#ifdef RELEASE_OR_BETA
|
||||
pref("devtools.debugger.new-debugger-frontend", false);
|
||||
@ -17,7 +15,7 @@ pref("devtools.debugger.chrome-debugging-websocket", false);
|
||||
pref("devtools.debugger.remote-host", "localhost");
|
||||
pref("devtools.debugger.remote-timeout", 20000);
|
||||
pref("devtools.debugger.pause-on-exceptions", false);
|
||||
pref("devtools.debugger.ignore-caught-exceptions", true);
|
||||
pref("devtools.debugger.ignore-caught-exceptions", false);
|
||||
pref("devtools.debugger.source-maps-enabled", true);
|
||||
pref("devtools.debugger.client-source-maps-enabled", true);
|
||||
pref("devtools.debugger.pretty-print-enabled", true);
|
||||
@ -38,4 +36,5 @@ pref("devtools.debugger.start-panel-collapsed", false);
|
||||
pref("devtools.debugger.end-panel-collapsed", false);
|
||||
pref("devtools.debugger.tabs", "[]");
|
||||
pref("devtools.debugger.pending-selected-location", "{}");
|
||||
|
||||
pref("devtools.debugger.pending-breakpoints", "[]");
|
||||
pref("devtools.debugger.expressions", "[]");
|
||||
|
@ -59,10 +59,10 @@ exports.viewSourceInDebugger = Task.async(function* (toolbox, sourceURL, sourceL
|
||||
|
||||
// New debugger frontend
|
||||
if (Services.prefs.getBoolPref("devtools.debugger.new-debugger-frontend")) {
|
||||
const source = dbg._selectors().getSourceByURL(dbg._getState(), sourceURL);
|
||||
const source = dbg.getSource(sourceURL);
|
||||
if (source) {
|
||||
yield toolbox.selectTool("jsdebugger");
|
||||
dbg._actions().selectSourceURL(sourceURL, { line: sourceLine });
|
||||
dbg.selectSource(sourceURL, sourceLine);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ function* checkClickOnNode(hud, toolbox, frameLinkNode) {
|
||||
|
||||
let dbg = toolbox.getPanel("jsdebugger");
|
||||
is(
|
||||
dbg._selectors().getSelectedSource(dbg._getState()).get("url"),
|
||||
dbg._selectors.getSelectedSource(dbg._getState()).get("url"),
|
||||
url,
|
||||
"expected source url"
|
||||
);
|
||||
|
@ -56,7 +56,7 @@ function* checkClickOnNode(hud, toolbox, frameLinkNode) {
|
||||
let url = frameLinkNode.getAttribute("data-url");
|
||||
let dbg = toolbox.getPanel("jsdebugger");
|
||||
is(
|
||||
dbg._selectors().getSelectedSource(dbg._getState()).get("url"),
|
||||
dbg._selectors.getSelectedSource(dbg._getState()).get("url"),
|
||||
url,
|
||||
`Debugger is opened at expected source url (${url})`
|
||||
);
|
||||
|
@ -81,7 +81,7 @@ function test() {
|
||||
|
||||
let toolbox = yield gDevTools.getToolbox(hud.target);
|
||||
let dbg = toolbox.getPanel("jsdebugger");
|
||||
is(dbg._selectors().getSelectedSource(dbg._getState()).get("url"),
|
||||
is(dbg._selectors.getSelectedSource(dbg._getState()).get("url"),
|
||||
url,
|
||||
"expected source url");
|
||||
}
|
||||
|
@ -1788,7 +1788,7 @@ nsDocShell::MaybeInitTiming()
|
||||
}
|
||||
|
||||
if (!mTiming) {
|
||||
mTiming = new nsDOMNavigationTiming();
|
||||
mTiming = new nsDOMNavigationTiming(this);
|
||||
canBeReset = true;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "jsfriendapi.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/CondVar.h"
|
||||
#include "mozilla/CycleCollectedJSContext.h"
|
||||
#include "mozilla/CycleCollectedJSRuntime.h"
|
||||
#include "mozilla/dom/asmjscache/PAsmJSCacheEntryChild.h"
|
||||
#include "mozilla/dom/asmjscache/PAsmJSCacheEntryParent.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
|
@ -1308,6 +1308,8 @@ public:
|
||||
// update mFirstChild before calling UnbindFromTree, since this last
|
||||
// can notify various observers and they should really see consistent
|
||||
// tree state.
|
||||
// If this code changes, change the corresponding code in
|
||||
// FragmentOrElement's and nsDocument's unlink impls.
|
||||
nsCOMPtr<nsIContent> child =
|
||||
container->mAttrsAndChildren.TakeChildAt(childCount);
|
||||
if (childCount == 0) {
|
||||
@ -1421,6 +1423,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
|
||||
// update mFirstChild before calling UnbindFromTree, since this last
|
||||
// can notify various observers and they should really see consistent
|
||||
// tree state.
|
||||
// If this code changes, change the corresponding code in nsDocument's
|
||||
// unlink impl and ContentUnbinder::UnbindSubtree.
|
||||
nsCOMPtr<nsIContent> child = tmp->mAttrsAndChildren.TakeChildAt(childCount);
|
||||
if (childCount == 0) {
|
||||
tmp->mFirstChild = nullptr;
|
||||
|
@ -34,6 +34,7 @@ Link::Link(Element *aElement)
|
||||
, mNeedsRegistration(false)
|
||||
, mRegistered(false)
|
||||
, mHasPendingLinkUpdate(false)
|
||||
, mInDNSPrefetch(false)
|
||||
{
|
||||
MOZ_ASSERT(mElement, "Must have an element");
|
||||
}
|
||||
@ -45,11 +46,17 @@ Link::Link()
|
||||
, mNeedsRegistration(false)
|
||||
, mRegistered(false)
|
||||
, mHasPendingLinkUpdate(false)
|
||||
, mInDNSPrefetch(false)
|
||||
{
|
||||
}
|
||||
|
||||
Link::~Link()
|
||||
{
|
||||
// !mElement is for mock_Link.
|
||||
MOZ_ASSERT(!mElement || !mElement->IsInComposedDoc());
|
||||
if (IsInDNSPrefetch()) {
|
||||
nsHTMLDNSPrefetch::LinkDestroyed(this);
|
||||
}
|
||||
UnregisterFromHistory();
|
||||
}
|
||||
|
||||
|
@ -136,6 +136,10 @@ public:
|
||||
// If you change this, change also the method in Element.
|
||||
virtual void NodeInfoChanged(nsIDocument* aOldDoc) = 0;
|
||||
|
||||
bool IsInDNSPrefetch() { return mInDNSPrefetch; }
|
||||
void SetIsInDNSPrefetch() { mInDNSPrefetch = true; }
|
||||
void ClearIsInDNSPrefetch() { mInDNSPrefetch = false; }
|
||||
|
||||
protected:
|
||||
virtual ~Link();
|
||||
|
||||
@ -179,6 +183,8 @@ private:
|
||||
bool mRegistered : 1;
|
||||
|
||||
bool mHasPendingLinkUpdate : 1;
|
||||
|
||||
bool mInDNSPrefetch : 1;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(Link, MOZILLA_DOM_LINK_IMPLEMENTATION_IID)
|
||||
|
@ -1011,7 +1011,7 @@ nsContentUtils::InternalSerializeAutocompleteAttribute(const nsAttrValue* aAttrV
|
||||
}
|
||||
|
||||
// Normal category
|
||||
if (numTokens > 2) {
|
||||
if (numTokens > 3) {
|
||||
return eAutocompleteAttrState_Invalid;
|
||||
}
|
||||
category = eAutocompleteCategory_NORMAL;
|
||||
@ -1022,7 +1022,7 @@ nsContentUtils::InternalSerializeAutocompleteAttribute(const nsAttrValue* aAttrV
|
||||
}
|
||||
|
||||
result = enumValue.ParseEnumValue(tokenString, kAutocompleteContactFieldNameTable, false);
|
||||
if (!result || numTokens > 3) {
|
||||
if (!result || numTokens > 4) {
|
||||
return eAutocompleteAttrState_Invalid;
|
||||
}
|
||||
|
||||
@ -1068,9 +1068,21 @@ nsContentUtils::InternalSerializeAutocompleteAttribute(const nsAttrValue* aAttrV
|
||||
return eAutocompleteAttrState_Valid;
|
||||
}
|
||||
--index;
|
||||
tokenString = nsDependentAtomString(aAttrVal->AtomAt(index));
|
||||
}
|
||||
|
||||
// Check for section-* token
|
||||
const nsDependentSubstring& section = Substring(tokenString, 0, 8);
|
||||
if (section.LowerCaseEqualsASCII("section-")) {
|
||||
ASCIIToLower(tokenString);
|
||||
aInfo.mSection.Assign(tokenString);
|
||||
if (index == 0) {
|
||||
return eAutocompleteAttrState_Valid;
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the fields as the autocomplete attribute is invalid.
|
||||
aInfo.mSection.Truncate();
|
||||
aInfo.mAddressType.Truncate();
|
||||
aInfo.mContactType.Truncate();
|
||||
aInfo.mFieldName.Truncate();
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include "GeckoProfiler.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "prtime.h"
|
||||
#include "nsIURI.h"
|
||||
@ -19,9 +21,11 @@
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
nsDOMNavigationTiming::nsDOMNavigationTiming()
|
||||
nsDOMNavigationTiming::nsDOMNavigationTiming(nsDocShell* aDocShell)
|
||||
{
|
||||
Clear();
|
||||
|
||||
mDocShell = aDocShell;
|
||||
}
|
||||
|
||||
nsDOMNavigationTiming::~nsDOMNavigationTiming()
|
||||
@ -118,6 +122,11 @@ nsDOMNavigationTiming::NotifyLoadEventStart()
|
||||
if (!mLoadEventStartSet) {
|
||||
mLoadEventStart = DurationFromStart();
|
||||
mLoadEventStartSet = true;
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_LOAD_EVENT_START_MS,
|
||||
mNavigationStartTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,6 +136,11 @@ nsDOMNavigationTiming::NotifyLoadEventEnd()
|
||||
if (!mLoadEventEndSet) {
|
||||
mLoadEventEnd = DurationFromStart();
|
||||
mLoadEventEndSet = true;
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_LOAD_EVENT_END_MS,
|
||||
mNavigationStartTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,6 +161,11 @@ nsDOMNavigationTiming::NotifyDOMLoading(nsIURI* aURI)
|
||||
mLoadedURI = aURI;
|
||||
mDOMLoading = DurationFromStart();
|
||||
mDOMLoadingSet = true;
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_LOADING_MS,
|
||||
mNavigationStartTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,6 +176,11 @@ nsDOMNavigationTiming::NotifyDOMInteractive(nsIURI* aURI)
|
||||
mLoadedURI = aURI;
|
||||
mDOMInteractive = DurationFromStart();
|
||||
mDOMInteractiveSet = true;
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_INTERACTIVE_MS,
|
||||
mNavigationStartTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,6 +191,11 @@ nsDOMNavigationTiming::NotifyDOMComplete(nsIURI* aURI)
|
||||
mLoadedURI = aURI;
|
||||
mDOMComplete = DurationFromStart();
|
||||
mDOMCompleteSet = true;
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_COMPLETE_MS,
|
||||
mNavigationStartTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,6 +206,11 @@ nsDOMNavigationTiming::NotifyDOMContentLoadedStart(nsIURI* aURI)
|
||||
mLoadedURI = aURI;
|
||||
mDOMContentLoadedEventStart = DurationFromStart();
|
||||
mDOMContentLoadedEventStartSet = true;
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_CONTENT_LOADED_START_MS,
|
||||
mNavigationStartTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,6 +221,11 @@ nsDOMNavigationTiming::NotifyDOMContentLoadedEnd(nsIURI* aURI)
|
||||
mLoadedURI = aURI;
|
||||
mDOMContentLoadedEventEnd = DurationFromStart();
|
||||
mDOMContentLoadedEventEndSet = true;
|
||||
|
||||
if (IsTopLevelContentDocument()) {
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_CONTENT_LOADED_END_MS,
|
||||
mNavigationStartTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,3 +288,17 @@ nsDOMNavigationTiming::GetUnloadEventEnd()
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDOMNavigationTiming::IsTopLevelContentDocument() const
|
||||
{
|
||||
if (!mDocShell) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootItem;
|
||||
Unused << mDocShell->GetSameTypeRootTreeItem(getter_AddRefs(rootItem));
|
||||
if (rootItem.get() != static_cast<nsIDocShellTreeItem*>(mDocShell.get())) {
|
||||
return false;
|
||||
}
|
||||
return rootItem->ItemType() == nsIDocShellTreeItem::typeContent;
|
||||
}
|
||||
|
@ -9,8 +9,10 @@
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
||||
class nsDocShell;
|
||||
class nsIURI;
|
||||
|
||||
typedef unsigned long long DOMTimeMilliSec;
|
||||
@ -26,7 +28,7 @@ public:
|
||||
TYPE_RESERVED = 255,
|
||||
};
|
||||
|
||||
nsDOMNavigationTiming();
|
||||
explicit nsDOMNavigationTiming(nsDocShell* aDocShell);
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(nsDOMNavigationTiming)
|
||||
|
||||
@ -120,6 +122,10 @@ private:
|
||||
|
||||
void Clear();
|
||||
|
||||
bool IsTopLevelContentDocument() const;
|
||||
|
||||
mozilla::WeakPtr<nsDocShell> mDocShell;
|
||||
|
||||
nsCOMPtr<nsIURI> mUnloadedURI;
|
||||
nsCOMPtr<nsIURI> mLoadedURI;
|
||||
|
||||
|
@ -1883,10 +1883,22 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
|
||||
nsINode::Unlink(tmp);
|
||||
|
||||
// Unlink the mChildren nsAttrAndChildArray.
|
||||
for (int32_t indx = int32_t(tmp->mChildren.ChildCount()) - 1;
|
||||
indx >= 0; --indx) {
|
||||
tmp->mChildren.ChildAt(indx)->UnbindFromTree();
|
||||
tmp->mChildren.RemoveChildAt(indx);
|
||||
uint32_t childCount = tmp->mChildren.ChildCount();
|
||||
if (childCount) {
|
||||
while (childCount-- > 0) {
|
||||
// Hold a strong ref to the node when we remove it, because we may be
|
||||
// the last reference to it. We need to call TakeChildAt() and
|
||||
// update mFirstChild before calling UnbindFromTree, since this last
|
||||
// can notify various observers and they should really see consistent
|
||||
// tree state.
|
||||
// If this code changes, change the corresponding code in
|
||||
// FragmentOrElement's unlink impl and ContentUnbinder::UnbindSubtree.
|
||||
nsCOMPtr<nsIContent> child = tmp->mChildren.TakeChildAt(childCount);
|
||||
if (childCount == 0) {
|
||||
tmp->mFirstChild = nullptr;
|
||||
}
|
||||
child->UnbindFromTree();
|
||||
}
|
||||
}
|
||||
tmp->mFirstChild = nullptr;
|
||||
|
||||
|
4
dom/cache/CacheStreamControlParent.cpp
vendored
4
dom/cache/CacheStreamControlParent.cpp
vendored
@ -62,8 +62,8 @@ CacheStreamControlParent::SerializeStream(CacheReadStream* aReadStreamOut,
|
||||
MOZ_DIAGNOSTIC_ASSERT(aStream);
|
||||
|
||||
UniquePtr<AutoIPCStream> autoStream(new AutoIPCStream(aReadStreamOut->stream()));
|
||||
bool ok = autoStream->Serialize(aStream, Manager());
|
||||
MOZ_DIAGNOSTIC_ASSERT(ok);
|
||||
DebugOnly<bool> ok = autoStream->Serialize(aStream, Manager());
|
||||
MOZ_ASSERT(ok);
|
||||
|
||||
aStreamCleanupList.AppendElement(Move(autoStream));
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "mozilla/AddonPathService.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/CycleCollectedJSContext.h"
|
||||
#include "mozilla/CycleCollectedJSRuntime.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
|
@ -52,12 +52,14 @@ InternalHeaders::Append(const nsACString& aName, const nsACString& aValue,
|
||||
{
|
||||
nsAutoCString lowerName;
|
||||
ToLowerCase(aName, lowerName);
|
||||
nsAutoCString trimValue;
|
||||
NS_TrimHTTPWhitespace(aValue, trimValue);
|
||||
|
||||
if (IsInvalidMutableHeader(lowerName, aValue, aRv)) {
|
||||
if (IsInvalidMutableHeader(lowerName, trimValue, aRv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
mList.AppendElement(Entry(lowerName, aValue));
|
||||
mList.AppendElement(Entry(lowerName, trimValue));
|
||||
}
|
||||
|
||||
void
|
||||
@ -151,8 +153,10 @@ InternalHeaders::Set(const nsACString& aName, const nsACString& aValue, ErrorRes
|
||||
{
|
||||
nsAutoCString lowerName;
|
||||
ToLowerCase(aName, lowerName);
|
||||
nsAutoCString trimValue;
|
||||
NS_TrimHTTPWhitespace(aValue, trimValue);
|
||||
|
||||
if (IsInvalidMutableHeader(lowerName, aValue, aRv)) {
|
||||
if (IsInvalidMutableHeader(lowerName, trimValue, aRv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -169,9 +173,9 @@ InternalHeaders::Set(const nsACString& aName, const nsACString& aValue, ErrorRes
|
||||
if (firstIndex < INT32_MAX) {
|
||||
Entry* entry = mList.InsertElementAt(firstIndex);
|
||||
entry->mName = lowerName;
|
||||
entry->mValue = aValue;
|
||||
entry->mValue = trimValue;
|
||||
} else {
|
||||
mList.AppendElement(Entry(lowerName, aValue));
|
||||
mList.AppendElement(Entry(lowerName, trimValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,8 +127,8 @@ InternalResponse::ToIPC(IPCInternalResponse* aIPCResponse,
|
||||
|
||||
if (body) {
|
||||
aAutoStream.reset(new mozilla::ipc::AutoIPCStream(aIPCResponse->body()));
|
||||
bool ok = aAutoStream->Serialize(body, aManager);
|
||||
MOZ_DIAGNOSTIC_ASSERT(ok);
|
||||
DebugOnly<bool> ok = aAutoStream->Serialize(body, aManager);
|
||||
MOZ_ASSERT(ok);
|
||||
} else {
|
||||
aIPCResponse->body() = void_t();
|
||||
}
|
||||
|
@ -247,6 +247,15 @@ nsHTMLDNSPrefetch::CancelPrefetchLow(const nsAString &hostname,
|
||||
aReason);
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLDNSPrefetch::LinkDestroyed(Link* aLink)
|
||||
{
|
||||
MOZ_ASSERT(aLink->IsInDNSPrefetch());
|
||||
if (sPrefetches) {
|
||||
// Clean up all the possible links at once.
|
||||
sPrefetches->RemoveUnboundLinks();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -291,6 +300,9 @@ void
|
||||
nsHTMLDNSPrefetch::nsDeferrals::Flush()
|
||||
{
|
||||
while (mHead != mTail) {
|
||||
if (mEntries[mTail].mElement) {
|
||||
mEntries[mTail].mElement->ClearIsInDNSPrefetch();
|
||||
}
|
||||
mEntries[mTail].mElement = nullptr;
|
||||
mTail = (mTail + 1) & sMaxDeferredMask;
|
||||
}
|
||||
@ -306,9 +318,10 @@ nsHTMLDNSPrefetch::nsDeferrals::Add(uint16_t flags, Link *aElement)
|
||||
|
||||
if (((mHead + 1) & sMaxDeferredMask) == mTail)
|
||||
return NS_ERROR_DNS_LOOKUP_QUEUE_FULL;
|
||||
|
||||
|
||||
aElement->SetIsInDNSPrefetch();
|
||||
mEntries[mHead].mFlags = flags;
|
||||
mEntries[mHead].mElement = do_GetWeakReference(aElement);
|
||||
mEntries[mHead].mElement = aElement;
|
||||
mHead = (mHead + 1) & sMaxDeferredMask;
|
||||
|
||||
if (!mActiveLoaderCount && !mTimerArmed && mTimer) {
|
||||
@ -328,9 +341,9 @@ nsHTMLDNSPrefetch::nsDeferrals::SubmitQueue()
|
||||
if (!sDNSService) return;
|
||||
|
||||
while (mHead != mTail) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryReferent(mEntries[mTail].mElement);
|
||||
if (content) {
|
||||
nsCOMPtr<Link> link = do_QueryInterface(content);
|
||||
nsCOMPtr<Link> link = mEntries[mTail].mElement;
|
||||
if (link) {
|
||||
link->ClearIsInDNSPrefetch();
|
||||
// Only prefetch here if request was deferred and deferral not cancelled
|
||||
if (link && link->HasDeferredDNSPrefetchRequest()) {
|
||||
nsCOMPtr<nsIURI> hrefURI(link ? link->GetURI() : nullptr);
|
||||
@ -400,6 +413,20 @@ nsHTMLDNSPrefetch::nsDeferrals::Activate()
|
||||
observerService->AddObserver(this, "xpcom-shutdown", true);
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLDNSPrefetch::nsDeferrals::RemoveUnboundLinks()
|
||||
{
|
||||
uint16_t tail = mTail;
|
||||
while (mHead != tail) {
|
||||
if (mEntries[tail].mElement &&
|
||||
!mEntries[tail].mElement->GetElement()->IsInComposedDoc()) {
|
||||
mEntries[tail].mElement->ClearIsInDNSPrefetch();
|
||||
mEntries[tail].mElement = nullptr;
|
||||
}
|
||||
tail = (tail + 1) & sMaxDeferredMask;
|
||||
}
|
||||
}
|
||||
|
||||
// nsITimer related method
|
||||
|
||||
void
|
||||
|
@ -63,6 +63,8 @@ public:
|
||||
static nsresult CancelPrefetchLow(mozilla::dom::Link *aElement,
|
||||
nsresult aReason);
|
||||
|
||||
static void LinkDestroyed(mozilla::dom::Link* aLink);
|
||||
|
||||
private:
|
||||
static nsresult Prefetch(const nsAString &host,
|
||||
const mozilla::OriginAttributes &aOriginAttributes,
|
||||
@ -103,6 +105,8 @@ public:
|
||||
void Activate();
|
||||
nsresult Add(uint16_t flags, mozilla::dom::Link *aElement);
|
||||
|
||||
void RemoveUnboundLinks();
|
||||
|
||||
private:
|
||||
~nsDeferrals();
|
||||
void Flush();
|
||||
@ -123,7 +127,8 @@ public:
|
||||
struct deferred_entry
|
||||
{
|
||||
uint16_t mFlags;
|
||||
nsWeakPtr mElement;
|
||||
// Link implementation clears this raw pointer in its destructor.
|
||||
mozilla::dom::Link* mElement;
|
||||
} mEntries[sMaxDeferred];
|
||||
};
|
||||
|
||||
|
@ -33,6 +33,7 @@ var values = [
|
||||
["username", {fieldName: "username" }],
|
||||
[" username ", {fieldName: "username" }],
|
||||
["foobar", {}],
|
||||
["section-blue", {}],
|
||||
|
||||
// Two tokens
|
||||
["on off", {}],
|
||||
@ -48,6 +49,10 @@ var values = [
|
||||
[" MoBiLe TeL ", {contactType: "mobile", fieldName: "tel"}],
|
||||
["XXX tel", {}],
|
||||
["XXX username", {}],
|
||||
["name section-blue", {}],
|
||||
["scetion-blue cc-name", {}],
|
||||
["section-blue name", {section: "section-blue", fieldName: "name"}],
|
||||
["section-blue tel", {section: "section-blue", fieldName: "tel"}],
|
||||
|
||||
// Three tokens
|
||||
["billing invalid tel", {}],
|
||||
@ -58,12 +63,22 @@ var values = [
|
||||
["billing mobile tel", {addressType: "billing", contactType: "mobile", fieldName: "tel"}],
|
||||
[" BILLing MoBiLE tEl ", {addressType: "billing", contactType: "mobile", fieldName: "tel"}],
|
||||
["billing home tel", {addressType: "billing", contactType: "home", fieldName: "tel"}],
|
||||
["home section-blue tel", {}],
|
||||
["setion-blue work email", {}],
|
||||
["section-blue home address-level2", {}],
|
||||
["section-blue shipping name", {section: "section-blue", addressType: "shipping", fieldName: "name"}],
|
||||
["section-blue mobile tel", {section: "section-blue", contactType: "mobile", fieldName: "tel"}],
|
||||
|
||||
// Four tokens (invalid)
|
||||
// Four tokens
|
||||
["billing billing mobile tel", {}],
|
||||
["name section-blue shipping home", {}],
|
||||
["secti shipping work address-line1", {}],
|
||||
["section-blue shipping home name", {}],
|
||||
["section-blue shipping mobile tel", {section: "section-blue", addressType: "shipping", contactType: "mobile", fieldName: "tel"}],
|
||||
|
||||
// Five tokens (invalid)
|
||||
["billing billing billing mobile tel", {}],
|
||||
["section-blue section-blue billing mobile tel", {}],
|
||||
];
|
||||
|
||||
var autocompleteEnabledTypes = ["hidden", "text", "search", "url", "tel",
|
||||
|
@ -25,6 +25,7 @@ var values = [
|
||||
["username", "username"],
|
||||
[" username ", "username"],
|
||||
["foobar", ""],
|
||||
["section-blue", ""],
|
||||
|
||||
// Two tokens
|
||||
["on off", ""],
|
||||
@ -40,6 +41,10 @@ var values = [
|
||||
[" MoBiLe TeL ", "mobile tel"],
|
||||
["XXX tel", ""],
|
||||
["XXX username", ""],
|
||||
["name section-blue", ""],
|
||||
["scetion-blue cc-name", ""],
|
||||
["section-blue name", "section-blue name"],
|
||||
["section-blue tel", "section-blue tel"],
|
||||
|
||||
// Three tokens
|
||||
["billing invalid tel", ""],
|
||||
@ -50,12 +55,22 @@ var values = [
|
||||
["billing mobile tel", "billing mobile tel"],
|
||||
[" BILLing MoBiLE tEl ", "billing mobile tel"],
|
||||
["billing home tel", "billing home tel"],
|
||||
["home section-blue tel", ""],
|
||||
["setion-blue work email", ""],
|
||||
["section-blue home address-level2", ""],
|
||||
["section-blue shipping name", "section-blue shipping name"],
|
||||
["section-blue mobile tel", "section-blue mobile tel"],
|
||||
|
||||
// Four tokens (invalid)
|
||||
// Four tokens
|
||||
["billing billing mobile tel", ""],
|
||||
["name section-blue shipping home", ""],
|
||||
["secti shipping work address-line1", ""],
|
||||
["section-blue shipping home name", ""],
|
||||
["section-blue shipping mobile tel", "section-blue shipping mobile tel"],
|
||||
|
||||
// Five tokens (invalid)
|
||||
["billing billing billing mobile tel", ""],
|
||||
["section-blue section-blue billing mobile tel", ""],
|
||||
];
|
||||
|
||||
var types = [undefined, "hidden", "text", "search"]; // Valid types for all non-multiline hints.
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "IndexedDatabase.h"
|
||||
#include "IndexedDatabaseInlines.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/CycleCollectedJSRuntime.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/Casting.h"
|
||||
#include "mozilla/CycleCollectedJSRuntime.h"
|
||||
#include "mozilla/EndianUtils.h"
|
||||
#include "mozilla/LazyIdleThread.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
|
@ -164,6 +164,11 @@ VideoDecoderParent::ProcessDecodedData(
|
||||
{
|
||||
MOZ_ASSERT(OnManagerThread());
|
||||
|
||||
// If the video decoder bridge has shut down, stop.
|
||||
if (!mKnowsCompositor->GetTextureForwarder()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& data : aData) {
|
||||
MOZ_ASSERT(data->mType == MediaData::VIDEO_DATA,
|
||||
"Can only decode videos using VideoDecoderParent!");
|
||||
|
@ -6,6 +6,11 @@
|
||||
|
||||
#include "PerformanceTiming.h"
|
||||
#include "mozilla/dom/PerformanceTimingBinding.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsITimedChannel.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -47,6 +52,15 @@ PerformanceTiming::PerformanceTiming(Performance* aPerformance,
|
||||
}
|
||||
|
||||
InitializeTimingInfo(aChannel);
|
||||
|
||||
// Non-null aHttpChannel implies that this PerformanceTiming object is being
|
||||
// used for subresources, which is irrelevant to this probe.
|
||||
if (!aHttpChannel &&
|
||||
nsContentUtils::IsPerformanceTimingEnabled() &&
|
||||
IsTopLevelContentDocument()) {
|
||||
Telemetry::Accumulate(Telemetry::TIME_TO_RESPONSE_START_MS,
|
||||
ResponseStartHighRes() - mZeroTime);
|
||||
}
|
||||
}
|
||||
|
||||
// Copy the timing info from the channel so we don't need to keep the channel
|
||||
@ -357,5 +371,24 @@ PerformanceTiming::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
|
||||
return PerformanceTimingBinding::Wrap(cx, this, aGivenProto);
|
||||
}
|
||||
|
||||
bool
|
||||
PerformanceTiming::IsTopLevelContentDocument() const
|
||||
{
|
||||
nsCOMPtr<nsIDocument> document = mPerformance->GetDocumentIfCurrent();
|
||||
if (!document) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIDocShell> docShell = document->GetDocShell();
|
||||
if (!docShell) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootItem;
|
||||
Unused << docShell->GetSameTypeRootTreeItem(getter_AddRefs(rootItem));
|
||||
if (rootItem.get() != static_cast<nsIDocShellTreeItem*>(docShell.get())) {
|
||||
return false;
|
||||
}
|
||||
return rootItem->ItemType() == nsIDocShellTreeItem::typeContent;
|
||||
}
|
||||
|
||||
} // dom namespace
|
||||
} // mozilla namespace
|
||||
|
@ -240,6 +240,8 @@ private:
|
||||
bool IsInitialized() const;
|
||||
void InitializeTimingInfo(nsITimedChannel* aChannel);
|
||||
|
||||
bool IsTopLevelContentDocument() const;
|
||||
|
||||
RefPtr<Performance> mPerformance;
|
||||
DOMHighResTimeStamp mFetchStart;
|
||||
|
||||
|
@ -83,7 +83,7 @@ MediateRace(const MessageChannel::MessageInfo& parent,
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
static string
|
||||
ReplaceAll(const string& haystack, const string& needle, const string& with)
|
||||
{
|
||||
@ -102,7 +102,7 @@ ReplaceAll(const string& haystack, const string& needle, const string& with)
|
||||
string
|
||||
MungePluginDsoPath(const string& path)
|
||||
{
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=519601
|
||||
return ReplaceAll(path, "netscape", "netsc@pe");
|
||||
#else
|
||||
@ -113,7 +113,7 @@ MungePluginDsoPath(const string& path)
|
||||
string
|
||||
UnmungePluginDsoPath(const string& munged)
|
||||
{
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
return ReplaceAll(munged, "netsc@pe", "netscape");
|
||||
#else
|
||||
return munged;
|
||||
|
@ -286,7 +286,7 @@ PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
|
||||
|
||||
// TODO: use PluginPRLibrary here
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||
mShutdownFunc =
|
||||
(NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
|
||||
|
||||
@ -1794,7 +1794,7 @@ PluginModuleChild::AnswerNP_GetEntryPoints(NPError* _retval)
|
||||
AssertPluginThread();
|
||||
MOZ_ASSERT(mIsChrome);
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||
return IPC_OK();
|
||||
#elif defined(OS_WIN) || defined(OS_MACOSX)
|
||||
*_retval = mGetEntryPointsFunc(&mFunctions);
|
||||
@ -1842,7 +1842,7 @@ PluginModuleChild::DoNP_Initialize(const PluginSettings& aSettings)
|
||||
#endif
|
||||
|
||||
NPError result;
|
||||
#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||
result = mInitializeFunc(&sBrowserFuncs, &mFunctions);
|
||||
#elif defined(OS_WIN) || defined(OS_MACOSX)
|
||||
result = mInitializeFunc(&sBrowserFuncs);
|
||||
|
@ -257,7 +257,7 @@ private:
|
||||
|
||||
// we get this from the plugin
|
||||
NP_PLUGINSHUTDOWN mShutdownFunc;
|
||||
#if defined(OS_LINUX) || defined(OS_BSD)
|
||||
#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
|
||||
NP_PLUGINUNIXINIT mInitializeFunc;
|
||||
#elif defined(OS_WIN) || defined(OS_MACOSX)
|
||||
NP_PLUGININIT mInitializeFunc;
|
||||
|
@ -89,6 +89,33 @@ function TestCoreBehavior(headers, name) {
|
||||
checkHas(headers, name, "Has the header after set");
|
||||
checkGet(headers, name, "snafu", "Retrieve all headers after set");
|
||||
|
||||
const value_bam = "boom";
|
||||
let testHTTPWhitespace = ["\t", "\n", "\r", " "];
|
||||
while (testHTTPWhitespace.length != 0) {
|
||||
headers.delete(name);
|
||||
|
||||
let char = testHTTPWhitespace.shift();
|
||||
headers.set(name, char);
|
||||
checkGet(headers, name, "",
|
||||
"Header value " + char +
|
||||
" should be normalized before checking and throwing");
|
||||
headers.delete(name);
|
||||
|
||||
let valueFront = char + value_bam;
|
||||
headers.set(name, valueFront);
|
||||
checkGet(headers, name, value_bam,
|
||||
"Header value " + valueFront +
|
||||
" should be normalized before checking and throwing");
|
||||
|
||||
headers.delete(name);
|
||||
|
||||
let valueBack = value_bam + char;
|
||||
headers.set(name, valueBack);
|
||||
checkGet(headers, name, value_bam,
|
||||
"Header value " + valueBack +
|
||||
" should be normalized before checking and throwing");
|
||||
}
|
||||
|
||||
headers.delete(name.toUpperCase());
|
||||
checkNotHas(headers, name, "Does not have the header after delete");
|
||||
checkGet(headers, name, null, "Retrieve all headers after delete");
|
||||
@ -101,11 +128,11 @@ function TestCoreBehavior(headers, name) {
|
||||
}, TypeError, "Append invalid header name should throw TypeError.");
|
||||
|
||||
shouldThrow(function() {
|
||||
headers.append(name, "bam\n");
|
||||
headers.append(name, "ba\nm");
|
||||
}, TypeError, "Append invalid header value should throw TypeError.");
|
||||
|
||||
shouldThrow(function() {
|
||||
headers.append(name, "bam\n\r");
|
||||
headers.append(name, "ba\rm");
|
||||
}, TypeError, "Append invalid header value should throw TypeError.");
|
||||
|
||||
ok(!headers.guard, "guard should be undefined in content");
|
||||
|
@ -21,17 +21,12 @@ dictionary KeyframeEffectOptions : AnimationEffectTimingProperties {
|
||||
DOMString spacing = "distribute";
|
||||
};
|
||||
|
||||
// Bug 1241783: For the constructor we use (Element or CSSPseudoElement)? for
|
||||
// the first argument since we cannot convert a mixin into a union type
|
||||
// automatically.
|
||||
[Func="nsDocument::IsWebAnimationsEnabled",
|
||||
Constructor ((Element or CSSPseudoElement)? target,
|
||||
object? keyframes,
|
||||
optional (unrestricted double or KeyframeEffectOptions) options),
|
||||
Constructor (KeyframeEffectReadOnly source)]
|
||||
interface KeyframeEffectReadOnly : AnimationEffectReadOnly {
|
||||
// Bug 1241783: As with the constructor, we use (Element or CSSPseudoElement)?
|
||||
// for the type of |target| instead of Animatable?
|
||||
readonly attribute (Element or CSSPseudoElement)? target;
|
||||
readonly attribute IterationCompositeOperation iterationComposite;
|
||||
readonly attribute CompositeOperation composite;
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/CycleCollectedJSContext.h"
|
||||
#include "mozilla/CycleCollectedJSRuntime.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/dom/asmjscache/AsmJSCache.h"
|
||||
@ -1046,60 +1047,27 @@ static const JSWrapObjectCallbacks WrapObjectCallbacks = {
|
||||
nullptr,
|
||||
};
|
||||
|
||||
class MOZ_STACK_CLASS WorkerJSContext final : public mozilla::CycleCollectedJSContext
|
||||
class WorkerJSRuntime final : public mozilla::CycleCollectedJSRuntime
|
||||
{
|
||||
public:
|
||||
// The heap size passed here doesn't matter, we will change it later in the
|
||||
// call to JS_SetGCParameter inside InitJSContextForWorker.
|
||||
explicit WorkerJSContext(WorkerPrivate* aWorkerPrivate)
|
||||
: mWorkerPrivate(aWorkerPrivate)
|
||||
explicit WorkerJSRuntime(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
|
||||
: CycleCollectedJSRuntime(aCx)
|
||||
, mWorkerPrivate(aWorkerPrivate)
|
||||
{
|
||||
MOZ_ASSERT(aWorkerPrivate);
|
||||
}
|
||||
|
||||
~WorkerJSContext()
|
||||
void Shutdown() override
|
||||
{
|
||||
JSContext* cx = MaybeContext();
|
||||
if (!cx) {
|
||||
return; // Initialize() must have failed
|
||||
}
|
||||
|
||||
delete static_cast<WorkerThreadContextPrivate*>(JS_GetContextPrivate(cx));
|
||||
JS_SetContextPrivate(cx, nullptr);
|
||||
|
||||
// The worker global should be unrooted and the shutdown cycle collection
|
||||
// should break all remaining cycles. The superclass destructor will run
|
||||
// the GC one final time and finalize any JSObjects that were participating
|
||||
// in cycles that were broken during CC shutdown.
|
||||
nsCycleCollector_shutdown();
|
||||
|
||||
// The CC is shut down, and the superclass destructor will GC, so make sure
|
||||
// we don't try to CC again.
|
||||
mWorkerPrivate = nullptr;
|
||||
}
|
||||
|
||||
nsresult Initialize(JSRuntime* aParentRuntime)
|
||||
~WorkerJSRuntime()
|
||||
{
|
||||
nsresult rv =
|
||||
CycleCollectedJSContext::Initialize(aParentRuntime,
|
||||
WORKER_DEFAULT_RUNTIME_HEAPSIZE,
|
||||
WORKER_DEFAULT_NURSERY_SIZE);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
JSContext* cx = Context();
|
||||
|
||||
JS_SetContextPrivate(cx, new WorkerThreadContextPrivate(mWorkerPrivate));
|
||||
|
||||
js::SetPreserveWrapperCallback(cx, PreserveWrapper);
|
||||
JS_InitDestroyPrincipalsCallback(cx, DestroyWorkerPrincipals);
|
||||
JS_SetWrapObjectCallbacks(cx, &WrapObjectCallbacks);
|
||||
if (mWorkerPrivate->IsDedicatedWorker()) {
|
||||
JS_SetFutexCanWait(cx);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
virtual void
|
||||
@ -1140,6 +1108,71 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
WorkerPrivate* mWorkerPrivate;
|
||||
};
|
||||
|
||||
class MOZ_STACK_CLASS WorkerJSContext final : public mozilla::CycleCollectedJSContext
|
||||
{
|
||||
public:
|
||||
// The heap size passed here doesn't matter, we will change it later in the
|
||||
// call to JS_SetGCParameter inside InitJSContextForWorker.
|
||||
explicit WorkerJSContext(WorkerPrivate* aWorkerPrivate)
|
||||
: mWorkerPrivate(aWorkerPrivate)
|
||||
{
|
||||
MOZ_ASSERT(aWorkerPrivate);
|
||||
}
|
||||
|
||||
~WorkerJSContext()
|
||||
{
|
||||
JSContext* cx = MaybeContext();
|
||||
if (!cx) {
|
||||
return; // Initialize() must have failed
|
||||
}
|
||||
|
||||
delete static_cast<WorkerThreadContextPrivate*>(JS_GetContextPrivate(cx));
|
||||
JS_SetContextPrivate(cx, nullptr);
|
||||
|
||||
// The worker global should be unrooted and the shutdown cycle collection
|
||||
// should break all remaining cycles. The superclass destructor will run
|
||||
// the GC one final time and finalize any JSObjects that were participating
|
||||
// in cycles that were broken during CC shutdown.
|
||||
nsCycleCollector_shutdown();
|
||||
|
||||
// The CC is shut down, and the superclass destructor will GC, so make sure
|
||||
// we don't try to CC again.
|
||||
mWorkerPrivate = nullptr;
|
||||
}
|
||||
|
||||
CycleCollectedJSRuntime* CreateRuntime(JSContext* aCx) override
|
||||
{
|
||||
return new WorkerJSRuntime(aCx, mWorkerPrivate);
|
||||
}
|
||||
|
||||
nsresult Initialize(JSRuntime* aParentRuntime)
|
||||
{
|
||||
nsresult rv =
|
||||
CycleCollectedJSContext::Initialize(aParentRuntime,
|
||||
WORKER_DEFAULT_RUNTIME_HEAPSIZE,
|
||||
WORKER_DEFAULT_NURSERY_SIZE);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
JSContext* cx = Context();
|
||||
|
||||
JS_SetContextPrivate(cx, new WorkerThreadContextPrivate(mWorkerPrivate));
|
||||
|
||||
js::SetPreserveWrapperCallback(cx, PreserveWrapper);
|
||||
JS_InitDestroyPrincipalsCallback(cx, DestroyWorkerPrincipals);
|
||||
JS_SetWrapObjectCallbacks(cx, &WrapObjectCallbacks);
|
||||
if (mWorkerPrivate->IsDedicatedWorker()) {
|
||||
JS_SetFutexCanWait(cx);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
virtual void AfterProcessTask(uint32_t aRecursionDepth) override
|
||||
{
|
||||
// Only perform the Promise microtask checkpoint on the outermost event
|
||||
|
@ -3051,9 +3051,8 @@ XMLHttpRequestMainThread::SetRequestHeader(const nsACString& aName,
|
||||
}
|
||||
|
||||
// Step 3
|
||||
nsAutoCString value(aValue);
|
||||
static const char kHTTPWhitespace[] = "\n\t\r ";
|
||||
value.Trim(kHTTPWhitespace);
|
||||
nsAutoCString value;
|
||||
NS_TrimHTTPWhitespace(aValue, value);
|
||||
|
||||
// Step 4
|
||||
if (!NS_IsValidHTTPToken(aName) || !NS_IsReasonableHTTPHeaderValue(value)) {
|
||||
|
@ -331,7 +331,9 @@ ContentClientRemoteBuffer::CreateBackBuffer(const IntRect& aBufferRect)
|
||||
AbortTextureClientCreation();
|
||||
return;
|
||||
}
|
||||
mTextureClientOnWhite->EnableBlockingReadLock();
|
||||
// We don't enable the readlock for the white buffer since we always
|
||||
// use them together and waiting on the lock for the black
|
||||
// should be sufficient.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -587,13 +587,14 @@ TextureClient::SerializeReadLock(ReadLockDescriptor& aDescriptor)
|
||||
// Take a read lock on behalf of the TextureHost. The latter will unlock
|
||||
// after the shared data is available again for drawing.
|
||||
mReadLock->ReadLock();
|
||||
mReadLock->Serialize(aDescriptor, GetAllocator()->GetParentPid());
|
||||
mUpdated = false;
|
||||
return true;
|
||||
} else {
|
||||
aDescriptor = null_t();
|
||||
return false;
|
||||
if (mReadLock->Serialize(aDescriptor, GetAllocator()->GetParentPid())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
aDescriptor = null_t();
|
||||
return false;
|
||||
}
|
||||
|
||||
TextureClient::~TextureClient()
|
||||
@ -1438,32 +1439,41 @@ class CrossProcessSemaphoreReadLock : public TextureReadLock
|
||||
{
|
||||
public:
|
||||
CrossProcessSemaphoreReadLock()
|
||||
: mSemaphore("TextureReadLock", 1)
|
||||
: mSemaphore(CrossProcessSemaphore::Create("TextureReadLock", 1))
|
||||
{}
|
||||
explicit CrossProcessSemaphoreReadLock(CrossProcessSemaphoreHandle aHandle)
|
||||
: mSemaphore(aHandle)
|
||||
: mSemaphore(CrossProcessSemaphore::Create(aHandle))
|
||||
{}
|
||||
|
||||
virtual bool ReadLock() override
|
||||
{
|
||||
return mSemaphore.Wait();
|
||||
if (!IsValid()) {
|
||||
return false;
|
||||
}
|
||||
return mSemaphore->Wait();
|
||||
}
|
||||
virtual bool TryReadLock(TimeDuration aTimeout) override
|
||||
{
|
||||
return mSemaphore.Wait(Some(aTimeout));
|
||||
if (!IsValid()) {
|
||||
return false;
|
||||
}
|
||||
return mSemaphore->Wait(Some(aTimeout));
|
||||
}
|
||||
virtual int32_t ReadUnlock() override
|
||||
{
|
||||
mSemaphore.Signal();
|
||||
if (!IsValid()) {
|
||||
return 1;
|
||||
}
|
||||
mSemaphore->Signal();
|
||||
return 1;
|
||||
}
|
||||
virtual bool IsValid() const override { return true; }
|
||||
virtual bool IsValid() const override { return !!mSemaphore; }
|
||||
|
||||
virtual bool Serialize(ReadLockDescriptor& aOutput, base::ProcessId aOther) override;
|
||||
|
||||
virtual LockType GetType() override { return TYPE_CROSS_PROCESS_SEMAPHORE; }
|
||||
|
||||
CrossProcessSemaphore mSemaphore;
|
||||
UniquePtr<CrossProcessSemaphore> mSemaphore;
|
||||
};
|
||||
|
||||
// static
|
||||
@ -1645,8 +1655,12 @@ ShmemTextureReadLock::GetReadCount() {
|
||||
bool
|
||||
CrossProcessSemaphoreReadLock::Serialize(ReadLockDescriptor& aOutput, base::ProcessId aOther)
|
||||
{
|
||||
aOutput = ReadLockDescriptor(CrossProcessSemaphoreDescriptor(mSemaphore.ShareToProcess(aOther)));
|
||||
return true;
|
||||
if (IsValid()) {
|
||||
aOutput = ReadLockDescriptor(CrossProcessSemaphoreDescriptor(mSemaphore->ShareToProcess(aOther)));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1220,6 +1220,21 @@ SyncObjectD3D11::SyncObjectD3D11(SyncHandle aSyncHandle, ID3D11Device* aDevice)
|
||||
mD3D11Device = aDevice;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
ShouldDevCrashOnSyncInitFailure()
|
||||
{
|
||||
// Compositor shutdown does not wait for video decoding to finish, so it is
|
||||
// possible for the compositor to destroy the SyncObject before video has a
|
||||
// chance to initialize it.
|
||||
if (!NS_IsMainThread()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Note: CompositorIsInGPUProcess is a main-thread-only function.
|
||||
return !CompositorBridgeChild::CompositorIsInGPUProcess() &&
|
||||
!DeviceManagerDx::Get()->HasDeviceReset();
|
||||
}
|
||||
|
||||
bool
|
||||
SyncObjectD3D11::Init()
|
||||
{
|
||||
@ -1233,13 +1248,10 @@ SyncObjectD3D11::Init()
|
||||
(void**)(ID3D11Texture2D**)getter_AddRefs(mD3D11Texture));
|
||||
if (FAILED(hr) || !mD3D11Texture) {
|
||||
gfxCriticalNote << "Failed to OpenSharedResource for SyncObjectD3D11: " << hexa(hr);
|
||||
if (!CompositorBridgeChild::CompositorIsInGPUProcess() &&
|
||||
!DeviceManagerDx::Get()->HasDeviceReset())
|
||||
{
|
||||
if (ShouldDevCrashOnSyncInitFailure()) {
|
||||
gfxDevCrash(LogReason::D3D11FinalizeFrame) << "Without device reset: " << hexa(hr);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
hr = mD3D11Texture->QueryInterface(__uuidof(IDXGIKeyedMutex), getter_AddRefs(mKeyedMutex));
|
||||
|
@ -834,6 +834,7 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
|
||||
return true;
|
||||
}
|
||||
|
||||
/// cbindgen:function-postfix=WR_DESTRUCTOR_SAFE_FUNC
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wr_api_delete(api: *mut WrAPI) {
|
||||
let api = Box::from_raw(api);
|
||||
@ -1063,6 +1064,7 @@ pub extern "C" fn wr_state_new(pipeline_id: WrPipelineId) -> *mut WrState {
|
||||
Box::into_raw(state)
|
||||
}
|
||||
|
||||
/// cbindgen:function-postfix=WR_DESTRUCTOR_SAFE_FUNC
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wr_state_delete(state: *mut WrState) {
|
||||
assert!(unsafe { is_in_main_thread() });
|
||||
|
@ -2,6 +2,8 @@
|
||||
* 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/. */
|
||||
|
||||
/* Generated with cbindgen:0.1.5 */
|
||||
|
||||
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
|
||||
* To generate this file, clone `https://github.com/rlhunt/cbindgen` or run `cargo install cbindgen`,
|
||||
* then run `cbindgen -c wr gfx/webrender_bindings/ gfx/webrender_bindings/webrender_ffi_generated.h` */
|
||||
@ -534,7 +536,7 @@ WR_FUNC;
|
||||
|
||||
WR_INLINE void
|
||||
wr_api_delete(WrAPI* api)
|
||||
WR_FUNC;
|
||||
WR_DESTRUCTOR_SAFE_FUNC;
|
||||
|
||||
WR_INLINE void
|
||||
wr_api_delete_font(WrAPI* api,
|
||||
@ -826,7 +828,7 @@ WR_FUNC;
|
||||
|
||||
WR_INLINE void
|
||||
wr_state_delete(WrState* state)
|
||||
WR_FUNC;
|
||||
WR_DESTRUCTOR_SAFE_FUNC;
|
||||
|
||||
WR_INLINE WrState*
|
||||
wr_state_new(WrPipelineId pipeline_id)
|
||||
|
@ -361,7 +361,7 @@ SVGDocumentWrapper::SetupViewer(nsIRequest* aRequest,
|
||||
// For a root document, DocShell would do these sort of things
|
||||
// automatically. Since there is no DocShell for this wrapped SVG document,
|
||||
// we must set it up manually.
|
||||
RefPtr<nsDOMNavigationTiming> timing = new nsDOMNavigationTiming();
|
||||
RefPtr<nsDOMNavigationTiming> timing = new nsDOMNavigationTiming(nullptr);
|
||||
timing->NotifyNavigationStart(nsDOMNavigationTiming::DocShellState::eInactive);
|
||||
viewer->SetNavigationTiming(timing);
|
||||
|
||||
|
@ -1396,6 +1396,8 @@ imgLoader::FindEntryProperties(nsIURI* uri,
|
||||
nsIDOMDocument* aDOMDoc,
|
||||
nsIProperties** _retval)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
*_retval = nullptr;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(aDOMDoc);
|
||||
@ -1479,6 +1481,8 @@ imgLoader::MinimizeCaches()
|
||||
bool
|
||||
imgLoader::PutIntoCache(const ImageCacheKey& aKey, imgCacheEntry* entry)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
imgCacheTable& cache = GetCache(aKey);
|
||||
|
||||
LOG_STATIC_FUNC_WITH_PARAM(gImgLog,
|
||||
@ -1538,6 +1542,8 @@ imgLoader::PutIntoCache(const ImageCacheKey& aKey, imgCacheEntry* entry)
|
||||
bool
|
||||
imgLoader::SetHasNoProxies(imgRequest* aRequest, imgCacheEntry* aEntry)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
LOG_STATIC_FUNC_WITH_PARAM(gImgLog,
|
||||
"imgLoader::SetHasNoProxies", "uri",
|
||||
aRequest->CacheKey().Spec());
|
||||
@ -1569,6 +1575,8 @@ imgLoader::SetHasNoProxies(imgRequest* aRequest, imgCacheEntry* aEntry)
|
||||
bool
|
||||
imgLoader::SetHasProxies(imgRequest* aRequest)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
VerifyCacheSizes();
|
||||
|
||||
const ImageCacheKey& key = aRequest->CacheKey();
|
||||
@ -1896,6 +1904,8 @@ imgLoader::ValidateEntry(imgCacheEntry* aEntry,
|
||||
bool
|
||||
imgLoader::RemoveFromCache(const ImageCacheKey& aKey)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
LOG_STATIC_FUNC_WITH_PARAM(gImgLog,
|
||||
"imgLoader::RemoveFromCache", "uri", aKey.Spec());
|
||||
|
||||
@ -1930,6 +1940,8 @@ imgLoader::RemoveFromCache(const ImageCacheKey& aKey)
|
||||
bool
|
||||
imgLoader::RemoveFromCache(imgCacheEntry* entry)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
LOG_STATIC_FUNC(gImgLog, "imgLoader::RemoveFromCache entry");
|
||||
|
||||
RefPtr<imgRequest> request = entry->GetRequest();
|
||||
@ -2089,6 +2101,8 @@ imgLoader::LoadImage(nsIURI* aURI,
|
||||
const nsAString& initiatorType,
|
||||
imgRequestProxy** _retval)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
VerifyCacheSizes();
|
||||
|
||||
NS_ASSERTION(aURI, "imgLoader::LoadImage -- NULL URI pointer");
|
||||
@ -2370,6 +2384,8 @@ imgLoader::LoadImageWithChannel(nsIChannel* channel,
|
||||
nsIStreamListener** listener,
|
||||
imgRequestProxy** _retval)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_ASSERTION(channel,
|
||||
"imgLoader::LoadImageWithChannel -- NULL channel pointer");
|
||||
|
||||
|
@ -643,6 +643,8 @@ imgRequestProxy::PerformClone(imgINotificationObserver* aObserver,
|
||||
imgRequestProxy* (aAllocFn)(imgRequestProxy*),
|
||||
imgRequestProxy** aClone)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_PRECONDITION(aClone, "Null out param");
|
||||
|
||||
LOG_SCOPE(gImgLog, "imgRequestProxy::Clone");
|
||||
|
@ -24,7 +24,7 @@ typedef void* PlatformThreadHandle; // HANDLE
|
||||
#elif defined(OS_POSIX)
|
||||
#include <pthread.h>
|
||||
typedef pthread_t PlatformThreadHandle;
|
||||
#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(__GLIBC__)
|
||||
#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__)
|
||||
#include <unistd.h>
|
||||
typedef pid_t PlatformThreadId;
|
||||
#elif defined(OS_BSD)
|
||||
|
@ -53,7 +53,7 @@ PlatformThreadId PlatformThread::CurrentId() {
|
||||
#else
|
||||
return syscall(__NR_gettid);
|
||||
#endif
|
||||
#elif defined(OS_OPENBSD) || defined(__GLIBC__)
|
||||
#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__)
|
||||
return (intptr_t) (pthread_self());
|
||||
#elif defined(OS_NETBSD)
|
||||
return _lwp_self();
|
||||
@ -107,6 +107,8 @@ void PlatformThread::SetName(const char* name) {
|
||||
pthread_setname_np(pthread_self(), "%s", (void *)name);
|
||||
#elif defined(OS_BSD) && !defined(__GLIBC__)
|
||||
pthread_set_name_np(pthread_self(), name);
|
||||
#elif defined(OS_SOLARIS)
|
||||
pthread_setname_np(pthread_self(), name);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
|
||||
#if defined(ANDROID)
|
||||
static const rlim_t kSystemDefaultMaxFds = 1024;
|
||||
static const char kFDDir[] = "/proc/self/fd";
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
static const rlim_t kSystemDefaultMaxFds = 8192;
|
||||
static const char kFDDir[] = "/proc/self/fd";
|
||||
#elif defined(OS_MACOSX)
|
||||
@ -217,7 +217,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
|
||||
// TODO(agl): Remove this function. It's fundamentally broken for multithreaded
|
||||
// apps.
|
||||
void SetAllFDsToCloseOnExec() {
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
const char fd_dir[] = "/proc/self/fd";
|
||||
#elif defined(OS_MACOSX) || defined(OS_BSD)
|
||||
const char fd_dir[] = "/dev/fd";
|
||||
|
@ -67,8 +67,10 @@ Time Time::FromExploded(bool is_local, const Exploded& exploded) {
|
||||
timestruct.tm_wday = exploded.day_of_week; // mktime/timegm ignore this
|
||||
timestruct.tm_yday = 0; // mktime/timegm ignore this
|
||||
timestruct.tm_isdst = -1; // attempt to figure it out
|
||||
#ifndef OS_SOLARIS
|
||||
timestruct.tm_gmtoff = 0; // not a POSIX field, so mktime/timegm ignore
|
||||
timestruct.tm_zone = NULL; // not a POSIX field, so mktime/timegm ignore
|
||||
#endif
|
||||
|
||||
time_t seconds;
|
||||
#ifdef ANDROID
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <windows.h>
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
#include "chrome/common/x11_util.h"
|
||||
#endif
|
||||
|
||||
@ -68,7 +68,7 @@ class TransportDIB {
|
||||
typedef base::SharedMemoryHandle Handle;
|
||||
// On Mac, the inode number of the backing file is used as an id.
|
||||
typedef base::SharedMemoryId Id;
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
typedef int Handle; // These two ints are SysV IPC shared memory keys
|
||||
typedef int Id;
|
||||
#endif
|
||||
@ -98,7 +98,7 @@ class TransportDIB {
|
||||
// wire to give this transport DIB to another process.
|
||||
Handle handle() const;
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
// Map the shared memory into the X server and return an id for the shared
|
||||
// segment.
|
||||
XID MapToX(Display* connection);
|
||||
@ -109,7 +109,7 @@ class TransportDIB {
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
|
||||
explicit TransportDIB(base::SharedMemoryHandle dib);
|
||||
base::SharedMemory shared_memory_;
|
||||
#elif defined(OS_LINUX)
|
||||
#elif defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
int key_; // SysV shared memory id
|
||||
void* address_; // mapped address
|
||||
XID x_shm_; // X id for the shared segment
|
||||
|
@ -23,7 +23,7 @@ static const char* kBrowserThreadNames[BrowserProcessSubThread::ID_COUNT] = {
|
||||
// "Chrome_FileThread", // FILE
|
||||
// "Chrome_DBThread", // DB
|
||||
// "Chrome_HistoryThread", // HISTORY
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
"Gecko_Background_X11Thread", // BACKGROUND_X11
|
||||
#endif
|
||||
};
|
||||
@ -34,7 +34,7 @@ BrowserProcessSubThread* BrowserProcessSubThread::sBrowserThreads[ID_COUNT] = {
|
||||
// nullptr, // FILE
|
||||
// nullptr, // DB
|
||||
// nullptr, // HISTORY
|
||||
#if defined(OS_LINUX)
|
||||
#if defined(OS_LINUX) || defined(OS_SOLARIS)
|
||||
nullptr, // BACKGROUND_X11
|
||||
#endif
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user