mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
merge mozilla-central to b2g-inbound
This commit is contained in:
commit
5585419b1c
12
.hgignore
12
.hgignore
@ -82,17 +82,5 @@ GPATH
|
||||
# Git clone directory for updating web-platform-tests
|
||||
^testing/web-platform/sync/
|
||||
|
||||
# Loop web client build/deploy dependencies
|
||||
^browser/components/loop/standalone/bower_components
|
||||
|
||||
# Loop legal content build/deploy artifacts
|
||||
|
||||
# XXX Once a grunt contrib-clean command has been added (bug 1066491), or
|
||||
# once legal has centralized their ToS and PP hosting infrastructure,
|
||||
# (expected Q4 2014) the legal doc build stuff for Loop can be removed,
|
||||
# including the following three lines
|
||||
^browser/components/loop/standalone/content/legal/styles/.*\.css$
|
||||
^browser/components/loop/standalone/content/legal/terms/en_US\.html$
|
||||
|
||||
# Android Gradle artifacts.
|
||||
^mobile/android/gradle/.gradle
|
||||
|
@ -478,7 +478,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
|
||||
},
|
||||
{ // radiogroup
|
||||
&nsGkAtoms::radiogroup,
|
||||
roles::GROUPING,
|
||||
roles::RADIO_GROUP,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
|
@ -976,7 +976,12 @@ enum Role {
|
||||
*/
|
||||
MATHML_STACK_LINE = 167,
|
||||
|
||||
LAST_ROLE = MATHML_STACK_LINE
|
||||
/**
|
||||
* A group containing radio buttons
|
||||
*/
|
||||
RADIO_GROUP = 168,
|
||||
|
||||
LAST_ROLE = RADIO_GROUP
|
||||
};
|
||||
|
||||
} // namespace role
|
||||
|
@ -1359,3 +1359,11 @@ ROLE(MATHML_STACK_LINE,
|
||||
0,
|
||||
IA2_ROLE_UNKNOWN,
|
||||
eNoNameRule)
|
||||
|
||||
ROLE(RADIO_GROUP,
|
||||
"grouping",
|
||||
ATK_ROLE_PANEL,
|
||||
NSAccessibilityRadioGroupRole,
|
||||
ROLE_SYSTEM_GROUPING,
|
||||
ROLE_SYSTEM_GROUPING,
|
||||
eNoNameRule)
|
||||
|
@ -8,7 +8,7 @@
|
||||
/**
|
||||
* Defines cross platform (Gecko) roles.
|
||||
*/
|
||||
[scriptable, uuid(55581ec3-ba6e-4805-8108-260ed34cdcbb)]
|
||||
[scriptable, uuid(00f9e831-3198-40b7-9186-5251474d4d7a)]
|
||||
interface nsIAccessibleRole : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -969,4 +969,9 @@ interface nsIAccessibleRole : nsISupports
|
||||
* A MathML line in a stack (msline in MathML).
|
||||
*/
|
||||
const unsigned long ROLE_MATHML_STACK_LINE = 167;
|
||||
|
||||
/**
|
||||
* A group containing radio buttons
|
||||
*/
|
||||
const unsigned long ROLE_RADIO_GROUP = 168;
|
||||
};
|
||||
|
@ -96,6 +96,7 @@ const ROLE_PROGRESSBAR = nsIAccessibleRole.ROLE_PROGRESSBAR;
|
||||
const ROLE_PROPERTYPAGE = nsIAccessibleRole.ROLE_PROPERTYPAGE;
|
||||
const ROLE_PUSHBUTTON = nsIAccessibleRole.ROLE_PUSHBUTTON;
|
||||
const ROLE_RADIOBUTTON = nsIAccessibleRole.ROLE_RADIOBUTTON;
|
||||
const ROLE_RADIO_GROUP = nsIAccessibleRole.ROLE_RADIO_GROUP;
|
||||
const ROLE_RADIO_MENU_ITEM = nsIAccessibleRole.ROLE_RADIO_MENU_ITEM;
|
||||
const ROLE_RICH_OPTION = nsIAccessibleRole.ROLE_RICH_OPTION;
|
||||
const ROLE_ROW = nsIAccessibleRole.ROLE_ROW;
|
||||
|
@ -51,7 +51,7 @@
|
||||
testRole("aria_presentation", ROLE_TEXT_CONTAINER); // weak role
|
||||
testRole("aria_progressbar", ROLE_PROGRESSBAR);
|
||||
testRole("aria_radio", ROLE_RADIOBUTTON);
|
||||
testRole("aria_radiogroup", ROLE_GROUPING);
|
||||
testRole("aria_radiogroup", ROLE_RADIO_GROUP);
|
||||
testRole("aria_region", ROLE_PANE);
|
||||
testRole("aria_row", ROLE_ROW);
|
||||
testRole("aria_rowheader", ROLE_ROWHEADER);
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
// radiogroup
|
||||
accTree = {
|
||||
role: ROLE_GROUPING,
|
||||
role: ROLE_RADIO_GROUP,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_RADIOBUTTON,
|
||||
|
@ -472,7 +472,7 @@ XULRadioGroupAccessible::
|
||||
role
|
||||
XULRadioGroupAccessible::NativeRole()
|
||||
{
|
||||
return roles::GROUPING;
|
||||
return roles::RADIO_GROUP;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
|
@ -952,3 +952,9 @@ bin/libfreebl_32int64_3.so
|
||||
#ifdef PACKAGE_MOZTT
|
||||
@RESPATH@/fonts/*
|
||||
#endif
|
||||
|
||||
; media
|
||||
#ifdef MOZ_EME
|
||||
@RESPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@
|
||||
@RESPATH@/gmp-clearkey/0.1/clearkey.info
|
||||
#endif
|
||||
|
@ -1409,7 +1409,6 @@ pref("devtools.responsiveUI.no-reload-notification", false);
|
||||
|
||||
// Enable the Debugger
|
||||
pref("devtools.debugger.enabled", true);
|
||||
pref("devtools.debugger.chrome-enabled", true);
|
||||
pref("devtools.debugger.chrome-debugging-host", "localhost");
|
||||
pref("devtools.debugger.chrome-debugging-port", 6080);
|
||||
pref("devtools.debugger.remote-host", "localhost");
|
||||
|
@ -274,25 +274,18 @@ var PlacesCommandHook = {
|
||||
var uri = aBrowser.currentURI;
|
||||
var itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
|
||||
if (itemId == -1) {
|
||||
// Copied over from addBookmarkForBrowser:
|
||||
// Bug 52536: We obtain the URL and title from the nsIWebNavigation
|
||||
// associated with a <browser/> rather than from a DOMWindow.
|
||||
// This is because when a full page plugin is loaded, there is
|
||||
// no DOMWindow (?) but information about the loaded document
|
||||
// may still be obtained from the webNavigation.
|
||||
var webNav = aBrowser.webNavigation;
|
||||
var url = webNav.currentURI;
|
||||
// Bug 1148838 - Make this code work for full page plugins.
|
||||
var title;
|
||||
var description;
|
||||
var charset;
|
||||
try {
|
||||
let isErrorPage = /^about:(neterror|certerror|blocked)/
|
||||
.test(webNav.document.documentURI);
|
||||
title = isErrorPage ? PlacesUtils.history.getPageTitle(url)
|
||||
: webNav.document.title;
|
||||
title = title || url.spec;
|
||||
description = PlacesUIUtils.getDescriptionFromDocument(webNav.document);
|
||||
charset = webNav.document.characterSet;
|
||||
.test(aBrowser.contentDocumentAsCPOW.documentURI);
|
||||
title = isErrorPage ? PlacesUtils.history.getPageTitle(uri)
|
||||
: aBrowser.contentTitle;
|
||||
title = title || uri.spec;
|
||||
description = PlacesUIUtils.getDescriptionFromDocument(aBrowser.contentDocumentAsCPOW);
|
||||
charset = aBrowser.characterSet;
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
|
@ -3769,7 +3769,8 @@
|
||||
};
|
||||
let popup = browser.ownerDocument.getElementById("contentAreaContextMenu");
|
||||
let event = gContextMenuContentData.event;
|
||||
popup.openPopupAtScreen(event.screenX, event.screenY, true);
|
||||
let pos = browser.mapScreenCoordinatesFromContent(event.screenX, event.screenY);
|
||||
popup.openPopupAtScreen(pos.x, pos.y, true);
|
||||
break;
|
||||
}
|
||||
case "DOMWebNotificationClicked": {
|
||||
|
@ -848,7 +848,7 @@ function waitForEvents(event)
|
||||
if (painted && loaded) {
|
||||
subwindow.removeEventListener("MozAfterPaint", waitForEvents, false);
|
||||
subwindow.onload = null;
|
||||
startTest();
|
||||
SimpleTest.waitForFocus(startTest, subwindow);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,5 @@
|
||||
.module-cache
|
||||
node_modules
|
||||
bower_components
|
||||
*.pyc
|
||||
content/config.js
|
||||
content/VERSION.txt
|
||||
|
||||
# XXX Once a grunt contrib-clean command has been added (bug 1066491), or
|
||||
# once legal has centralized their ToS and PP hosting infrastructure,
|
||||
# (expected Q4 2014) the legal doc build stuff for Loop can be removed,
|
||||
# including the following three lines:
|
||||
content/legal/styles/*.css
|
||||
content/legal/terms/*.html
|
||||
!content/legal/terms/index.html
|
||||
|
@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* 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/. */
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
// show elapsed time at the end
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
// load all grunt tasks
|
||||
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
|
||||
|
||||
grunt.initConfig({
|
||||
});
|
||||
|
||||
grunt.loadTasks('grunttasks');
|
||||
}
|
||||
;
|
@ -6,12 +6,6 @@
|
||||
# system, which is why it can have dependencies on things the
|
||||
# build system at-large doesn't yet support.
|
||||
|
||||
# XXX In the interest of making the build logic simpler and
|
||||
# more maintainable, we should be trying to implement new
|
||||
# functionality in Gruntfile.js rather than here.
|
||||
# Bug 1066176 tracks moving all functionality currently here
|
||||
# to the Gruntfile and getting rid of this Makefile entirely.
|
||||
|
||||
LOOP_SERVER_URL := $(shell echo $${LOOP_SERVER_URL-http://localhost:5000/v0})
|
||||
LOOP_FEEDBACK_API_URL := $(shell echo $${LOOP_FEEDBACK_API_URL-"https://input.allizom.org/api/v1/feedback"})
|
||||
LOOP_FEEDBACK_PRODUCT_NAME := $(shell echo $${LOOP_FEEDBACK_PRODUCT_NAME-Loop})
|
||||
@ -22,7 +16,7 @@ LOOP_PRODUCT_HOMEPAGE_URL := $(shell echo $${LOOP_PRODUCT_HOMEPAGE_URL-"https://
|
||||
|
||||
NODE_LOCAL_BIN=./node_modules/.bin
|
||||
|
||||
install: npm_install tos
|
||||
install: npm_install
|
||||
|
||||
npm_install:
|
||||
@npm install
|
||||
@ -30,10 +24,6 @@ npm_install:
|
||||
test:
|
||||
@echo "Not implemented yet."
|
||||
|
||||
tos:
|
||||
@$(NODE_LOCAL_BIN)/grunt replace marked
|
||||
@$(NODE_LOCAL_BIN)/grunt sass
|
||||
|
||||
lint:
|
||||
@$(NODE_LOCAL_BIN)/jshint *.js content test
|
||||
|
||||
|
@ -9,13 +9,10 @@ NodeJS and npm installed.
|
||||
Installation
|
||||
------------
|
||||
|
||||
Fetch and install/build any NPM and bower dependencies, as well as the
|
||||
localized Terms-of-Service content:
|
||||
Fetch and install/build any NPM dependencies:
|
||||
|
||||
$ make install
|
||||
|
||||
Some of the above is driven by Gruntfile.js.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "loop-client",
|
||||
"dependencies": {
|
||||
"tos-pp": "https://github.com/mozilla/legal-docs.git"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 886 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 898 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 38 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB |
@ -1,33 +0,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/. */
|
||||
|
||||
// Set the current translation content
|
||||
function setBody(data) {
|
||||
$("#legal-copy").html(data);
|
||||
}
|
||||
|
||||
function normalizeLocale(lang) {
|
||||
return lang.replace(/-/g, "_");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Get the favorite language
|
||||
var lang, defaultLang = "en-US";
|
||||
$.get(loop.config.serverUrl, function(data) {
|
||||
if (data.hasOwnProperty("i18n")) {
|
||||
lang = normalizeLocale(data.i18n.lang);
|
||||
defaultLang = normalizeLocale(data.i18n.defaultLang);
|
||||
}
|
||||
if (lang === undefined) {
|
||||
lang = normalizeLocale(defaultLang);
|
||||
}
|
||||
|
||||
$.get(lang + ".html")
|
||||
.done(setBody)
|
||||
.fail(function() {
|
||||
$.get(defaultLang + ".html")
|
||||
.done(setBody);
|
||||
});
|
||||
});
|
||||
});
|
@ -1,235 +0,0 @@
|
||||
@font-face { font-family: 'Clear Sans'; font-style: normal; font-weight: 400; src: local(Clear Sans), local(ClearSans), url(/legal/fonts/latin/clearsans-regular.eot?#iefix) format(embedded-opentype), url(/legal/fonts/latin/clearsans-regular.woff) format(woff), url(/legal/fonts/latin/clearsans-regular.ttf) format(truetype), url(/legal/fonts/latin/clearsans-regular.svg#clearsans-regular) format(svg); }
|
||||
|
||||
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 400; src: local(Fira Sans), local(FiraSans-Regular), url(/legal/fonts/latin/firasans-regular.eot?#iefix) format(embedded-opentype), url(/legal/fonts/latin/firasans-regular.woff) format(woff), url(/legal/fonts/latin/firasans-regular.ttf) format(truetype), url(/legal/fonts/latin/firasans-regular.svg#firasans-regular) format(svg); }
|
||||
|
||||
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 300; src: local(Fira Sans Light), local(FiraSans-Light), url(/legal/fonts/latin/firasans-light.eot?#iefix) format(embedded-opentype), url(/legal/fonts/latin/firasans-light.woff) format(woff), url(/legal/fonts/latin/firasans-light.ttf) format(truetype), url(/legal/fonts/latin/firasans-light.svg#firasans-light) format(svg); }
|
||||
|
||||
@media (min-width: 321px) and (max-width: 480px) {
|
||||
#about-mozilla {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#main-content {
|
||||
-webkit-box-shadow: rgb(138, 155, 168) 0px 1px 5px;
|
||||
border-radius: 2px 2px;
|
||||
box-shadow: rgb(138, 155, 168) 0px 1px 5px;
|
||||
margin-top: 0px;
|
||||
max-width: 360px;
|
||||
min-height: 300px;
|
||||
min-width: 300px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
padding-top: 45px;
|
||||
position: relative;
|
||||
top: -28px;
|
||||
width: 94%;
|
||||
}
|
||||
|
||||
.static {
|
||||
-webkit-background-size: 48px 51px;
|
||||
background-position-x: 50%;
|
||||
background-position-y: 0%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 48px 51px;
|
||||
height: 51px;
|
||||
margin-top: 10px;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: rgb(242, 242, 242);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 481px) {
|
||||
#main-content {
|
||||
-webkit-box-shadow: rgb(138, 155, 168) 0px 1px 5px;
|
||||
border-radius: 4px 4px;
|
||||
box-shadow: rgb(138, 155, 168) 0px 1px 5px;
|
||||
margin-top: -5px;
|
||||
min-height: 450px;
|
||||
padding-bottom: 40px;
|
||||
padding-left: 40px;
|
||||
padding-right: 40px;
|
||||
padding-top: 60px;
|
||||
width: 420px;
|
||||
}
|
||||
|
||||
.static {
|
||||
-webkit-background-size: 80px 85px;
|
||||
background-size: 80px 85px;
|
||||
height: 85px;
|
||||
margin-top: 0px;
|
||||
top: 40px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
body {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: rgb(242, 242, 242);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (max-width: 319px) {
|
||||
#about-mozilla {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#main-content {
|
||||
-webkit-box-shadow: none;
|
||||
background-position-x: 0px;
|
||||
background-position-y: 0px;
|
||||
border-radius: 2px 2px;
|
||||
box-shadow: none;
|
||||
margin-top: 10px;
|
||||
max-width: 360px;
|
||||
min-height: 0px;
|
||||
min-width: 250px;
|
||||
padding: 0px;
|
||||
position: relative;
|
||||
top: 0px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.static {
|
||||
-webkit-background-size: 48px 51px;
|
||||
background-position-x: 50%;
|
||||
background-position-y: 0%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 48px 51px;
|
||||
display: none;
|
||||
height: 51px;
|
||||
margin-top: 10px;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 18px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#about-mozilla {
|
||||
-webkit-background-size: 69px 19px;
|
||||
-webkit-transition-duration: 150ms;
|
||||
-webkit-transition-property: opacity;
|
||||
background-image: url(/legal/images/mozilla.png);
|
||||
background-size: 69px 19px;
|
||||
height: 19px;
|
||||
opacity: 0.5;
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
top: 12px;
|
||||
width: 69px;
|
||||
}
|
||||
|
||||
#main-content {
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.static {
|
||||
background-image: url(/legal/images/firefox.png);
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
opacity: 1;
|
||||
background-size: 102px 96px;
|
||||
height: 102px;
|
||||
width: 96px;
|
||||
position: relative;
|
||||
position: relative;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgb(0, 149, 221);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
article {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
body {
|
||||
color: rgb(66, 79, 89);
|
||||
font-family: 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h1, h2 {
|
||||
font-family: 'Fira Sans', Helvetica, Arial, sans-serif;
|
||||
font-weight: 200;
|
||||
line-height: 1em;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-family: 'Fira Sans', Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
line-height: 1em;
|
||||
margin: 0px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
ol {
|
||||
margin-left: 0px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin-left: 0px;
|
||||
padding-left: 20px;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="lt-ie10 lt-ie9"> <![endif]-->
|
||||
<!--[if IE 9]> <html class="lt-ie10"> <![endif]-->
|
||||
<!--[if gt IE 9]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Firefox Hello: Terms of Service</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<link rel="stylesheet" href="/legal/styles/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="fox-logo" class="static"></div>
|
||||
<div id="stage">
|
||||
<div id="main-content">
|
||||
<!--[if lt IE 10]>
|
||||
<p class="error browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
|
||||
<![endif]-->
|
||||
<header id="legal-header">
|
||||
<h3>Firefox Hello</h3>
|
||||
<h1 id="webrtc-tos-header">Terms of Service</h1>
|
||||
</header>
|
||||
|
||||
<section>
|
||||
<article id="legal-copy">
|
||||
Loading...
|
||||
</article>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<a id="about-mozilla" rel="author" target="_blank" href="https://www.mozilla.org/about/?utm_source=firefox-webrtc&utm_medium=Referral"></a>
|
||||
<script type="text/javascript" src="/shared/libs/jquery-2.1.0.js"></script>
|
||||
<script type="text/javascript" src="/config.js"></script>
|
||||
<script type="text/javascript" src="/legal/js/loader.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,36 +0,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/. */
|
||||
|
||||
var path = require('path');
|
||||
var i18n = require('i18n-abide');
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
// convert localized TOS agreement from markdown to html partials.
|
||||
|
||||
function rename(destPath, srcFile) {
|
||||
// Normalize the filenames to use the locale name.
|
||||
var lang = srcFile.replace('.md', '');
|
||||
return path.join(destPath, i18n.localeFrom(lang) + '.html');
|
||||
}
|
||||
|
||||
grunt.config('marked', {
|
||||
options: {
|
||||
sanitize: false,
|
||||
gfm: true
|
||||
},
|
||||
tos: {
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= project_vars.tos_md_src %>',
|
||||
src: ['**/*.md'],
|
||||
dest: '<%= project_vars.tos_html_dest %>',
|
||||
rename: rename
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
};
|
@ -1,18 +0,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/. */
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
var TEMPLATE_ROOT = 'content/legal';
|
||||
var TOS_PP_REPO_ROOT = 'bower_components/tos-pp';
|
||||
|
||||
grunt.config('project_vars', {
|
||||
app: "content",
|
||||
// Translated TOS/PP agreements.
|
||||
tos_pp_repo_dest: TOS_PP_REPO_ROOT,
|
||||
tos_md_src: TOS_PP_REPO_ROOT + '/WebRTC_ToS/',
|
||||
tos_html_dest: TEMPLATE_ROOT + '/terms'
|
||||
});
|
||||
};
|
@ -1,37 +0,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/. */
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.config('replace', {
|
||||
tos: {
|
||||
src: [
|
||||
'<%= project_vars.tos_md_src %>/*.md'
|
||||
],
|
||||
overwrite: true,
|
||||
replacements: [{
|
||||
// remove tags not handle by the markdown-to-HTML conversation
|
||||
from: /{:\s.*?\s}/g,
|
||||
to: ''
|
||||
}, {
|
||||
// remove unhandled comments
|
||||
from: /^#\s.*?\n$/m,
|
||||
to: ''
|
||||
}, {
|
||||
// fix "smart quotes"
|
||||
from: /(“|”)/g,
|
||||
to: """
|
||||
}, {
|
||||
// fix "smart quotes"
|
||||
from: /’/g,
|
||||
to: "'"
|
||||
}, {
|
||||
from: /–/g,
|
||||
to: "—"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
};
|
@ -1,16 +0,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/. */
|
||||
|
||||
module.exports = function (grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.config('sass', {
|
||||
styles: {
|
||||
files: {
|
||||
'<%= project_vars.app %>/legal/styles/main.css':
|
||||
'<%= project_vars.app %>/legal/styles/main.scss'
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
@ -12,22 +12,11 @@
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"bower": "1.3.9",
|
||||
"express": "3.x",
|
||||
"grunt": "0.4.5",
|
||||
"grunt-cli": "0.1.13",
|
||||
"grunt-marked": "0.1.1",
|
||||
"grunt-sass": "0.14.1",
|
||||
"grunt-text-replace": "0.3.12",
|
||||
"i18n-abide": "0.0.22",
|
||||
"jshint": "2.x",
|
||||
"load-grunt-tasks": "0.6.0",
|
||||
"time-grunt": "0.4.0"
|
||||
"express": "3.x"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test",
|
||||
"start": "make runserver",
|
||||
"prepublish": "bower install --config.interactive=false -s"
|
||||
"start": "make runserver"
|
||||
},
|
||||
"license": "MPL-2.0"
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import os
|
||||
|
||||
DEBUG = False
|
||||
|
||||
|
||||
# XXX Once we're on a branch with bug 993478 landed, we may want to get
|
||||
# rid of this HTTP server and just use the built-in one from Marionette,
|
||||
# since there will less code to maintain, and it will be faster. We'll
|
||||
@ -61,6 +60,16 @@ class BaseTestFrontendUnits(MarionetteTestCase):
|
||||
def setUp(self):
|
||||
super(BaseTestFrontendUnits, self).setUp()
|
||||
|
||||
# Unfortunately, enforcing preferences currently comes with the side
|
||||
# effect of launching and restarting the browser before running the
|
||||
# real functional tests. Bug 1048554 has been filed to track this.
|
||||
#
|
||||
# Note: when e10s is enabled by default, this pref can go away. The automatic
|
||||
# restart will also go away if this is still the only pref set here.
|
||||
self.marionette.enforce_gecko_prefs({
|
||||
"browser.tabs.remote.autostart": True
|
||||
})
|
||||
|
||||
# This extends the timeout for find_element. We need this as the tests
|
||||
# take an amount of time to run after loading, which we have to wait for.
|
||||
self.marionette.set_search_timeout(60000)
|
||||
|
@ -70,17 +70,6 @@ const ITEM_RECORD_PROPERTIES = `
|
||||
syncStatus
|
||||
`.trim().split(/\s+/);
|
||||
|
||||
// Article objects that are passed to ReadingList.addItem may contain
|
||||
// some properties that are known but are not currently stored in the
|
||||
// ReadingList records. This is the list of properties that are knowingly
|
||||
// disregarded before the item is normalized.
|
||||
const ITEM_DISREGARDED_PROPERTIES = `
|
||||
byline
|
||||
dir
|
||||
content
|
||||
length
|
||||
`.trim().split(/\s+/);
|
||||
|
||||
// Each local item has a syncStatus indicating the state of the item in relation
|
||||
// to the sync server. See also Sync.jsm.
|
||||
const SYNC_STATUS_SYNCED = 0;
|
||||
@ -991,9 +980,6 @@ ReadingListItemIterator.prototype = {
|
||||
function normalizeRecord(nonNormalizedRecord) {
|
||||
let record = {};
|
||||
for (let prop in nonNormalizedRecord) {
|
||||
if (ITEM_DISREGARDED_PROPERTIES.indexOf(prop) >= 0) {
|
||||
continue;
|
||||
}
|
||||
if (ITEM_RECORD_PROPERTIES.indexOf(prop) < 0) {
|
||||
throw new Error("Unrecognized item property: " + prop);
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/devtools/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
|
||||
@ -205,23 +207,23 @@ let SessionSaverInternal = {
|
||||
delete state.deferredInitialState;
|
||||
}
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
// We want to restore closed windows that are marked with _shouldRestore.
|
||||
// We're doing this here because we want to control this only when saving
|
||||
// the file.
|
||||
while (state._closedWindows.length) {
|
||||
let i = state._closedWindows.length - 1;
|
||||
if (AppConstants.platform != "macosx") {
|
||||
// We want to restore closed windows that are marked with _shouldRestore.
|
||||
// We're doing this here because we want to control this only when saving
|
||||
// the file.
|
||||
while (state._closedWindows.length) {
|
||||
let i = state._closedWindows.length - 1;
|
||||
|
||||
if (!state._closedWindows[i]._shouldRestore) {
|
||||
// We only need to go until _shouldRestore
|
||||
// is falsy since we're going in reverse.
|
||||
break;
|
||||
if (!state._closedWindows[i]._shouldRestore) {
|
||||
// We only need to go until _shouldRestore
|
||||
// is falsy since we're going in reverse.
|
||||
break;
|
||||
}
|
||||
|
||||
delete state._closedWindows[i]._shouldRestore;
|
||||
state.windows.unshift(state._closedWindows.pop());
|
||||
}
|
||||
|
||||
delete state._closedWindows[i]._shouldRestore;
|
||||
state.windows.unshift(state._closedWindows.pop());
|
||||
}
|
||||
#endif
|
||||
|
||||
stopWatchFinish("COLLECT_DATA_MS", "COLLECT_DATA_LONGEST_OP_MS");
|
||||
return this._writeState(state);
|
||||
|
@ -126,6 +126,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
|
||||
"resource:///modules/RecentWindow.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "GlobalState",
|
||||
"resource:///modules/sessionstore/GlobalState.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
|
||||
@ -883,9 +885,7 @@ let SessionStoreInternal = {
|
||||
|
||||
if (closedWindowState) {
|
||||
let newWindowState;
|
||||
#ifndef XP_MACOSX
|
||||
if (!this._doResumeSession()) {
|
||||
#endif
|
||||
if (AppConstants.platform == "macosx" || !this._doResumeSession()) {
|
||||
// We want to split the window up into pinned tabs and unpinned tabs.
|
||||
// Pinned tabs should be restored. If there are any remaining tabs,
|
||||
// they should be added back to _closedWindows.
|
||||
@ -909,7 +909,6 @@ let SessionStoreInternal = {
|
||||
delete normalTabsState.windows[0].__lastSessionWindowID;
|
||||
this._closedWindows[closedWindowIndex] = normalTabsState.windows[0];
|
||||
}
|
||||
#ifndef XP_MACOSX
|
||||
}
|
||||
else {
|
||||
// If we're just restoring the window, make sure it gets removed from
|
||||
@ -918,7 +917,7 @@ let SessionStoreInternal = {
|
||||
newWindowState = closedWindowState;
|
||||
delete newWindowState.hidden;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (newWindowState) {
|
||||
// Ensure that the window state isn't hidden
|
||||
this._restoreCount = 1;
|
||||
@ -1067,11 +1066,11 @@ let SessionStoreInternal = {
|
||||
SessionCookies.update([winData]);
|
||||
}
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
// Until we decide otherwise elsewhere, this window is part of a series
|
||||
// of closing windows to quit.
|
||||
winData._shouldRestore = true;
|
||||
#endif
|
||||
if (AppConstants.platform != "macosx") {
|
||||
// Until we decide otherwise elsewhere, this window is part of a series
|
||||
// of closing windows to quit.
|
||||
winData._shouldRestore = true;
|
||||
}
|
||||
|
||||
// Store the window's close date to figure out when each individual tab
|
||||
// was closed. This timestamp should allow re-arranging data based on how
|
||||
@ -2175,21 +2174,21 @@ let SessionStoreInternal = {
|
||||
// shallow copy this._closedWindows to preserve current state
|
||||
let lastClosedWindowsCopy = this._closedWindows.slice();
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
// If no non-popup browser window remains open, return the state of the last
|
||||
// closed window(s). We only want to do this when we're actually "ending"
|
||||
// the session.
|
||||
//XXXzpao We should do this for _restoreLastWindow == true, but that has
|
||||
// its own check for popups. c.f. bug 597619
|
||||
if (nonPopupCount == 0 && lastClosedWindowsCopy.length > 0 &&
|
||||
RunState.isQuitting) {
|
||||
// prepend the last non-popup browser window, so that if the user loads more tabs
|
||||
// at startup we don't accidentally add them to a popup window
|
||||
do {
|
||||
total.unshift(lastClosedWindowsCopy.shift())
|
||||
} while (total[0].isPopup && lastClosedWindowsCopy.length > 0)
|
||||
if (AppConstants.platform != "macosx") {
|
||||
// If no non-popup browser window remains open, return the state of the last
|
||||
// closed window(s). We only want to do this when we're actually "ending"
|
||||
// the session.
|
||||
//XXXzpao We should do this for _restoreLastWindow == true, but that has
|
||||
// its own check for popups. c.f. bug 597619
|
||||
if (nonPopupCount == 0 && lastClosedWindowsCopy.length > 0 &&
|
||||
RunState.isQuitting) {
|
||||
// prepend the last non-popup browser window, so that if the user loads more tabs
|
||||
// at startup we don't accidentally add them to a popup window
|
||||
do {
|
||||
total.unshift(lastClosedWindowsCopy.shift())
|
||||
} while (total[0].isPopup && lastClosedWindowsCopy.length > 0)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (activeWindow) {
|
||||
this.activeWindowSSiCache = activeWindow.__SSi || "";
|
||||
@ -3422,15 +3421,15 @@ let SessionStoreInternal = {
|
||||
if (this._closedWindows.length <= this._max_windows_undo)
|
||||
return;
|
||||
let spliceTo = this._max_windows_undo;
|
||||
#ifndef XP_MACOSX
|
||||
let normalWindowIndex = 0;
|
||||
// try to find a non-popup window in this._closedWindows
|
||||
while (normalWindowIndex < this._closedWindows.length &&
|
||||
!!this._closedWindows[normalWindowIndex].isPopup)
|
||||
normalWindowIndex++;
|
||||
if (normalWindowIndex >= this._max_windows_undo)
|
||||
spliceTo = normalWindowIndex + 1;
|
||||
#endif
|
||||
if (AppConstants.platform != "macosx") {
|
||||
let normalWindowIndex = 0;
|
||||
// try to find a non-popup window in this._closedWindows
|
||||
while (normalWindowIndex < this._closedWindows.length &&
|
||||
!!this._closedWindows[normalWindowIndex].isPopup)
|
||||
normalWindowIndex++;
|
||||
if (normalWindowIndex >= this._max_windows_undo)
|
||||
spliceTo = normalWindowIndex + 1;
|
||||
}
|
||||
this._closedWindows.splice(spliceTo, this._closedWindows.length);
|
||||
},
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
var gStateObject;
|
||||
var gTreeData;
|
||||
@ -179,11 +182,9 @@ function onListClick(aEvent) {
|
||||
if (cell.col) {
|
||||
// Restore this specific tab in the same window for middle/double/accel clicking
|
||||
// on a tab's title.
|
||||
#ifdef XP_MACOSX
|
||||
let accelKey = aEvent.metaKey;
|
||||
#else
|
||||
let accelKey = aEvent.ctrlKey;
|
||||
#endif
|
||||
let accelKey = AppConstants.platform == "macosx" ?
|
||||
aEvent.metaKey :
|
||||
aEvent.ctrlKey;
|
||||
if ((aEvent.button == 1 || aEvent.button == 0 && aEvent.detail == 2 || accelKey) &&
|
||||
cell.col.id == "title" &&
|
||||
!treeView.isContainer(cell.row)) {
|
||||
|
@ -4,5 +4,5 @@
|
||||
|
||||
browser.jar:
|
||||
* content/browser/aboutSessionRestore.xhtml (content/aboutSessionRestore.xhtml)
|
||||
* content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js)
|
||||
content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js)
|
||||
content/browser/content-sessionStore.js (content/content-sessionStore.js)
|
||||
|
@ -36,7 +36,9 @@ EXTRA_JS_MODULES.sessionstore = [
|
||||
'SessionFile.jsm',
|
||||
'SessionHistory.jsm',
|
||||
'SessionMigration.jsm',
|
||||
'SessionSaver.jsm',
|
||||
'SessionStorage.jsm',
|
||||
'SessionStore.jsm',
|
||||
'SessionWorker.js',
|
||||
'SessionWorker.jsm',
|
||||
'TabAttributes.jsm',
|
||||
@ -45,10 +47,5 @@ EXTRA_JS_MODULES.sessionstore = [
|
||||
'Utils.jsm',
|
||||
]
|
||||
|
||||
EXTRA_PP_JS_MODULES.sessionstore += [
|
||||
'SessionSaver.jsm',
|
||||
'SessionStore.jsm',
|
||||
]
|
||||
|
||||
with Files('**'):
|
||||
BUG_COMPONENT = ('Firefox', 'Session Restore')
|
||||
|
@ -5,7 +5,6 @@
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
const kDebuggerPrefs = [
|
||||
"devtools.debugger.remote-enabled",
|
||||
"devtools.debugger.chrome-enabled",
|
||||
"devtools.chrome.enabled"
|
||||
];
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
@ -627,8 +627,7 @@ let gDevToolsBrowser = {
|
||||
// Enable Browser Toolbox?
|
||||
let chromeEnabled = Services.prefs.getBoolPref("devtools.chrome.enabled");
|
||||
let devtoolsRemoteEnabled = Services.prefs.getBoolPref("devtools.debugger.remote-enabled");
|
||||
let remoteEnabled = chromeEnabled && devtoolsRemoteEnabled &&
|
||||
Services.prefs.getBoolPref("devtools.debugger.chrome-enabled");
|
||||
let remoteEnabled = chromeEnabled && devtoolsRemoteEnabled;
|
||||
toggleCmd("Tools:BrowserToolbox", remoteEnabled);
|
||||
toggleCmd("Tools:BrowserContentToolbox", remoteEnabled && win.gMultiProcessBrowser);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
let gItemsToTest = {
|
||||
"menu_devToolbar": "devtools.toolbar.enabled",
|
||||
"menu_browserToolbox": ["devtools.chrome.enabled", "devtools.debugger.remote-enabled", "devtools.debugger.chrome-enabled"],
|
||||
"menu_browserToolbox": ["devtools.chrome.enabled", "devtools.debugger.remote-enabled"],
|
||||
"javascriptConsole": "devtools.errorconsole.enabled",
|
||||
"menu_devtools_connect": "devtools.debugger.remote-enabled",
|
||||
};
|
||||
|
@ -550,30 +550,29 @@ StyleEditorUI.prototype = {
|
||||
this.emit("editor-selected", editor);
|
||||
|
||||
// Is there any CSS coverage markup to include?
|
||||
csscoverage.getUsage(this._target).then(usage => {
|
||||
if (usage == null) {
|
||||
return;
|
||||
let usage = yield csscoverage.getUsage(this._target);
|
||||
if (usage == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let href = csscoverage.sheetToUrl(editor.styleSheet);
|
||||
let data = yield usage.createEditorReport(href)
|
||||
|
||||
editor.removeAllUnusedRegions();
|
||||
|
||||
if (data.reports.length > 0) {
|
||||
// Only apply if this file isn't compressed. We detect a
|
||||
// compressed file if there are more rules than lines.
|
||||
let text = editor.sourceEditor.getText();
|
||||
let lineCount = text.split("\n").length;
|
||||
let ruleCount = editor.styleSheet.ruleCount;
|
||||
if (lineCount >= ruleCount) {
|
||||
editor.addUnusedRegions(data.reports);
|
||||
}
|
||||
|
||||
let href = csscoverage.sheetToUrl(editor.styleSheet);
|
||||
usage.createEditorReport(href).then(data => {
|
||||
editor.removeAllUnusedRegions();
|
||||
|
||||
if (data.reports.length > 0) {
|
||||
// Only apply if this file isn't compressed. We detect a
|
||||
// compressed file if there are more rules than lines.
|
||||
let text = editor.sourceEditor.getText();
|
||||
let lineCount = text.split("\n").length;
|
||||
let ruleCount = editor.styleSheet.ruleCount;
|
||||
if (lineCount >= ruleCount) {
|
||||
editor.addUnusedRegions(data.reports);
|
||||
}
|
||||
else {
|
||||
this.emit("error", { key: "error-compressed", level: "info" });
|
||||
}
|
||||
}
|
||||
}, Cu.reportError);
|
||||
}, Cu.reportError);
|
||||
else {
|
||||
this.emit("error", { key: "error-compressed", level: "info" });
|
||||
}
|
||||
}
|
||||
}.bind(this)).then(null, Cu.reportError);
|
||||
}.bind(this)
|
||||
});
|
||||
@ -632,7 +631,8 @@ StyleEditorUI.prototype = {
|
||||
* @param {number} col
|
||||
* Column number to jump to
|
||||
* @return {Promise}
|
||||
* Promise that will resolve when the editor is selected.
|
||||
* Promise that will resolve when the editor is selected and ready
|
||||
* to be used.
|
||||
*/
|
||||
_selectEditor: function(editor, line, col) {
|
||||
line = line || 0;
|
||||
@ -707,6 +707,9 @@ StyleEditorUI.prototype = {
|
||||
* Line to which the caret should be moved (zero-indexed).
|
||||
* @param {Number} [col]
|
||||
* Column to which the caret should be moved (zero-indexed).
|
||||
* @return {Promise}
|
||||
* Promise that will resolve when the editor is selected and ready
|
||||
* to be used.
|
||||
*/
|
||||
selectStyleSheet: function(stylesheet, line, col) {
|
||||
this._styleSheetToSelect = {
|
||||
@ -717,7 +720,7 @@ StyleEditorUI.prototype = {
|
||||
|
||||
/* Switch to the editor for this sheet, if it exists yet.
|
||||
Otherwise each editor will be checked when it's created. */
|
||||
this.switchToSelectedSheet();
|
||||
return this.switchToSelectedSheet();
|
||||
},
|
||||
|
||||
|
||||
|
@ -110,12 +110,15 @@ StyleEditorPanel.prototype = {
|
||||
* Line number to jump to after selecting. One-indexed
|
||||
* @param {number} col
|
||||
* Column number to jump to after selecting. One-indexed
|
||||
* @return {Promise}
|
||||
* Promise that will resolve when the editor is selected and ready
|
||||
* to be used.
|
||||
*/
|
||||
selectStyleSheet: function(href, line, col) {
|
||||
if (!this._debuggee || !this.UI) {
|
||||
return;
|
||||
}
|
||||
this.UI.selectStyleSheet(href, line - 1, col ? col - 1 : 0);
|
||||
return this.UI.selectStyleSheet(href, line - 1, col ? col - 1 : 0);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1,46 +1,44 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
const SIMPLE = TEST_BASE_HTTP + "simple.css";
|
||||
const DOCUMENT_WITH_ONE_STYLESHEET = "data:text/html;charset=UTF-8," +
|
||||
encodeURIComponent(
|
||||
["<!DOCTYPE html>",
|
||||
"<html>",
|
||||
" <head>",
|
||||
" <title>Bug 870339</title>",
|
||||
' <link rel="stylesheet" type="text/css" href="'+SIMPLE+'">',
|
||||
" </head>",
|
||||
" <body>",
|
||||
" </body>",
|
||||
"</html>"
|
||||
].join("\n"));
|
||||
|
||||
function test()
|
||||
{
|
||||
const SIMPLE = TEST_BASE_HTTP + "simple.css";
|
||||
const DOCUMENT_WITH_ONE_STYLESHEET = "data:text/html;charset=UTF-8," +
|
||||
encodeURIComponent(
|
||||
["<!DOCTYPE html>",
|
||||
"<html>",
|
||||
" <head>",
|
||||
" <title>Bug 870339</title>",
|
||||
' <link rel="stylesheet" type="text/css" href="'+SIMPLE+'">',
|
||||
" </head>",
|
||||
" <body>",
|
||||
" </body>",
|
||||
"</html>"
|
||||
].join("\n"));
|
||||
add_task(function* () {
|
||||
let { ui } = yield openStyleEditorForURL(DOCUMENT_WITH_ONE_STYLESHEET);
|
||||
|
||||
waitForExplicitFinish();
|
||||
addTabAndOpenStyleEditors(1, function (aPanel) {
|
||||
let UI = aPanel.UI;
|
||||
// Spam the _onNewDocument callback multiple times before the
|
||||
// StyleEditorActor has a chance to respond to the first one.
|
||||
const SPAM_COUNT = 2;
|
||||
for (let i=0; i<SPAM_COUNT; ++i) {
|
||||
ui._onNewDocument();
|
||||
}
|
||||
|
||||
// Spam the _onNewDocument callback multiple times before the
|
||||
// StyleEditorActor has a chance to respond to the first one.
|
||||
const SPAM_COUNT = 2;
|
||||
for (let i=0; i<SPAM_COUNT; ++i) {
|
||||
UI._onNewDocument();
|
||||
}
|
||||
|
||||
// Wait for the StyleEditorActor to respond to each "newDocument"
|
||||
// message.
|
||||
// Wait for the StyleEditorActor to respond to each "newDocument"
|
||||
// message.
|
||||
yield new Promise(resolve => {
|
||||
let loadCount = 0;
|
||||
UI.on("stylesheets-reset", function () {
|
||||
ui.on("stylesheets-reset", function onReset() {
|
||||
++loadCount;
|
||||
if (loadCount == SPAM_COUNT) {
|
||||
ui.off("stylesheets-reset", onReset);
|
||||
// No matter how large SPAM_COUNT is, the number of style
|
||||
// sheets should never be more than the number of style sheets
|
||||
// in the document.
|
||||
is(UI.editors.length, 1, "correct style sheet count");
|
||||
finish();
|
||||
is(ui.editors.length, 1, "correct style sheet count");
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
content.location = DOCUMENT_WITH_ONE_STYLESHEET;
|
||||
}
|
||||
});
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const FRAME_SCRIPT_UTILS_URL = "chrome://browser/content/devtools/frame-script-utils.js"
|
||||
const TEST_BASE = "chrome://mochitests/content/browser/browser/devtools/styleeditor/test/";
|
||||
const TEST_BASE_HTTP = "http://example.com/browser/browser/devtools/styleeditor/test/";
|
||||
const TEST_BASE_HTTPS = "https://example.com/browser/browser/devtools/styleeditor/test/";
|
||||
@ -136,4 +137,64 @@ function openStyleEditorInWindow(win, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads shared/frame-script-utils.js in the specified tab.
|
||||
*
|
||||
* @param tab
|
||||
* Optional tab to load the frame script in. Defaults to the current tab.
|
||||
*/
|
||||
function loadCommonFrameScript(tab) {
|
||||
let browser = tab ? tab.linkedBrowser : gBrowser.selectedBrowser;
|
||||
|
||||
browser.messageManager.loadFrameScript(FRAME_SCRIPT_UTILS_URL, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an async message to the frame script (chrome -> content) and wait for a
|
||||
* response message with the same name (content -> chrome).
|
||||
*
|
||||
* @param String name
|
||||
* The message name. Should be one of the messages defined
|
||||
* shared/frame-script-utils.js
|
||||
* @param Object data
|
||||
* Optional data to send along
|
||||
* @param Object objects
|
||||
* Optional CPOW objects to send along
|
||||
* @param Boolean expectResponse
|
||||
* If set to false, don't wait for a response with the same name from the
|
||||
* content script. Defaults to true.
|
||||
*
|
||||
* @return Promise
|
||||
* Resolves to the response data if a response is expected, immediately
|
||||
* resolves otherwise
|
||||
*/
|
||||
function executeInContent(name, data={}, objects={}, expectResponse=true) {
|
||||
let mm = gBrowser.selectedBrowser.messageManager;
|
||||
|
||||
mm.sendAsyncMessage(name, data, objects);
|
||||
if (expectResponse) {
|
||||
return waitForContentMessage(name);
|
||||
} else {
|
||||
return promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for a content -> chrome message on the message manager (the window
|
||||
* messagemanager is used).
|
||||
* @param {String} name The message name
|
||||
* @return {Promise} A promise that resolves to the response data when the
|
||||
* message has been received
|
||||
*/
|
||||
function waitForContentMessage(name) {
|
||||
let mm = gBrowser.selectedBrowser.messageManager;
|
||||
|
||||
let def = promise.defer();
|
||||
mm.addMessageListener(name, function onMessage(msg) {
|
||||
mm.removeMessageListener(name, onMessage);
|
||||
def.resolve(msg);
|
||||
});
|
||||
return def.promise;
|
||||
}
|
||||
|
||||
registerCleanupFunction(cleanup);
|
||||
|
@ -16,7 +16,7 @@ pref("devtools.webide.simulatorAddonID", "fxos_#SLASHED_VERSION#_simulator@mozil
|
||||
pref("devtools.webide.simulatorAddonRegExp", "fxos_(.*)_simulator@mozilla\\.org$");
|
||||
pref("devtools.webide.adbAddonURL", "https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/adb-helper/#OS#/adbhelper-#OS#-latest.xpi");
|
||||
pref("devtools.webide.adbAddonID", "adbhelper@mozilla.org");
|
||||
pref("devtools.webide.adaptersAddonURL", "https://ftp.mozilla.org/pub/mozilla.org/labs/fxdt-adapters/#OS#/fxdt-adapters-#OS#-latest.xpi");
|
||||
pref("devtools.webide.adaptersAddonURL", "https://ftp.mozilla.org/pub/mozilla.org/labs/valence/#OS#/valence-#OS#-latest.xpi");
|
||||
pref("devtools.webide.adaptersAddonID", "fxdevtools-adapters@mozilla.org");
|
||||
pref("devtools.webide.monitorWebSocketURL", "ws://localhost:9000");
|
||||
pref("devtools.webide.lastConnectedRuntime", "");
|
||||
|
@ -162,6 +162,15 @@ var ShumwayCom = {
|
||||
environment.swfUrl, environment.privateBrowsing);
|
||||
},
|
||||
|
||||
getWeakMapKeys: function (weakMap) {
|
||||
var keys = Components.utils.nondeterministicGetWeakMapKeys(weakMap);
|
||||
var result = new content.Array();
|
||||
keys.forEach(function (key) {
|
||||
result.push(key);
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
setLoadFileCallback: function (callback) {
|
||||
onLoadFileCallback = callback;
|
||||
},
|
||||
|
@ -98,6 +98,10 @@ var ShumwayBootstrapUtils = {
|
||||
isRegistered: false,
|
||||
|
||||
register: function () {
|
||||
if (this.isRegistered) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isRegistered = true;
|
||||
|
||||
// Register the components.
|
||||
@ -121,6 +125,10 @@ var ShumwayBootstrapUtils = {
|
||||
},
|
||||
|
||||
unregister: function () {
|
||||
if (!this.isRegistered) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isRegistered = false;
|
||||
|
||||
// Remove the contract/component.
|
||||
|
@ -392,21 +392,19 @@ ShumwayStreamConverterBase.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
if (!url) { // at this point url shall be known -- asserting
|
||||
throw new Error('Movie url is not specified');
|
||||
}
|
||||
|
||||
baseUrl = pageUrl;
|
||||
if (objectParams.base) {
|
||||
baseUrl = Services.io.newURI(objectParams.base, null, pageUrl).spec;
|
||||
} else {
|
||||
baseUrl = pageUrl;
|
||||
try {
|
||||
var parsedPageUrl = Services.io.newURI(pageUrl);
|
||||
baseUrl = Services.io.newURI(objectParams.base, null, parsedPageUrl).spec;
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
|
||||
var movieParams = {};
|
||||
if (objectParams.flashvars) {
|
||||
movieParams = parseQueryString(objectParams.flashvars);
|
||||
}
|
||||
var queryStringMatch = /\?([^#]+)/.exec(url);
|
||||
var queryStringMatch = url && /\?([^#]+)/.exec(url);
|
||||
if (queryStringMatch) {
|
||||
var queryStringParams = parseQueryString(queryStringMatch[1]);
|
||||
for (var i in queryStringParams) {
|
||||
@ -416,7 +414,8 @@ ShumwayStreamConverterBase.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
var allowScriptAccess = isScriptAllowed(objectParams.allowscriptaccess, url, pageUrl);
|
||||
var allowScriptAccess = !!url &&
|
||||
isScriptAllowed(objectParams.allowscriptaccess, url, pageUrl);
|
||||
|
||||
var startupInfo = {};
|
||||
startupInfo.window = window;
|
||||
@ -494,6 +493,18 @@ ShumwayStreamConverterBase.prototype = {
|
||||
var domWindow = getDOMWindow(channel);
|
||||
let startupInfo = converter.getStartupInfo(domWindow,
|
||||
converter.getUrlHint(originalURI));
|
||||
|
||||
listener.onStopRequest(aRequest, context, statusCode);
|
||||
|
||||
if (!startupInfo.url) {
|
||||
// Special case when movie URL is not specified, e.g. swfobject
|
||||
// checks only version. No need to instantiate the flash plugin.
|
||||
if (startupInfo.embedTag) {
|
||||
setupSimpleExternalInterface(startupInfo.embedTag);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isShumwayEnabledFor(startupInfo)) {
|
||||
fallbackToNativePlugin(domWindow, false, true);
|
||||
return;
|
||||
@ -515,8 +526,6 @@ ShumwayStreamConverterBase.prototype = {
|
||||
ActivationQueue.enqueue(startupInfo, function(domWindow) {
|
||||
activateShumwayScripts(domWindow);
|
||||
}.bind(null, domWindow));
|
||||
|
||||
listener.onStopRequest(aRequest, context, statusCode);
|
||||
}
|
||||
};
|
||||
|
||||
@ -539,6 +548,18 @@ ShumwayStreamConverterBase.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
function setupSimpleExternalInterface(embedTag) {
|
||||
Components.utils.exportFunction(function (variable) {
|
||||
switch (variable) {
|
||||
case '$version':
|
||||
return 'SHUMWAY 10,0,0';
|
||||
default:
|
||||
log('GetVariable: ' + variable);
|
||||
return undefined;
|
||||
}
|
||||
}, embedTag.wrappedJSObject, {defineAs: 'GetVariable'});
|
||||
}
|
||||
|
||||
function isScriptAllowed(allowScriptAccessParameter, url, pageUrl) {
|
||||
if (!allowScriptAccessParameter) {
|
||||
allowScriptAccessParameter = 'sameDomain';
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,2 +1,2 @@
|
||||
0.10.268
|
||||
02fd13d
|
||||
0.10.312
|
||||
9de7c7a
|
||||
|
File diff suppressed because one or more lines are too long
@ -44,7 +44,13 @@ let ReaderParent = {
|
||||
receiveMessage: function(message) {
|
||||
switch (message.name) {
|
||||
case "Reader:AddToList":
|
||||
ReadingList.addItem(message.data.article);
|
||||
let article = message.data.article;
|
||||
ReadingList.addItem({
|
||||
url: article.url,
|
||||
title: article.title,
|
||||
excerpt: article.excerpt,
|
||||
status: article.status
|
||||
});
|
||||
break;
|
||||
|
||||
case "Reader:ArticleGet":
|
||||
|
@ -423,6 +423,56 @@ add_task(function test_topSitesWithSuggestedLinks() {
|
||||
NewTabUtils.getProviderLinks = origGetProviderLinks;
|
||||
});
|
||||
|
||||
add_task(function test_suggestedAttributes() {
|
||||
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
|
||||
NewTabUtils.isTopPlacesSite = () => true;
|
||||
|
||||
let frecent_sites = ["top.site.com"];
|
||||
let imageURI = "https://image/";
|
||||
let title = "the title";
|
||||
let type = "affiliate";
|
||||
let url = "http://test.url/";
|
||||
let data = {
|
||||
suggested: [{
|
||||
frecent_sites,
|
||||
imageURI,
|
||||
title,
|
||||
type,
|
||||
url
|
||||
}]
|
||||
};
|
||||
let dataURI = "data:application/json," + escape(JSON.stringify(data));
|
||||
|
||||
yield promiseSetupDirectoryLinksProvider({linksURL: dataURI});
|
||||
|
||||
// Wait for links to get loaded
|
||||
let gLinks = NewTabUtils.links;
|
||||
gLinks.addProvider(DirectoryLinksProvider);
|
||||
gLinks.populateCache();
|
||||
yield new Promise(resolve => {
|
||||
NewTabUtils.allPages.register({
|
||||
observe: _ => _,
|
||||
update() {
|
||||
NewTabUtils.allPages.unregister(this);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Make sure we get the expected attributes on the suggested tile
|
||||
let link = gLinks.getLinks()[0];
|
||||
do_check_eq(link.imageURI, imageURI);
|
||||
do_check_eq(link.targetedSite, frecent_sites[0]);
|
||||
do_check_eq(link.title, title);
|
||||
do_check_eq(link.type, type);
|
||||
do_check_eq(link.url, url);
|
||||
|
||||
// Cleanup.
|
||||
NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
|
||||
gLinks.removeProvider(DirectoryLinksProvider);
|
||||
DirectoryLinksProvider.removeObserver(gLinks);
|
||||
});
|
||||
|
||||
add_task(function test_frequencyCappedSites_views() {
|
||||
Services.prefs.setCharPref(kPingUrlPref, "");
|
||||
let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
|
||||
|
@ -574,9 +574,9 @@ class LSANLeaks(object):
|
||||
# Don't various allocation-related stack frames, as they do not help much to
|
||||
# distinguish different leaks.
|
||||
unescapedSkipList = [
|
||||
"malloc", "js_malloc", "malloc_", "__interceptor_malloc", "moz_malloc", "moz_xmalloc",
|
||||
"calloc", "js_calloc", "calloc_", "__interceptor_calloc", "moz_calloc", "moz_xcalloc",
|
||||
"realloc","js_realloc", "realloc_", "__interceptor_realloc", "moz_realloc", "moz_xrealloc",
|
||||
"malloc", "js_malloc", "malloc_", "__interceptor_malloc", "moz_xmalloc",
|
||||
"calloc", "js_calloc", "calloc_", "__interceptor_calloc", "moz_xcalloc",
|
||||
"realloc","js_realloc", "realloc_", "__interceptor_realloc", "moz_xrealloc",
|
||||
"new",
|
||||
"js::MallocProvider",
|
||||
]
|
||||
|
@ -35,3 +35,5 @@ if [ -z "$CXX" ]; then
|
||||
fi
|
||||
|
||||
. "$topsrcdir/build/mozconfig.cache"
|
||||
|
||||
export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=/builds/crash-stats-api.token
|
||||
|
@ -12,3 +12,5 @@ fi
|
||||
# Some builds (eg: Mulet) don't want the installer, so only set this if it
|
||||
# hasn't already been set.
|
||||
MOZ_AUTOMATION_INSTALLER=${MOZ_AUTOMATION_INSTALLER-1}
|
||||
|
||||
export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=c:/builds/crash-stats-api.token
|
||||
|
@ -7,28 +7,14 @@ var MANIFESTS = [
|
||||
do_get_file("data/test_bug519468.manifest")
|
||||
];
|
||||
|
||||
Components.utils.import("resource://testing-common/MockRegistrar.jsm");
|
||||
// Stub in the locale service so we can control what gets returned as the OS locale setting
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
let stubOSLocale = null;
|
||||
|
||||
stubID = Components.ID("9d09d686-d913-414c-a1e6-4be8652d7d93");
|
||||
localeContractID = "@mozilla.org/intl/nslocaleservice;1";
|
||||
|
||||
StubLocaleService = {
|
||||
classDescription: "Stub version of Locale service for testing",
|
||||
classID: stubID,
|
||||
contractID: localeContractID,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsILocaleService, Ci.nsISupports, Ci.nsIFactory]),
|
||||
|
||||
createInstance: function (outer, iid) {
|
||||
if (outer)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
return this.QueryInterface(iid);
|
||||
},
|
||||
lockFactory: function (lock) {
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsILocaleService, Ci.nsISupports]),
|
||||
|
||||
getLocaleComponentForUserAgent: function SLS_getLocaleComponentForUserAgent()
|
||||
{
|
||||
@ -36,14 +22,7 @@ StubLocaleService = {
|
||||
}
|
||||
}
|
||||
|
||||
let registrar = Components.manager.nsIComponentRegistrar;
|
||||
// Save original factory.
|
||||
let localeCID = registrar.contractIDToCID(localeContractID)
|
||||
let originalFactory =
|
||||
Components.manager.getClassObject(Components.classes[localeContractID],
|
||||
Components.interfaces.nsIFactory);
|
||||
|
||||
registrar.registerFactory(stubID, "Unit test Locale Service", localeContractID, StubLocaleService);
|
||||
MockRegistrar.register("@mozilla.org/intl/nslocaleservice;1", StubLocaleService);
|
||||
|
||||
// Now fire up the test
|
||||
do_test_pending()
|
||||
|
@ -6962,6 +6962,7 @@ elif test "$GNU_CC"; then
|
||||
# -Wmaybe-uninitialized - too many false positives
|
||||
# -Wdeprecated-declarations - we don't want our builds held hostage when a
|
||||
# platform-specific API becomes deprecated.
|
||||
# -Wfree-nonheap-object - false positives during PGO
|
||||
MOZ_C_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_c_has_noerror_uninitialized)
|
||||
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_cxx_has_noerror_uninitialized)
|
||||
MOZ_C_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_c_has_noerror_maybe_uninitialized)
|
||||
@ -6972,6 +6973,8 @@ elif test "$GNU_CC"; then
|
||||
if test -n "$MOZ_PGO"; then
|
||||
MOZ_C_SUPPORTS_WARNING(-W, no-error=coverage-mismatch, ac_c_has_noerror_coverage_mismatch)
|
||||
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=coverage-mismatch, ac_cxx_has_noerror_coverage_mismatch)
|
||||
MOZ_C_SUPPORTS_WARNING(-W, no-error=free-nonheap-object, ac_c_has_noerror_free_nonheap_object)
|
||||
MOZ_CXX_SUPPORTS_WARNING(-W, no-error=free-nonheap-object, ac_cxx_has_noerror_free_nonheap_object)
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -446,6 +446,11 @@ public:
|
||||
|
||||
nsresult StartTimeout();
|
||||
|
||||
void SetInterceptController(nsINetworkInterceptController* aInterceptController)
|
||||
{
|
||||
mInterceptController = aInterceptController;
|
||||
}
|
||||
|
||||
private:
|
||||
~nsPingListener();
|
||||
|
||||
@ -453,6 +458,7 @@ private:
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
nsCOMPtr<nsINetworkInterceptController> mInterceptController;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsPingListener, nsIStreamListener, nsIRequestObserver,
|
||||
@ -517,8 +523,15 @@ NS_IMETHODIMP
|
||||
nsPingListener::GetInterface(const nsIID& aIID, void** aResult)
|
||||
{
|
||||
if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) {
|
||||
NS_ADDREF_THIS();
|
||||
*aResult = (nsIChannelEventSink*)this;
|
||||
nsCOMPtr<nsIChannelEventSink> copy(this);
|
||||
*aResult = copy.forget().take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aIID.Equals(NS_GET_IID(nsINetworkInterceptController)) &&
|
||||
mInterceptController) {
|
||||
nsCOMPtr<nsINetworkInterceptController> copy(mInterceptController);
|
||||
*aResult = copy.forget().take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -557,13 +570,14 @@ nsPingListener::AsyncOnChannelRedirect(nsIChannel* aOldChan,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
struct SendPingInfo
|
||||
struct MOZ_STACK_CLASS SendPingInfo
|
||||
{
|
||||
int32_t numPings;
|
||||
int32_t maxPings;
|
||||
bool requireSameHost;
|
||||
nsIURI* target;
|
||||
nsIURI* referrer;
|
||||
nsIDocShell* docShell;
|
||||
uint32_t referrerPolicy;
|
||||
};
|
||||
|
||||
@ -697,6 +711,8 @@ SendPing(void* aClosure, nsIContent* aContent, nsIURI* aURI,
|
||||
nsPingListener* pingListener =
|
||||
new nsPingListener(info->requireSameHost, aContent, loadGroup);
|
||||
|
||||
nsCOMPtr<nsINetworkInterceptController> interceptController = do_QueryInterface(info->docShell);
|
||||
pingListener->SetInterceptController(interceptController);
|
||||
nsCOMPtr<nsIStreamListener> listener(pingListener);
|
||||
|
||||
// Observe redirects as well:
|
||||
@ -721,7 +737,8 @@ SendPing(void* aClosure, nsIContent* aContent, nsIURI* aURI,
|
||||
|
||||
// Spec: http://whatwg.org/specs/web-apps/current-work/#ping
|
||||
static void
|
||||
DispatchPings(nsIContent* aContent,
|
||||
DispatchPings(nsIDocShell* aDocShell,
|
||||
nsIContent* aContent,
|
||||
nsIURI* aTarget,
|
||||
nsIURI* aReferrer,
|
||||
uint32_t aReferrerPolicy)
|
||||
@ -739,6 +756,7 @@ DispatchPings(nsIContent* aContent,
|
||||
info.target = aTarget;
|
||||
info.referrer = aReferrer;
|
||||
info.referrerPolicy = aReferrerPolicy;
|
||||
info.docShell = aDocShell;
|
||||
|
||||
ForEachPing(aContent, SendPing, &info);
|
||||
}
|
||||
@ -13522,7 +13540,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
|
||||
aDocShell, // DocShell out-param
|
||||
aRequest); // Request out-param
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
DispatchPings(aContent, aURI, referer, refererPolicy);
|
||||
DispatchPings(this, aContent, aURI, referer, refererPolicy);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
|
||||
~BlobSet()
|
||||
{
|
||||
moz_free(mData);
|
||||
free(mData);
|
||||
}
|
||||
|
||||
nsresult AppendVoidPtr(const void* aData, uint32_t aLength);
|
||||
@ -52,7 +52,7 @@ protected:
|
||||
if (!bufferLen.isValid())
|
||||
return false;
|
||||
|
||||
void* data = moz_realloc(mData, bufferLen.value());
|
||||
void* data = realloc(mData, bufferLen.value());
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "nsIDOMWindowUtils.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIProgrammingLanguage.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
@ -904,8 +905,7 @@ ReifyStack(nsIStackFrame* aStack, nsTArray<ConsoleStackEntry>& aRefiedStack)
|
||||
nsresult rv = stack->GetLanguage(&language);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (language == nsIProgrammingLanguage::JAVASCRIPT ||
|
||||
language == nsIProgrammingLanguage::JAVASCRIPT2) {
|
||||
if (language == nsIProgrammingLanguage::JAVASCRIPT) {
|
||||
ConsoleStackEntry& data = *aRefiedStack.AppendElement();
|
||||
rv = StackFrameToStackEntry(stack, data, language);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -993,8 +993,7 @@ Console::Method(JSContext* aCx, MethodName aMethodName,
|
||||
return;
|
||||
}
|
||||
|
||||
if (language == nsIProgrammingLanguage::JAVASCRIPT ||
|
||||
language == nsIProgrammingLanguage::JAVASCRIPT2) {
|
||||
if (language == nsIProgrammingLanguage::JAVASCRIPT) {
|
||||
callData->mTopStackFrame.emplace();
|
||||
nsresult rv = StackFrameToStackEntry(stack,
|
||||
*callData->mTopStackFrame,
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
uint64_t aLength);
|
||||
|
||||
// The returned File takes ownership of aMemoryBuffer. aMemoryBuffer will be
|
||||
// freed by moz_free so it must be allocated by moz_malloc or something
|
||||
// freed by free so it must be allocated by malloc or something
|
||||
// compatible with it.
|
||||
static already_AddRefed<File>
|
||||
CreateMemoryFile(nsISupports* aParent, void* aMemoryBuffer, uint64_t aLength,
|
||||
@ -92,7 +92,7 @@ public:
|
||||
uint64_t aLastModifiedDate);
|
||||
|
||||
// The returned File takes ownership of aMemoryBuffer. aMemoryBuffer will be
|
||||
// freed by moz_free so it must be allocated by moz_malloc or something
|
||||
// freed by free so it must be allocated by malloc or something
|
||||
// compatible with it.
|
||||
static already_AddRefed<File>
|
||||
CreateMemoryFile(nsISupports* aParent, void* aMemoryBuffer, uint64_t aLength,
|
||||
@ -552,7 +552,7 @@ public:
|
||||
sDataOwners = nullptr;
|
||||
}
|
||||
|
||||
moz_free(mData);
|
||||
free(mData);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -102,7 +102,7 @@ nsAttrAndChildArray::~nsAttrAndChildArray()
|
||||
|
||||
Clear();
|
||||
|
||||
moz_free(mImpl);
|
||||
free(mImpl);
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
@ -635,11 +635,11 @@ nsAttrAndChildArray::Compact()
|
||||
// Then resize or free buffer
|
||||
uint32_t newSize = attrCount * ATTRSIZE + childCount;
|
||||
if (!newSize && !mImpl->mMappedAttrs) {
|
||||
moz_free(mImpl);
|
||||
free(mImpl);
|
||||
mImpl = nullptr;
|
||||
}
|
||||
else if (newSize < mImpl->mBufferSize) {
|
||||
mImpl = static_cast<Impl*>(moz_realloc(mImpl, (newSize + NS_IMPL_EXTRA_SIZE) * sizeof(nsIContent*)));
|
||||
mImpl = static_cast<Impl*>(realloc(mImpl, (newSize + NS_IMPL_EXTRA_SIZE) * sizeof(nsIContent*)));
|
||||
NS_ASSERTION(mImpl, "failed to reallocate to smaller buffer");
|
||||
|
||||
mImpl->mBufferSize = newSize;
|
||||
@ -776,7 +776,7 @@ nsAttrAndChildArray::GrowBy(uint32_t aGrowSize)
|
||||
}
|
||||
|
||||
bool needToInitialize = !mImpl;
|
||||
Impl* newImpl = static_cast<Impl*>(moz_realloc(mImpl, size * sizeof(void*)));
|
||||
Impl* newImpl = static_cast<Impl*>(realloc(mImpl, size * sizeof(void*)));
|
||||
NS_ENSURE_TRUE(newImpl, false);
|
||||
|
||||
mImpl = newImpl;
|
||||
|
@ -6052,7 +6052,7 @@ nsContentUtils::CreateBlobBuffer(JSContext* aCx,
|
||||
JS::MutableHandle<JS::Value> aBlob)
|
||||
{
|
||||
uint32_t blobLen = aData.Length();
|
||||
void* blobData = moz_malloc(blobLen);
|
||||
void* blobData = malloc(blobLen);
|
||||
nsRefPtr<File> blob;
|
||||
if (blobData) {
|
||||
memcpy(blobData, aData.BeginReading(), blobLen);
|
||||
|
@ -863,14 +863,6 @@ nsDOMClassInfo::GetClassIDNoAlloc(nsCID *aClassID)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMClassInfo::GetImplementationLanguage(uint32_t *aImplLanguage)
|
||||
{
|
||||
*aImplLanguage = nsIProgrammingLanguage::CPLUSPLUS;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMClassInfo::GetFlags(uint32_t *aFlags)
|
||||
{
|
||||
|
@ -363,7 +363,7 @@ nsDOMFileReader::DoReadData(nsIAsyncInputStream* aStream, uint64_t aCount)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
if (mDataFormat != FILE_AS_ARRAYBUFFER) {
|
||||
mFileData = (char *) moz_realloc(mFileData, mDataLen + aCount);
|
||||
mFileData = (char *) realloc(mFileData, mDataLen + aCount);
|
||||
NS_ENSURE_TRUE(mFileData, NS_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ protected:
|
||||
nsresult GetAsDataURL(nsIDOMBlob *aFile, const char *aFileData, uint32_t aDataLen, nsAString &aResult);
|
||||
|
||||
void FreeFileData() {
|
||||
moz_free(mFileData);
|
||||
free(mFileData);
|
||||
mFileData = nullptr;
|
||||
mDataLen = 0;
|
||||
}
|
||||
|
@ -884,7 +884,8 @@ nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
|
||||
|
||||
// Don't show remote iframe if we are waiting for the completion of reflow.
|
||||
if (!aFrame || !(aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
nsIntPoint chromeDisp = aFrame->GetChromeDisplacement();
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size, chromeDisp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1382,12 +1383,6 @@ nsFrameLoader::StartDestroy()
|
||||
}
|
||||
}
|
||||
|
||||
// If the TabParent has installed any event listeners on the window, this is
|
||||
// its last chance to remove them while we're still in the document.
|
||||
if (mRemoteBrowser) {
|
||||
mRemoteBrowser->RemoveWindowListeners();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
bool dynamicSubframeRemoval = false;
|
||||
if (mOwnerContent) {
|
||||
@ -2063,7 +2058,8 @@ nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame *aIFrame)
|
||||
ScreenIntSize size = aIFrame->GetSubdocumentSize();
|
||||
nsIntRect dimensions;
|
||||
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE);
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
nsIntPoint chromeDisp = aIFrame->GetChromeDisplacement();
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size, chromeDisp);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -229,9 +229,6 @@ public:
|
||||
void ActivateUpdateHitRegion();
|
||||
void DeactivateUpdateHitRegion();
|
||||
|
||||
// Properly retrieves documentSize of any subdocument type.
|
||||
nsresult GetWindowDimensions(nsIntRect& aRect);
|
||||
|
||||
private:
|
||||
|
||||
void SetOwnerContent(mozilla::dom::Element* aContent);
|
||||
@ -287,6 +284,9 @@ private:
|
||||
nsresult MaybeCreateDocShell();
|
||||
nsresult EnsureMessageManager();
|
||||
|
||||
// Properly retrieves documentSize of any subdocument type.
|
||||
nsresult GetWindowDimensions(nsIntRect& aRect);
|
||||
|
||||
// Updates the subdocument position and size. This gets called only
|
||||
// when we have our own in-process DocShell.
|
||||
void UpdateBaseWindowPositionAndSize(nsSubDocumentFrame *aIFrame);
|
||||
|
@ -579,16 +579,29 @@ JSONCreator(const char16_t* aBuf, uint32_t aLen, void* aData)
|
||||
|
||||
static bool
|
||||
GetParamsForMessage(JSContext* aCx,
|
||||
const JS::Value& aJSON,
|
||||
const JS::Value& aData,
|
||||
JSAutoStructuredCloneBuffer& aBuffer,
|
||||
StructuredCloneClosure& aClosure)
|
||||
{
|
||||
JS::Rooted<JS::Value> v(aCx, aJSON);
|
||||
// First try to use structured clone on the whole thing.
|
||||
JS::RootedValue v(aCx, aData);
|
||||
if (WriteStructuredClone(aCx, v, aBuffer, aClosure)) {
|
||||
return true;
|
||||
}
|
||||
JS_ClearPendingException(aCx);
|
||||
|
||||
nsCOMPtr<nsIConsoleService> console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
|
||||
if (console) {
|
||||
nsAutoString filename;
|
||||
uint32_t lineno = 0;
|
||||
nsJSUtils::GetCallingLocation(aCx, filename, &lineno);
|
||||
nsCOMPtr<nsIScriptError> error(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
|
||||
error->Init(NS_LITERAL_STRING("Sending message that cannot be cloned. Are you trying to send an XPCOM object?"),
|
||||
filename, EmptyString(),
|
||||
lineno, 0, nsIScriptError::warningFlag, "chrome javascript");
|
||||
console->LogMessage(error);
|
||||
}
|
||||
|
||||
// Not clonable, try JSON
|
||||
//XXX This is ugly but currently structured cloning doesn't handle
|
||||
// properly cases when interface is implemented in JS and used
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIObjectInputStream.h"
|
||||
#include "nsIObjectOutputStream.h"
|
||||
#include "nsIProgrammingLanguage.h"
|
||||
|
||||
#include "mozilla/ipc/BackgroundUtils.h"
|
||||
#include "mozilla/ipc/URIUtils.h"
|
||||
@ -235,13 +234,6 @@ nsHostObjectURI::GetClassID(nsCID * *aClassID)
|
||||
return GetClassIDNoAlloc(*aClassID);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHostObjectURI::GetImplementationLanguage(uint32_t *aImplementationLanguage)
|
||||
{
|
||||
*aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHostObjectURI::GetFlags(uint32_t *aFlags)
|
||||
{
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "nsStringGlue.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIProgrammingLanguage.h"
|
||||
#include "jspubtd.h"
|
||||
#include "js/GCAPI.h"
|
||||
|
||||
|
@ -146,8 +146,6 @@ static const uint32_t kMaxICCDuration = 2000; // ms
|
||||
// Trigger a CC if the purple buffer exceeds this size when we check it.
|
||||
#define NS_CC_PURPLE_LIMIT 200
|
||||
|
||||
#define JAVASCRIPT nsIProgrammingLanguage::JAVASCRIPT
|
||||
|
||||
// Large value used to specify that a script should run essentially forever
|
||||
#define NS_UNLIMITED_SCRIPT_RUNTIME (0x40000000LL << 32)
|
||||
|
||||
|
@ -1461,7 +1461,7 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||
}
|
||||
rv = NS_OK;
|
||||
} else {
|
||||
moz_free(const_cast<uint8_t *>(aString));
|
||||
free(const_cast<uint8_t *>(aString));
|
||||
rv = NS_SUCCESS_ADOPTED_DATA;
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ void
|
||||
nsTextFragment::ReleaseText()
|
||||
{
|
||||
if (mState.mLength && m1b && mState.mInHeap) {
|
||||
moz_free(m2b); // m1b == m2b as far as moz_free is concerned
|
||||
free(m2b); // m1b == m2b as far as free is concerned
|
||||
}
|
||||
|
||||
m1b = nullptr;
|
||||
@ -107,7 +107,7 @@ nsTextFragment::operator=(const nsTextFragment& aOther)
|
||||
size_t m2bSize = aOther.mState.mLength *
|
||||
(aOther.mState.mIs2b ? sizeof(char16_t) : sizeof(char));
|
||||
|
||||
m2b = static_cast<char16_t*>(moz_malloc(m2bSize));
|
||||
m2b = static_cast<char16_t*>(malloc(m2bSize));
|
||||
if (m2b) {
|
||||
memcpy(m2b, aOther.m2b, m2bSize);
|
||||
} else {
|
||||
@ -255,7 +255,7 @@ nsTextFragment::SetTo(const char16_t* aBuffer, int32_t aLength, bool aUpdateBidi
|
||||
if (first16bit != -1) { // aBuffer contains no non-8bit character
|
||||
// Use ucs2 storage because we have to
|
||||
size_t m2bSize = aLength * sizeof(char16_t);
|
||||
m2b = (char16_t *)moz_malloc(m2bSize);
|
||||
m2b = (char16_t *)malloc(m2bSize);
|
||||
if (!m2b) {
|
||||
return false;
|
||||
}
|
||||
@ -268,7 +268,7 @@ nsTextFragment::SetTo(const char16_t* aBuffer, int32_t aLength, bool aUpdateBidi
|
||||
|
||||
} else {
|
||||
// Use 1 byte storage because we can
|
||||
char* buff = (char *)moz_malloc(aLength * sizeof(char));
|
||||
char* buff = (char *)malloc(aLength * sizeof(char));
|
||||
if (!buff) {
|
||||
return false;
|
||||
}
|
||||
@ -326,7 +326,7 @@ nsTextFragment::Append(const char16_t* aBuffer, uint32_t aLength, bool aUpdateBi
|
||||
|
||||
if (mState.mIs2b) {
|
||||
// Already a 2-byte string so the result will be too
|
||||
char16_t* buff = (char16_t*)moz_realloc(m2b, (mState.mLength + aLength) * sizeof(char16_t));
|
||||
char16_t* buff = (char16_t*)realloc(m2b, (mState.mLength + aLength) * sizeof(char16_t));
|
||||
if (!buff) {
|
||||
return false;
|
||||
}
|
||||
@ -348,8 +348,8 @@ nsTextFragment::Append(const char16_t* aBuffer, uint32_t aLength, bool aUpdateBi
|
||||
if (first16bit != -1) { // aBuffer contains no non-8bit character
|
||||
// The old data was 1-byte, but the new is not so we have to expand it
|
||||
// all to 2-byte
|
||||
char16_t* buff = (char16_t*)moz_malloc((mState.mLength + aLength) *
|
||||
sizeof(char16_t));
|
||||
char16_t* buff =
|
||||
(char16_t*)malloc((mState.mLength + aLength) * sizeof(char16_t));
|
||||
if (!buff) {
|
||||
return false;
|
||||
}
|
||||
@ -363,7 +363,7 @@ nsTextFragment::Append(const char16_t* aBuffer, uint32_t aLength, bool aUpdateBi
|
||||
mState.mIs2b = true;
|
||||
|
||||
if (mState.mInHeap) {
|
||||
moz_free(m2b);
|
||||
free(m2b);
|
||||
}
|
||||
m2b = buff;
|
||||
|
||||
@ -379,14 +379,14 @@ nsTextFragment::Append(const char16_t* aBuffer, uint32_t aLength, bool aUpdateBi
|
||||
// The new and the old data is all 1-byte
|
||||
char* buff;
|
||||
if (mState.mInHeap) {
|
||||
buff = (char*)moz_realloc(const_cast<char*>(m1b),
|
||||
(mState.mLength + aLength) * sizeof(char));
|
||||
buff = (char*)realloc(const_cast<char*>(m1b),
|
||||
(mState.mLength + aLength) * sizeof(char));
|
||||
if (!buff) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
buff = (char*)moz_malloc((mState.mLength + aLength) * sizeof(char));
|
||||
buff = (char*)malloc((mState.mLength + aLength) * sizeof(char));
|
||||
if (!buff) {
|
||||
return false;
|
||||
}
|
||||
|
@ -473,6 +473,10 @@ DOMInterfaces = {
|
||||
'wrapperCache': False,
|
||||
},
|
||||
|
||||
'FontFaceSetIterator': {
|
||||
'wrapperCache': False,
|
||||
},
|
||||
|
||||
'FormData': {
|
||||
'nativeType': 'nsFormData'
|
||||
},
|
||||
@ -1525,7 +1529,7 @@ DOMInterfaces = {
|
||||
'headerFile': 'mozilla/dom/WorkerScope.h',
|
||||
'nativeType': 'mozilla::dom::workers::WorkerDebuggerGlobalScope',
|
||||
'implicitJSContext': [
|
||||
'dump', 'global', 'reportError',
|
||||
'dump', 'global', 'setImmediate', 'reportError',
|
||||
],
|
||||
},
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/DOMException.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "nsIProgrammingLanguage.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
120
dom/cache/DBSchema.cpp
vendored
120
dom/cache/DBSchema.cpp
vendored
@ -20,13 +20,14 @@
|
||||
#include "mozilla/dom/RequestBinding.h"
|
||||
#include "mozilla/dom/ResponseBinding.h"
|
||||
#include "Types.h"
|
||||
#include "nsIContentPolicy.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
namespace cache {
|
||||
|
||||
const int32_t DBSchema::kMaxWipeSchemaVersion = 4;
|
||||
const int32_t DBSchema::kLatestSchemaVersion = 4;
|
||||
const int32_t DBSchema::kMaxWipeSchemaVersion = 5;
|
||||
const int32_t DBSchema::kLatestSchemaVersion = 5;
|
||||
const int32_t DBSchema::kMaxEntriesPerStatement = 255;
|
||||
|
||||
// If any of the static_asserts below fail, it means that you have changed
|
||||
@ -51,6 +52,40 @@ static_assert(int(RequestCredentials::Omit) == 0 &&
|
||||
int(RequestCredentials::Include) == 2 &&
|
||||
int(RequestCredentials::EndGuard_) == 3,
|
||||
"RequestCredentials values are as expected");
|
||||
static_assert(int(RequestContext::Audio) == 0 &&
|
||||
int(RequestContext::Beacon) == 1 &&
|
||||
int(RequestContext::Cspreport) == 2 &&
|
||||
int(RequestContext::Download) == 3 &&
|
||||
int(RequestContext::Embed) == 4 &&
|
||||
int(RequestContext::Eventsource) == 5 &&
|
||||
int(RequestContext::Favicon) == 6 &&
|
||||
int(RequestContext::Fetch) == 7 &&
|
||||
int(RequestContext::Font) == 8 &&
|
||||
int(RequestContext::Form) == 9 &&
|
||||
int(RequestContext::Frame) == 10 &&
|
||||
int(RequestContext::Hyperlink) == 11 &&
|
||||
int(RequestContext::Iframe) == 12 &&
|
||||
int(RequestContext::Image) == 13 &&
|
||||
int(RequestContext::Imageset) == 14 &&
|
||||
int(RequestContext::Import) == 15 &&
|
||||
int(RequestContext::Internal) == 16 &&
|
||||
int(RequestContext::Location) == 17 &&
|
||||
int(RequestContext::Manifest) == 18 &&
|
||||
int(RequestContext::Object) == 19 &&
|
||||
int(RequestContext::Ping) == 20 &&
|
||||
int(RequestContext::Plugin) == 21 &&
|
||||
int(RequestContext::Prefetch) == 22 &&
|
||||
int(RequestContext::Script) == 23 &&
|
||||
int(RequestContext::Serviceworker) == 24 &&
|
||||
int(RequestContext::Sharedworker) == 25 &&
|
||||
int(RequestContext::Subresource) == 26 &&
|
||||
int(RequestContext::Style) == 27 &&
|
||||
int(RequestContext::Track) == 28 &&
|
||||
int(RequestContext::Video) == 29 &&
|
||||
int(RequestContext::Worker) == 30 &&
|
||||
int(RequestContext::Xmlhttprequest) == 31 &&
|
||||
int(RequestContext::Xslt) == 32,
|
||||
"RequestContext values are as expected");
|
||||
static_assert(int(RequestCache::Default) == 0 &&
|
||||
int(RequestCache::No_store) == 1 &&
|
||||
int(RequestCache::Reload) == 2 &&
|
||||
@ -76,6 +111,35 @@ static_assert(DEFAULT_NAMESPACE == 0 &&
|
||||
NUMBER_OF_NAMESPACES == 2,
|
||||
"Namespace values are as expected");
|
||||
|
||||
// If the static_asserts below fails, it means that you have changed the
|
||||
// nsContentPolicy enum in a way that may be incompatible with the existing data
|
||||
// stored in the DOM Cache. You would need to update the Cache database schema
|
||||
// accordingly and adjust the failing static_assert.
|
||||
static_assert(nsIContentPolicy::TYPE_INVALID == 0 &&
|
||||
nsIContentPolicy::TYPE_OTHER == 1 &&
|
||||
nsIContentPolicy::TYPE_SCRIPT == 2 &&
|
||||
nsIContentPolicy::TYPE_IMAGE == 3 &&
|
||||
nsIContentPolicy::TYPE_STYLESHEET == 4 &&
|
||||
nsIContentPolicy::TYPE_OBJECT == 5 &&
|
||||
nsIContentPolicy::TYPE_DOCUMENT == 6 &&
|
||||
nsIContentPolicy::TYPE_SUBDOCUMENT == 7 &&
|
||||
nsIContentPolicy::TYPE_REFRESH == 8 &&
|
||||
nsIContentPolicy::TYPE_XBL == 9 &&
|
||||
nsIContentPolicy::TYPE_PING == 10 &&
|
||||
nsIContentPolicy::TYPE_XMLHTTPREQUEST == 11 &&
|
||||
nsIContentPolicy::TYPE_DATAREQUEST == 11 &&
|
||||
nsIContentPolicy::TYPE_OBJECT_SUBREQUEST == 12 &&
|
||||
nsIContentPolicy::TYPE_DTD == 13 &&
|
||||
nsIContentPolicy::TYPE_FONT == 14 &&
|
||||
nsIContentPolicy::TYPE_MEDIA == 15 &&
|
||||
nsIContentPolicy::TYPE_WEBSOCKET == 16 &&
|
||||
nsIContentPolicy::TYPE_CSP_REPORT == 17 &&
|
||||
nsIContentPolicy::TYPE_XSLT == 18 &&
|
||||
nsIContentPolicy::TYPE_BEACON == 19 &&
|
||||
nsIContentPolicy::TYPE_FETCH == 20 &&
|
||||
nsIContentPolicy::TYPE_IMAGESET == 21,
|
||||
"nsContentPolicytType values are as expected");
|
||||
|
||||
using mozilla::void_t;
|
||||
|
||||
// static
|
||||
@ -139,6 +203,8 @@ DBSchema::CreateSchema(mozIStorageConnection* aConn)
|
||||
"request_headers_guard INTEGER NOT NULL, "
|
||||
"request_mode INTEGER NOT NULL, "
|
||||
"request_credentials INTEGER NOT NULL, "
|
||||
"request_contentpolicytype INTEGER NOT NULL, "
|
||||
"request_context INTEGER NOT NULL, "
|
||||
"request_cache INTEGER NOT NULL, "
|
||||
"request_body_id TEXT NULL, "
|
||||
"response_type INTEGER NOT NULL, "
|
||||
@ -1021,6 +1087,8 @@ DBSchema::InsertEntry(mozIStorageConnection* aConn, CacheId aCacheId,
|
||||
"request_headers_guard, "
|
||||
"request_mode, "
|
||||
"request_credentials, "
|
||||
"request_contentpolicytype, "
|
||||
"request_context, "
|
||||
"request_cache, "
|
||||
"request_body_id, "
|
||||
"response_type, "
|
||||
@ -1031,7 +1099,7 @@ DBSchema::InsertEntry(mozIStorageConnection* aConn, CacheId aCacheId,
|
||||
"response_body_id, "
|
||||
"response_security_info, "
|
||||
"cache_id "
|
||||
") VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17)"
|
||||
") VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18, ?19)"
|
||||
), getter_AddRefs(state));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
@ -1059,37 +1127,45 @@ DBSchema::InsertEntry(mozIStorageConnection* aConn, CacheId aCacheId,
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindInt32Parameter(7,
|
||||
static_cast<int32_t>(aRequest.contentPolicyType()));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindInt32Parameter(8,
|
||||
static_cast<int32_t>(aRequest.context()));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindInt32Parameter(9,
|
||||
static_cast<int32_t>(aRequest.requestCache()));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = BindId(state, 8, aRequestBodyId);
|
||||
rv = BindId(state, 10, aRequestBodyId);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindInt32Parameter(9, static_cast<int32_t>(aResponse.type()));
|
||||
rv = state->BindInt32Parameter(11, static_cast<int32_t>(aResponse.type()));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindStringParameter(10, aResponse.url());
|
||||
rv = state->BindStringParameter(12, aResponse.url());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindInt32Parameter(11, aResponse.status());
|
||||
rv = state->BindInt32Parameter(13, aResponse.status());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindUTF8StringParameter(12, aResponse.statusText());
|
||||
rv = state->BindUTF8StringParameter(14, aResponse.statusText());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindInt32Parameter(13,
|
||||
rv = state->BindInt32Parameter(15,
|
||||
static_cast<int32_t>(aResponse.headersGuard()));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = BindId(state, 14, aResponseBodyId);
|
||||
rv = BindId(state, 16, aResponseBodyId);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindBlobParameter(15, reinterpret_cast<const uint8_t*>
|
||||
rv = state->BindBlobParameter(17, reinterpret_cast<const uint8_t*>
|
||||
(aResponse.securityInfo().get()),
|
||||
aResponse.securityInfo().Length());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->BindInt32Parameter(16, aCacheId);
|
||||
rv = state->BindInt32Parameter(18, aCacheId);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
|
||||
rv = state->Execute();
|
||||
@ -1275,6 +1351,8 @@ DBSchema::ReadRequest(mozIStorageConnection* aConn, EntryId aEntryId,
|
||||
"request_headers_guard, "
|
||||
"request_mode, "
|
||||
"request_credentials, "
|
||||
"request_contentpolicytype, "
|
||||
"request_context, "
|
||||
"request_cache, "
|
||||
"request_body_id "
|
||||
"FROM entries "
|
||||
@ -1318,19 +1396,31 @@ DBSchema::ReadRequest(mozIStorageConnection* aConn, EntryId aEntryId,
|
||||
aSavedRequestOut->mValue.credentials() =
|
||||
static_cast<RequestCredentials>(credentials);
|
||||
|
||||
int32_t requestContentPolicyType;
|
||||
rv = state->GetInt32(7, &requestContentPolicyType);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
aSavedRequestOut->mValue.contentPolicyType() =
|
||||
static_cast<nsContentPolicyType>(requestContentPolicyType);
|
||||
|
||||
int32_t requestContext;
|
||||
rv = state->GetInt32(8, &requestContext);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
aSavedRequestOut->mValue.context() =
|
||||
static_cast<RequestContext>(requestContext);
|
||||
|
||||
int32_t requestCache;
|
||||
rv = state->GetInt32(7, &requestCache);
|
||||
rv = state->GetInt32(9, &requestCache);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
aSavedRequestOut->mValue.requestCache() =
|
||||
static_cast<RequestCache>(requestCache);
|
||||
|
||||
bool nullBody = false;
|
||||
rv = state->GetIsNull(8, &nullBody);
|
||||
rv = state->GetIsNull(10, &nullBody);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
aSavedRequestOut->mHasBodyId = !nullBody;
|
||||
|
||||
if (aSavedRequestOut->mHasBodyId) {
|
||||
rv = ExtractId(state, 8, &aSavedRequestOut->mBodyId);
|
||||
rv = ExtractId(state, 10, &aSavedRequestOut->mBodyId);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
|
||||
}
|
||||
|
||||
|
4
dom/cache/PCacheTypes.ipdlh
vendored
4
dom/cache/PCacheTypes.ipdlh
vendored
@ -11,6 +11,7 @@ using HeadersGuardEnum from "mozilla/dom/FetchIPCUtils.h";
|
||||
using RequestCredentials from "mozilla/dom/FetchIPCUtils.h";
|
||||
using RequestMode from "mozilla/dom/FetchIPCUtils.h";
|
||||
using RequestCache from "mozilla/dom/FetchIPCUtils.h";
|
||||
using RequestContext from "mozilla/dom/FetchIPCUtils.h";
|
||||
using mozilla::dom::ResponseType from "mozilla/dom/FetchIPCUtils.h";
|
||||
using mozilla::void_t from "ipc/IPCMessageUtils.h";
|
||||
using struct nsID from "nsID.h";
|
||||
@ -54,7 +55,8 @@ struct PCacheRequest
|
||||
RequestMode mode;
|
||||
RequestCredentials credentials;
|
||||
PCacheReadStreamOrVoid body;
|
||||
uint32_t context;
|
||||
uint32_t contentPolicyType;
|
||||
RequestContext context;
|
||||
RequestCache requestCache;
|
||||
};
|
||||
|
||||
|
9
dom/cache/TypeUtils.cpp
vendored
9
dom/cache/TypeUtils.cpp
vendored
@ -224,7 +224,8 @@ TypeUtils::ToPCacheRequest(PCacheRequest& aOut, InternalRequest* aIn,
|
||||
aOut.headersGuard() = headers->Guard();
|
||||
aOut.mode() = aIn->Mode();
|
||||
aOut.credentials() = aIn->GetCredentialsMode();
|
||||
aOut.context() = aIn->ContentPolicyType();
|
||||
aOut.contentPolicyType() = aIn->ContentPolicyType();
|
||||
aOut.context() = aIn->Context();
|
||||
aOut.requestCache() = aIn->GetCacheMode();
|
||||
|
||||
if (aBodyAction == IgnoreBody) {
|
||||
@ -367,7 +368,11 @@ TypeUtils::ToInternalRequest(const PCacheRequest& aIn)
|
||||
internalRequest->SetReferrer(aIn.referrer());
|
||||
internalRequest->SetMode(aIn.mode());
|
||||
internalRequest->SetCredentialsMode(aIn.credentials());
|
||||
internalRequest->SetContentPolicyType(aIn.context());
|
||||
internalRequest->SetContentPolicyType(aIn.contentPolicyType());
|
||||
DebugOnly<RequestContext> contextAfterSetContentPolicyType = internalRequest->Context();
|
||||
internalRequest->SetContext(aIn.context());
|
||||
MOZ_ASSERT(contextAfterSetContentPolicyType.value == internalRequest->Context(),
|
||||
"The RequestContext and nsContentPolicyType values should not get out of sync");
|
||||
internalRequest->SetCacheMode(aIn.requestCache());
|
||||
|
||||
nsRefPtr<InternalHeaders> internalHeaders =
|
||||
|
@ -174,7 +174,7 @@ WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage)
|
||||
if (!boundBuffer)
|
||||
return ErrorInvalidOperation("bufferData: no buffer bound!");
|
||||
|
||||
UniquePtr<uint8_t> zeroBuffer((uint8_t*)moz_calloc(size, 1));
|
||||
UniquePtr<uint8_t> zeroBuffer((uint8_t*)calloc(size, 1));
|
||||
if (!zeroBuffer)
|
||||
return ErrorOutOfMemory("bufferData: out of memory");
|
||||
|
||||
|
@ -674,7 +674,7 @@ public:
|
||||
|
||||
~AutoFreeBuffer()
|
||||
{
|
||||
moz_free(mBuffer);
|
||||
free(mBuffer);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -37,6 +37,11 @@ namespace IPC {
|
||||
mozilla::dom::RequestCache::Default,
|
||||
mozilla::dom::RequestCache::EndGuard_> {};
|
||||
template<>
|
||||
struct ParamTraits<mozilla::dom::RequestContext> :
|
||||
public ContiguousEnumSerializer<mozilla::dom::RequestContext,
|
||||
mozilla::dom::RequestContext::Audio,
|
||||
mozilla::dom::RequestContext::EndGuard_> {};
|
||||
template<>
|
||||
struct ParamTraits<mozilla::dom::ResponseType> :
|
||||
public ContiguousEnumSerializer<mozilla::dom::ResponseType,
|
||||
mozilla::dom::ResponseType::Basic,
|
||||
|
@ -38,6 +38,7 @@ InternalRequest::GetRequestConstructorCopy(nsIGlobalObject* aGlobal, ErrorResult
|
||||
// The default referrer is already about:client.
|
||||
|
||||
copy->mContentPolicyType = nsIContentPolicy::TYPE_FETCH;
|
||||
copy->mContext = RequestContext::Fetch;
|
||||
copy->mMode = mMode;
|
||||
copy->mCredentialsMode = mCredentialsMode;
|
||||
copy->mCacheMode = mCacheMode;
|
||||
@ -74,6 +75,7 @@ InternalRequest::InternalRequest(const InternalRequest& aOther)
|
||||
, mURL(aOther.mURL)
|
||||
, mHeaders(new InternalHeaders(*aOther.mHeaders))
|
||||
, mContentPolicyType(aOther.mContentPolicyType)
|
||||
, mContext(aOther.mContext)
|
||||
, mReferrer(aOther.mReferrer)
|
||||
, mMode(aOther.mMode)
|
||||
, mCredentialsMode(aOther.mCredentialsMode)
|
||||
@ -97,5 +99,80 @@ InternalRequest::~InternalRequest()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
InternalRequest::SetContentPolicyType(nsContentPolicyType aContentPolicyType)
|
||||
{
|
||||
mContentPolicyType = aContentPolicyType;
|
||||
switch (aContentPolicyType) {
|
||||
case nsIContentPolicy::TYPE_OTHER:
|
||||
mContext = RequestContext::Internal;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_SCRIPT:
|
||||
mContext = RequestContext::Script;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_IMAGE:
|
||||
mContext = RequestContext::Image;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_STYLESHEET:
|
||||
mContext = RequestContext::Style;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_OBJECT:
|
||||
mContext = RequestContext::Object;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_DOCUMENT:
|
||||
mContext = RequestContext::Internal;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_SUBDOCUMENT:
|
||||
mContext = RequestContext::Iframe;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_REFRESH:
|
||||
mContext = RequestContext::Internal;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_XBL:
|
||||
mContext = RequestContext::Internal;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_PING:
|
||||
mContext = RequestContext::Ping;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_XMLHTTPREQUEST:
|
||||
mContext = RequestContext::Xmlhttprequest;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_OBJECT_SUBREQUEST:
|
||||
mContext = RequestContext::Plugin;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_DTD:
|
||||
mContext = RequestContext::Internal;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_FONT:
|
||||
mContext = RequestContext::Font;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_MEDIA:
|
||||
mContext = RequestContext::Audio;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_WEBSOCKET:
|
||||
mContext = RequestContext::Internal;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_CSP_REPORT:
|
||||
mContext = RequestContext::Cspreport;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_XSLT:
|
||||
mContext = RequestContext::Xslt;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_BEACON:
|
||||
mContext = RequestContext::Beacon;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_FETCH:
|
||||
mContext = RequestContext::Fetch;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_IMAGESET:
|
||||
mContext = RequestContext::Imageset;
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT(false, "Unhandled nsContentPolicyType value");
|
||||
mContext = RequestContext::Internal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -25,6 +25,65 @@ class nsPIDOMWindow;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
/*
|
||||
* The mapping of RequestContext and nsContentPolicyType is currently as the
|
||||
* following. Note that this mapping is not perfect yet (see the TODO comments
|
||||
* below for examples), so for now we'll have to keep both an mContext and an
|
||||
* mContentPolicyType, because we cannot have a two way conversion.
|
||||
*
|
||||
* RequestContext | nsContentPolicyType
|
||||
* ------------------+--------------------
|
||||
* audio | TYPE_MEDIA
|
||||
* beacon | TYPE_BEACON
|
||||
* cspreport | TYPE_CSP_REPORT
|
||||
* download |
|
||||
* embed | TYPE_OBJECT
|
||||
* eventsource |
|
||||
* favicon |
|
||||
* fetch | TYPE_FETCH
|
||||
* font | TYPE_FONT
|
||||
* form |
|
||||
* frame | TYPE_SUBDOCUMENT
|
||||
* hyperlink |
|
||||
* iframe | TYPE_SUBDOCUMENT
|
||||
* image | TYPE_IMAGE
|
||||
* imageset | TYPE_IMAGESET
|
||||
* import | Not supported by Gecko
|
||||
* internal | TYPE_DOCUMENT, TYPE_XBL, TYPE_OTHER
|
||||
* location |
|
||||
* manifest |
|
||||
* object | TYPE_OBJECT
|
||||
* ping | TYPE_PING
|
||||
* plugin | TYPE_OBJECT_SUBREQUEST
|
||||
* prefetch |
|
||||
* script | TYPE_SCRIPT
|
||||
* serviceworker |
|
||||
* sharedworker |
|
||||
* subresource | Not supported by Gecko
|
||||
* style | TYPE_STYLESHEET
|
||||
* track | TYPE_MEDIA
|
||||
* video | TYPE_MEDIA
|
||||
* worker |
|
||||
* xmlhttprequest | TYPE_XMLHTTPREQUEST
|
||||
* xslt | TYPE_XSLT
|
||||
*
|
||||
* TODO: Figure out if TYPE_REFRESH maps to anything useful
|
||||
* TODO: Figure out if TYPE_DTD maps to anything useful
|
||||
* TODO: Split TYPE_MEDIA into TYPE_AUDIO, TYPE_VIDEO and TYPE_TRACK
|
||||
* TODO: Split TYPE_XMLHTTPREQUEST and TYPE_DATAREQUEST for EventSource
|
||||
* TODO: Figure out if TYPE_WEBSOCKET maps to anything useful
|
||||
* TODO: Differentiate between frame and iframe
|
||||
* TODO: Add content types for different kinds of workers
|
||||
* TODO: Add a content type for prefetch
|
||||
* TODO: Use the content type for manifest when it becomes available
|
||||
* TODO: Add a content type for location
|
||||
* TODO: Add a content type for hyperlink
|
||||
* TODO: Add a content type for form
|
||||
* TODO: Add a content type for favicon
|
||||
* TODO: Add a content type for download
|
||||
* TODO: Split TYPE_OBJECT into TYPE_EMBED and TYPE_OBJECT
|
||||
*/
|
||||
|
||||
class FetchBodyStream;
|
||||
class Request;
|
||||
|
||||
@ -221,9 +280,18 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
SetContentPolicyType(nsContentPolicyType aContentPolicyType)
|
||||
SetContentPolicyType(nsContentPolicyType aContentPolicyType);
|
||||
|
||||
RequestContext
|
||||
Context() const
|
||||
{
|
||||
mContentPolicyType = aContentPolicyType;
|
||||
return mContext;
|
||||
}
|
||||
|
||||
void
|
||||
SetContext(RequestContext aContext)
|
||||
{
|
||||
mContext = aContext;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -312,9 +380,8 @@ private:
|
||||
nsRefPtr<InternalHeaders> mHeaders;
|
||||
nsCOMPtr<nsIInputStream> mBodyStream;
|
||||
|
||||
// nsContentPolicyType does not cover the complete set defined in the spec,
|
||||
// but it is a good start.
|
||||
nsContentPolicyType mContentPolicyType;
|
||||
RequestContext mContext;
|
||||
|
||||
// Empty string: no-referrer
|
||||
// "about:client": client (default)
|
||||
|
@ -33,7 +33,6 @@ Request::Request(nsIGlobalObject* aOwner, InternalRequest* aRequest)
|
||||
: FetchBody<Request>()
|
||||
, mOwner(aOwner)
|
||||
, mRequest(aRequest)
|
||||
, mContext(RequestContext::Fetch)
|
||||
{
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user