This commit is contained in:
Ryan VanderMeulen 2013-06-05 16:29:54 -04:00
Родитель 03a07375c3 a52e529c14
Коммит 01ff5c0dc3
177 изменённых файлов: 2434 добавлений и 1239 удалений

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

@ -17,7 +17,4 @@
#
# Modifying this file will now automatically clobber the buildbot machines \o/
#
Bug 496923 removed a directory which the non-regenerated js/src/tests/Makefile will still request.
Alternative to clobber is to run ./config.status from the objdir and to
touch the CLOBBER file in the objdir.
Bug 875929 removed a file from js/src/moz.build and apparently the build system didn't notice.

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

@ -5,7 +5,7 @@
#include "nsISupports.idl"
[scriptable, uuid(7fe1ee90-edaa-43f1-9f3b-071099b51f08)]
[scriptable, uuid(f1e0fbb7-fde4-4519-9383-2bcbee428513)]
interface nsIAccessibleStates : nsISupports
{
/**
@ -71,5 +71,6 @@ interface nsIAccessibleStates : nsISupports
const unsigned long EXT_STATE_ENABLED = 0x00002000; // A widget that is not unavailable
const unsigned long EXT_STATE_SENSITIVE = 0x00004000; // Same as ENABLED for now
const unsigned long EXT_STATE_EXPANDABLE = 0x00008000; // If COLLAPSED or EXPANDED
const unsigned long EXT_STATE_PINNED = 0x00010000; // Indicates object is pinned.
};

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

@ -25,6 +25,8 @@ The following nsIAccessible states aren't translated, just ignored:
Supported via ATK_ROLE_PASSWORD_TEXT
STATE_HASPOPUP: Object displays a pop-up menu or window when invoked.
No ATK equivalent. The nsIAccessible state is not currently supported.
STATE_PINNED: The object is pinned, usually indicating it is fixed in place and has permanence.
No ATK equivalent. The nsIAccessible state is not currently supported.
The following ATK states are not supported:
ATK_STATE_ARMED: No clear use case, used briefly when button is activated
@ -108,5 +110,6 @@ static const AtkStateMap gAtkStateMap[] = { // Cross Platfor
{ ATK_STATE_ENABLED, kMapDirectly }, // states::ENABLED = 1 << 44
{ ATK_STATE_SENSITIVE, kMapDirectly }, // states::SENSITIVE = 1 << 45
{ ATK_STATE_EXPANDABLE, kMapDirectly }, // states::EXPANDABLE = 1 << 46
{ kNone, kNoSuchState }, // = 1 << 47
{ kNone, kMapDirectly }, // states::PINNED = 1 << 47
{ kNone, kNoSuchState }, // = 1 << 48
};

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

@ -272,6 +272,11 @@ namespace states {
* @see EXPANDED and COLLAPSED states.
*/
const uint64_t EXPANDABLE = ((uint64_t) 0x1) << 46;
/**
* The object is pinned, usually indicating it is fixed in place and has permanence.
*/
const uint64_t PINNED = ((uint64_t) 0x1) << 47;
} // namespace states
} // namespace a11y
} // namespace mozilla

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

@ -1256,6 +1256,8 @@ AccessibleWrap::get_states(AccessibleStates *aStates)
*aStates |= IA2_STATE_VERTICAL;
if (state & states::CHECKED)
*aStates |= IA2_STATE_CHECKABLE;
if (state & states::PINNED)
*aStates |= IA2_STATE_PINNED;
return S_OK;

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

@ -83,13 +83,19 @@ XULTabAccessible::NativeState()
// get focus and disable status from base class
uint64_t state = AccessibleWrap::NativeState();
// Check whether the tab is selected
// Check whether the tab is selected and/or pinned
nsCOMPtr<nsIDOMXULSelectControlItemElement> tab(do_QueryInterface(mContent));
if (tab) {
bool selected = false;
if (NS_SUCCEEDED(tab->GetSelected(&selected)) && selected)
state |= states::SELECTED;
if (mContent && mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::pinned) &&
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::pinned,
nsGkAtoms::_true, eCaseMatters))
state |= states::PINNED;
}
return state;
}

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

@ -43,6 +43,7 @@ const EXT_STATE_ENABLED = nsIAccessibleStates.EXT_STATE_ENABLED;
const EXT_STATE_EXPANDABLE = nsIAccessibleStates.EXT_STATE_EXPANDABLE;
const EXT_STATE_HORIZONTAL = nsIAccessibleStates.EXT_STATE_HORIZONTAL;
const EXT_STATE_MULTI_LINE = nsIAccessibleStates.EXT_STATE_MULTI_LINE;
const EXT_STATE_PINNED = nsIAccessibleStates.EXT_STATE_PINNED;
const EXT_STATE_SENSITIVE = nsIAccessibleStates.EXT_STATE_SENSITIVE;
const EXT_STATE_SINGLE_LINE = nsIAccessibleStates.EXT_STATE_SINGLE_LINE;
const EXT_STATE_STALE = nsIAccessibleStates.EXT_STATE_STALE;

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

@ -30,6 +30,7 @@ MOCHITEST_A11Y_FILES =\
test_selects.html \
test_stale.html \
test_textbox.xul \
test_tabs.xul \
test_tree.xul \
test_visibility.html \
test_visibility.xul \

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

@ -0,0 +1,70 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Accessible XUL tabbox hierarchy tests">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="../common.js" />
<script type="application/javascript"
src="../role.js" />
<script type="application/javascript"
src="../states.js" />
<script type="application/javascript">
<![CDATA[
////////////////////////////////////////////////////////////////////////////
// Test
function doTest()
{
testStates("tab1", 0, EXT_STATE_PINNED);
testStates("tab2", 0, 0, 0, EXT_STATE_PINNED);
testStates("tab3", 0, 0, 0, EXT_STATE_PINNED);
SimpleTest.finish()
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=577727"
title="Make pinned tabs distinguishable from other tabs for accessibility">
Mozilla Bug 577727
</a><br/>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<vbox flex="1">
<tabbox>
<tabs id="tabs">
<tab id="tab1" label="tab1" pinned="true"/>
<tab id="tab2" label="tab2" pinned="false"/>
<tab id="tab3" label="tab3"/>
</tabs>
<tabpanels id="tabpanels">
<tabpanel/>
<tabpanel/>
</tabpanels>
</tabbox>
</vbox>
</hbox>
</window>

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

@ -44,9 +44,12 @@ let WebrtcIndicator = {
if (!streamData)
return;
let tab = streamData.tab;
let browserWindow = tab.ownerDocument.defaultView;
browserWindow.gBrowser.selectedTab = tab;
let browserWindow = streamData.browser.ownerDocument.defaultView;
if (streamData.tab) {
browserWindow.gBrowser.selectedTab = streamData.tab;
} else {
streamData.browser.focus();
}
browserWindow.focus();
}
}

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

@ -24,6 +24,7 @@ INSTALLER_FILES = \
nsis/uninstaller.nsi \
nsis/stub.nsi \
nsis/shared.nsh \
stub.tag \
$(NULL)
ifdef MOZ_MAINTENANCE_SERVICE

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

@ -13,8 +13,7 @@
!verbose 3
SetDatablockOptimize on
SetCompress force
SetCompressor /FINAL /SOLID lzma
SetCompress off
CRCCheck on
RequestExecutionLevel user
@ -239,10 +238,10 @@ Var ControlRightPX
!insertmacro UnloadUAC
VIAddVersionKey "FileDescription" "${BrandShortName} Stub Installer"
VIAddVersionKey "OriginalFilename" "stub.exe"
VIAddVersionKey "OriginalFilename" "setup-stub.exe"
Name "$BrandFullName"
OutFile "stub.exe"
OutFile "setup-stub.exe"
icon "setup.ico"
XPStyle on
BrandingText " "

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

@ -0,0 +1,4 @@
;!@Install@!UTF-8!
Title="Mozilla Firefox"
RunProgram="setup-stub.exe"
;!@InstallEnd@!

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

@ -160,14 +160,7 @@ var ContentAreaObserver = {
this.styles["viewable-width"].width = newWidth + "px";
this.styles["viewable-width"].maxWidth = newWidth + "px";
// Adjust the app and find bar position above the soft keyboard
let navBar = document.getElementById("navbar");
let contextAppBar = document.getElementById("contextappbar");
let findBar = document.getElementById("content-navigator");
let keyboardHeight = MetroUtils.keyboardHeight;
navBar.style.bottom = keyboardHeight + "px";
contextAppBar.style.bottom = keyboardHeight + "px";
findBar.style.bottom = keyboardHeight + "px";
this.updateAppBarPosition();
// Update the back/tab button states. If the keyboard is up
// these are hidden.
@ -176,6 +169,26 @@ var ContentAreaObserver = {
this._disatchBrowserEvent("ViewableSizeChanged");
},
updateAppBarPosition: function updateAppBarPosition(aForceDown) {
// Adjust the app and find bar position above the soft keyboard
let navBar = document.getElementById("navbar");
let contextAppBar = document.getElementById("contextappbar");
let findBar = document.getElementById("content-navigator");
let keyboardHeight = aForceDown ? 0 : MetroUtils.keyboardHeight;
navBar.style.bottom = keyboardHeight + "px";
contextAppBar.style.bottom = keyboardHeight + "px";
findBar.style.bottom = keyboardHeight + "px";
},
/*
* Called by BrowserUI right before we blur the nav bar edit. We use
* this to get a head start on shuffling app bars around before the
* soft keyboard transitions down.
*/
navBarWillBlur: function navBarWillBlur() {
this.updateAppBarPosition(true);
},
onBrowserCreated: function onBrowserCreated(aBrowser) {
aBrowser.classList.add("content-width");
aBrowser.classList.add("content-height");

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

@ -540,7 +540,11 @@ var BrowserUI = {
},
blurNavBar: function blurNavBar() {
this._edit.blur();
if (this._edit.focused) {
this._edit.blur();
return true;
}
return false;
},
// If the user types in the address bar, cancel pending
@ -1494,7 +1498,11 @@ var StartUI = {
onClick: function onClick(aEvent) {
// If someone clicks / taps in empty grid space, take away
// focus from the nav bar edit so the soft keyboard will hide.
BrowserUI.blurNavBar();
if (BrowserUI.blurNavBar()) {
// Advanced notice to CAO, so we can shuffle the nav bar in advance
// of the keyboard transition.
ContentAreaObserver.navBarWillBlur();
}
},
handleEvent: function handleEvent(aEvent) {

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

@ -331,8 +331,7 @@ appbar {
bottom: 0;
width: 100%;
transform: translateY(100%);
transition: transform @metro_animation_duration@ @metro_animation_easing@,
bottom @metro_animation_duration@ @metro_animation_easing@;
transition: transform @metro_animation_duration@ @metro_animation_easing@;
font-size: 0;
}
@ -362,6 +361,13 @@ appbar[visible] {
transform: none;
}
#stack[keyboardVisible] > appbar {
/* Slow the bottom up transition since it's impossible to match the system's
soft keyboard movement. */
transition: transform @metro_animation_duration@ @metro_animation_easing@,
bottom @appbar_keyboard_slideup_duration@ @metro_animation_easing@;
}
appbar > toolbar > toolbarbutton {
list-style-image: url(chrome://browser/skin/images/appbar-icons.png);
-moz-image-region: rect(0px, 200px, 40px, 160px); /* Gear icon is default. */

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

@ -83,3 +83,8 @@
% easing function and duration for animations match winJS showPanel method
%define metro_animation_duration 550ms
%define metro_animation_easing cubic-bezier(0.1, 0.9, 0.2, 1)
% this is meant to be slower than the system keyboard such
% that the bars slide up after the keyboard is in place.
%define appbar_keyboard_slideup_duration 750ms

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

@ -14,8 +14,7 @@
padding: 0;
bottom: 0;
transform: translateY(100%);
transition: transform @metro_animation_duration@ @metro_animation_easing@,
bottom @metro_animation_duration@ @metro_animation_easing@;
transition: transform @metro_animation_duration@ @metro_animation_easing@;
background-color: @metro_orange@;
}
@ -23,6 +22,13 @@
transform: none;
}
#stack[keyboardVisible] > #content-navigator {
/* Slow the bottom up transition since it's impossible to match the system's
soft keyboard movement. */
transition: transform @metro_animation_duration@ @metro_animation_easing@,
bottom @appbar_keyboard_slideup_duration@ @metro_animation_easing@;
}
#content-navigator > .previous-button,
#content-navigator > .next-button,
#content-navigator > .close-button {

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

@ -39,18 +39,15 @@ this.webrtcUI = {
let activeStreams = [];
for (let i = 0; i < count; i++) {
let contentWindow = contentWindowSupportsArray.GetElementAt(i);
let browserWindow = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler.ownerDocument.defaultView;
let browser = getBrowserForWindow(contentWindow);
let browserWindow = browser.ownerDocument.defaultView;
let tab = browserWindow.gBrowser &&
browserWindow.gBrowser._getTabForContentWindow(contentWindow.top);
if (tab) {
activeStreams.push({
uri: contentWindow.location.href,
tab: tab
});
}
activeStreams.push({
uri: contentWindow.location.href,
tab: tab,
browser: browser
});
}
return activeStreams;
}
@ -212,8 +209,8 @@ function updateIndicators() {
while (e.hasMoreElements())
e.getNext().WebrtcIndicator.updateButton();
for (let {tab: tab} of webrtcUI.activeStreams)
showBrowserSpecificIndicator(tab.linkedBrowser);
for (let {browser: browser} of webrtcUI.activeStreams)
showBrowserSpecificIndicator(browser);
}
function showBrowserSpecificIndicator(aBrowser) {

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

@ -1353,20 +1353,29 @@ private void CancelNotification()
return(sRet);
}
public void FixDataLocalPermissions()
{
String chmodResult;
File localDir = new java.io.File("/data/local");
if (!localDir.canWrite()) {
chmodResult = ChmodDir("/data/local");
Log.i("SUTAgentAndroid", "Changed permissions on /data/local to make it writable: " + chmodResult);
}
File tmpDir = new java.io.File("/data/local/tmp");
if (tmpDir.exists() && !tmpDir.isDirectory()) {
if (!tmpDir.delete()) {
Log.e("SUTAgentAndroid", "Could not delete file /data/local/tmp");
}
}
if (!tmpDir.exists() && !tmpDir.mkdirs()) {
Log.e("SUTAgentAndroid", "Could not create directory /data/local/tmp");
}
chmodResult = ChmodDir("/data/local/tmp");
Log.i("SUTAgentAndroid", "Changed permissions on /data/local/tmp to make it writable: " + chmodResult);
}
public String GetTestRoot()
{
// According to all the docs this should work, but I keep getting an
// exception when I attempt to create the file because I don't have
// permission, although /data/local/tmp is supposed to be world
// writeable/readable
File tmpFile = new java.io.File("/data/local/tmp/tests");
try{
tmpFile.createNewFile();
} catch (IOException e){
Log.i("SUTAgentAndroid", "Caught exception creating file in /data/local/tmp: " + e.getMessage());
}
String state = Environment.getExternalStorageState();
// Ensure sdcard is mounted and NOT read only
if (state.equalsIgnoreCase(Environment.MEDIA_MOUNTED) &&
@ -1374,8 +1383,15 @@ private void CancelNotification()
{
return(Environment.getExternalStorageDirectory().getAbsolutePath());
}
if (tmpFile.exists())
File tmpFile = new java.io.File("/data/local/tmp/tests");
try{
tmpFile.createNewFile();
} catch (IOException e){
Log.i("SUTAgentAndroid", "Caught exception creating file in /data/local/tmp: " + e.getMessage());
}
if (tmpFile.exists())
{
tmpFile.delete();
return("/data/local");
}
Log.e("SUTAgentAndroid", "ERROR: Cannot access world writeable test root");
@ -3828,7 +3844,7 @@ private void CancelNotification()
else {
// set the new file's permissions to rwxrwxrwx, if possible
try {
Process pProc = Runtime.getRuntime().exec("chmod 777 "+files[lcv]);
Process pProc = Runtime.getRuntime().exec(this.getSuArgs("chmod 777 "+files[lcv]));
RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
outThrd.start();
outThrd.joinAndStopRedirect(5000);
@ -3848,7 +3864,7 @@ private void CancelNotification()
// set the new directory's (or file's) permissions to rwxrwxrwx, if possible
try {
Process pProc = Runtime.getRuntime().exec("chmod 777 "+sTmpDir);
Process pProc = Runtime.getRuntime().exec(this.getSuArgs("chmod 777 "+sTmpDir));
RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
outThrd.start();
outThrd.joinAndStopRedirect(5000);

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

@ -162,6 +162,8 @@ public class SUTAgentAndroid extends Activity
DoCommand dc = new DoCommand(getApplication());
dc.FixDataLocalPermissions();
// Get configuration settings from "ini" file
File dir = getFilesDir();
File iniFile = new File(dir, "SUTAgent.ini");

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

@ -12,8 +12,6 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
if CONFIG['STLPORT_SOURCES']:
DIRS += ['stlport']
DIRS += ['pgo']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
TEST_DIRS += [
'mobile/sutagent/android',

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

@ -1,51 +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/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
# We install to _profile/pgo
TARGET_DEPTH = ../..
include $(topsrcdir)/build/automation-build.mk
# Need to override the browser_path from binary-location.mk (included via automation-build.mk)
# since we want to run from e.g. dist/firefox rather than dist/bin
ifeq ($(OS_ARCH),Darwin)
browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)\"
else
browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME)/$(PROGRAM)\"
endif
# Stuff to make a build with a profile
_PGO_FILES = \
automation.py \
$(topsrcdir)/build/automationutils.py \
$(topsrcdir)/testing/profiles/prefs_general.js \
profileserver.py \
genpgocert.py \
index.html \
server-locations.txt \
favicon.ico \
$(NULL)
genpgocert.py: genpgocert.py.in
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ > $@
GARBAGE += genpgocert.py
libs:: $(_PGO_FILES)
$(INSTALL) $^ $(_PROFILE_DIR)
genservercert::
$(PYTHON) $(DEPTH)/_profile/pgo/genpgocert.py --gen-server

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

@ -1,31 +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/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_PROFILE_DIR = $(DEPTH)/_profile/pgo/blueprint
_PGO_FILES = \
sample.html \
elements.html \
forms.html \
grid.html \
test.jpg \
test-small.jpg \
valid.png \
screen.css \
print.css \
grid.png \
fancytype-screen.css \
$(NULL)
libs:: $(_PGO_FILES)
$(INSTALL) $^ $(_PROFILE_DIR)

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

@ -1,6 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

9
build/pgo/certs/README Normal file
Просмотреть файл

@ -0,0 +1,9 @@
The certificate authority and server certificates here are generated by $topsrcdir/build/pgo/genpgocert.py.
You can generate a new CA cert by running:
$objdir/_virtualenv/bin/python $topsrcdir/build/pgo/genpgocert.py --gen-ca
You can generate new server certificates by running:
$objdir/_virtualenv/bin/python $topsrcdir/build/pgo/genpgocert.py --gen-server
These will place the new files in this directory where you can commit them.

192
build/pgo/genpgocert.py Normal file
Просмотреть файл

@ -0,0 +1,192 @@
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This script exists to generate the Certificate Authority and server
# certificates used for SSL testing in Mochitest. The already generated
# certs are located at $topsrcdir/build/pgo/certs/ .
import mozinfo
import os
import random
import re
import shutil
import subprocess
import sys
import tempfile
from mozbuild.base import MozbuildObject
from mozfile import NamedTemporaryFile
from mozprofile.permissions import ServerLocations
dbFiles = [
re.compile("^cert[0-9]+\.db$"),
re.compile("^key[0-9]+\.db$"),
re.compile("^secmod\.db$")
]
def unlinkDbFiles(path):
for root, dirs, files in os.walk(path):
for name in files:
for dbFile in dbFiles:
if dbFile.match(name) and os.path.exists(os.path.join(root, name)):
os.unlink(os.path.join(root, name))
def dbFilesExist(path):
for root, dirs, files in os.walk(path):
for name in files:
for dbFile in dbFiles:
if dbFile.match(name) and os.path.exists(os.path.join(root, name)):
return True
return False
def runUtil(util, args, inputdata = None):
env = os.environ.copy()
if mozinfo.os == "linux":
pathvar = "LD_LIBRARY_PATH"
app_path = os.path.dirname(util)
if pathvar in env:
env[pathvar] = "%s%s%s" % (app_path, os.pathsep, env[pathvar])
else:
env[pathvar] = app_path
proc = subprocess.Popen([util] + args, env=env,
stdin=subprocess.PIPE if inputdata else None)
proc.communicate(inputdata)
return proc.returncode
def createRandomFile(randomFile):
for count in xrange(0, 2048):
randomFile.write(chr(random.randint(0, 255)))
def createCertificateAuthority(build, srcDir):
certutil = build.get_binary_path(what="certutil")
pk12util = build.get_binary_path(what="pk12util")
#TODO: mozfile.TemporaryDirectory
tempDbDir = tempfile.mkdtemp()
with NamedTemporaryFile() as pwfile, NamedTemporaryFile() as rndfile:
pgoCAModulePathSrc = os.path.join(srcDir, "pgoca.p12")
pgoCAPathSrc = os.path.join(srcDir, "pgoca.ca")
pwfile.write("\n")
# Create temporary certification database for CA generation
status = runUtil(certutil, ["-N", "-d", tempDbDir, "-f", pwfile.name])
if status:
return status
createRandomFile(rndfile)
status = runUtil(certutil, ["-S", "-d", tempDbDir, "-s", "CN=Temporary Certificate Authority, O=Mozilla Testing, OU=Profile Guided Optimization", "-t", "C,,", "-x", "-m", "1", "-v", "120", "-n", "pgo temporary ca", "-2", "-f", pwfile.name, "-z", rndfile.name], "Y\n0\nN\n")
if status:
return status
status = runUtil(certutil, ["-L", "-d", tempDbDir, "-n", "pgo temporary ca", "-a", "-o", pgoCAPathSrc, "-f", pwfile.name])
if status:
return status
status = runUtil(pk12util, ["-o", pgoCAModulePathSrc, "-n", "pgo temporary ca", "-d", tempDbDir, "-w", pwfile.name, "-k", pwfile.name])
if status:
return status
shutil.rmtree(tempDbDir)
return 0
def createSSLServerCertificate(build, srcDir):
certutil = build.get_binary_path(what="certutil")
pk12util = build.get_binary_path(what="pk12util")
with NamedTemporaryFile() as pwfile, NamedTemporaryFile() as rndfile:
pgoCAPath = os.path.join(srcDir, "pgoca.p12")
pwfile.write("\n")
if not dbFilesExist(srcDir):
# Make sure all DB files from src are really deleted
unlinkDbFiles(srcDir)
# Create certification database for ssltunnel
status = runUtil(certutil, ["-N", "-d", srcDir, "-f", pwfile.name])
if status:
return status
status = runUtil(pk12util, ["-i", pgoCAPath, "-w", pwfile.name, "-d", srcDir, "-k", pwfile.name])
if status:
return status
# Generate automatic certificate
locations = ServerLocations(os.path.join(build.topsrcdir,
"build", "pgo",
"server-locations.txt"))
iterator = iter(locations)
# Skips the first entry, I don't know why: bug 879740
iterator.next()
locationsParam = ""
firstLocation = ""
for loc in iterator:
if loc.scheme == "https" and "nocert" not in loc.options:
customCertOption = False
customCertRE = re.compile("^cert=(?:\w+)")
for option in loc.options:
match = customCertRE.match(option)
if match:
customCertOption = True
break
if not customCertOption:
if len(locationsParam) > 0:
locationsParam += ","
locationsParam += loc.host
if firstLocation == "":
firstLocation = loc.host
if not firstLocation:
print "Nothing to generate, no automatic secure hosts specified"
else:
createRandomFile(rndfile)
runUtil(certutil, ["-D", "-n", "pgo server certificate", "-d", srcDir, "-z", rndfile.name, "-f", pwfile.name])
# Ignore the result, the certificate may not be present when new database is being built
status = runUtil(certutil, ["-S", "-s", "CN=%s" % firstLocation, "-t", "Pu,,", "-c", "pgo temporary ca", "-m", "2", "-8", locationsParam, "-v", "120", "-n", "pgo server certificate", "-d", srcDir, "-z", rndfile.name, "-f", pwfile.name])
if status:
return status
return 0
if len(sys.argv) == 1:
print "Specify --gen-server or --gen-ca"
sys.exit(1)
build = MozbuildObject.from_environment()
certdir = os.path.join(build.topsrcdir, "build", "pgo", "certs")
if sys.argv[1] == "--gen-server":
certificateStatus = createSSLServerCertificate(build, certdir)
if certificateStatus:
print "TEST-UNEXPECTED-FAIL | SSL Server Certificate generation"
sys.exit(certificateStatus)
if sys.argv[1] == "--gen-ca":
certificateStatus = createCertificateAuthority(build, certdir)
if certificateStatus:
print "TEST-UNEXPECTED-FAIL | Certificate Authority generation"
else:
print "\n\n"
print "==================================================="
print " IMPORTANT:"
print " To use this new certificate authority in tests"
print " run 'make' at testing/mochitest"
print "==================================================="
sys.exit(certificateStatus)
print "Invalid option specified"
sys.exit(1)

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

@ -1,192 +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/.
from automation import Automation
import os
import re
import shutil
import sys
#expand DIST_BIN = __XPC_BIN_PATH__
#expand BIN_SUFFIX = __BIN_SUFFIX__
#expand PROFILE_DIR = __PROFILE_DIR__
#expand CERTS_SRC_DIR = __CERTS_SRC_DIR__
automation = Automation()
dbFiles = [
re.compile("^cert[0-9]+\.db$"),
re.compile("^key[0-9]+\.db$"),
re.compile("^secmod\.db$")
]
def unlinkDbFiles(path):
for root, dirs, files in os.walk(path):
for name in files:
for dbFile in dbFiles:
if dbFile.match(name) and os.path.exists(os.path.join(root, name)):
os.unlink(os.path.join(root, name))
def dbFilesExist(path):
for root, dirs, files in os.walk(path):
for name in files:
for dbFile in dbFiles:
if dbFile.match(name) and os.path.exists(os.path.join(root, name)):
return True
return False
def runUtil(util, args, inputdata = None):
if inputdata:
proc = automation.Process([util] + args, env = automation.environment(), stdin = automation.PIPE)
proc.communicate(inputdata)
return proc.returncode
return automation.Process([util] + args, env = automation.environment()).wait()
def createRandomFile(randomFile):
import random
file = open(randomFile, "wb");
for count in xrange(0, 2048):
file.write(chr(random.randint(0, 255)))
file.close()
def createCertificateAuthority(profileDir, srcDir):
certutil = DIST_BIN + "/certutil" + BIN_SUFFIX
pk12util = DIST_BIN + "/pk12util" + BIN_SUFFIX
tempDbDir = os.path.join(profileDir, ".temp")
if not os.path.exists(tempDbDir):
os.mkdir(tempDbDir)
pwfilePath = os.path.join(tempDbDir, ".crtdbpw")
rndfilePath = os.path.join(tempDbDir, ".rndfile")
pgoCAModulePathSrc = os.path.join(srcDir, "pgoca.p12")
pgoCAPathSrc = os.path.join(srcDir, "pgoca.ca")
pwfile = open(pwfilePath, "w")
pwfile.write("\n")
pwfile.close()
unlinkDbFiles(tempDbDir)
# Create temporary certification database for CA generation
status = runUtil(certutil, ["-N", "-d", tempDbDir, "-f", pwfilePath])
if status != 0:
return status
createRandomFile(rndfilePath);
status = runUtil(certutil, ["-S", "-d", tempDbDir, "-s", "CN=Temporary Certificate Authority, O=Mozilla Testing, OU=Profile Guided Optimization", "-t", "C,,", "-x", "-m", "1", "-v", "120", "-n", "pgo temporary ca", "-2", "-f", pwfilePath, "-z", rndfilePath], "Y\n0\nN\n")
if status != 0:
return status
status = runUtil(certutil, ["-L", "-d", tempDbDir, "-n", "pgo temporary ca", "-a", "-o", pgoCAPathSrc, "-f", pwfilePath])
if status != 0:
return status
status = runUtil(pk12util, ["-o", pgoCAModulePathSrc, "-n", "pgo temporary ca", "-d", tempDbDir, "-w", pwfilePath, "-k", pwfilePath])
if status != 0:
return status
unlinkDbFiles(tempDbDir)
os.unlink(pwfilePath)
os.unlink(rndfilePath)
os.rmdir(tempDbDir)
return 0
def createSSLServerCertificate(profileDir, srcDir):
certutil = DIST_BIN + "/certutil" + BIN_SUFFIX
pk12util = DIST_BIN + "/pk12util" + BIN_SUFFIX
pwfilePath = os.path.join(profileDir, ".crtdbpw")
rndfilePath = os.path.join(profileDir, ".rndfile")
pgoCAPath = os.path.join(srcDir, "pgoca.p12")
pwfile = open(pwfilePath, "w")
pwfile.write("\n")
pwfile.close()
if not dbFilesExist(srcDir):
# Make sure all DB files from src are really deleted
unlinkDbFiles(srcDir)
# Create certification database for ssltunnel
status = runUtil(certutil, ["-N", "-d", srcDir, "-f", pwfilePath])
if status != 0:
return status
status = runUtil(pk12util, ["-i", pgoCAPath, "-w", pwfilePath, "-d", srcDir, "-k", pwfilePath])
if status != 0:
return status
# Generate automatic certificate
locations = automation.readLocations(os.path.join(profileDir, "server-locations.txt"))
locations.pop(0)
locationsParam = ""
firstLocation = ""
for loc in locations:
if loc.scheme == "https" and "nocert" not in loc.options:
customCertOption = False
customCertRE = re.compile("^cert=(?:\w+)")
for option in loc.options:
match = customCertRE.match(option)
if match:
customCertOption = True
break
if not customCertOption:
if len(locationsParam) > 0:
locationsParam += ","
locationsParam += loc.host
if firstLocation == "":
firstLocation = loc.host
if firstLocation == "":
print "Nothing to generate, no automatic secure hosts specified"
else:
createRandomFile(rndfilePath);
runUtil(certutil, ["-D", "-n", "pgo server certificate", "-d", srcDir, "-z", rndfilePath, "-f", pwfilePath])
# Ignore the result, the certificate may not be present when new database is being built
status = runUtil(certutil, ["-S", "-s", "CN=%s" % firstLocation, "-t", "Pu,,", "-c", "pgo temporary ca", "-m", "2", "-8", locationsParam, "-v", "120", "-n", "pgo server certificate", "-d", srcDir, "-z", rndfilePath, "-f", pwfilePath])
if status != 0:
return status
os.unlink(pwfilePath)
os.unlink(rndfilePath)
return 0
if len(sys.argv) == 1:
print "Specify --gen-server or --gen-ca"
sys.exit(1)
if sys.argv[1] == "--gen-server":
certificateStatus = createSSLServerCertificate(PROFILE_DIR, CERTS_SRC_DIR)
if certificateStatus != 0:
print "TEST-UNEXPECTED-FAIL | SSL Server Certificate generation"
sys.exit(certificateStatus)
if sys.argv[1] == "--gen-ca":
certificateStatus = createCertificateAuthority(PROFILE_DIR, CERTS_SRC_DIR)
if certificateStatus != 0:
print "TEST-UNEXPECTED-FAIL | Certificate Authority generation"
else:
print "\n\n"
print "==================================================="
print " IMPORTANT:"
print " To use this new certificate authority in tests"
print " run 'make' at testing/mochitest"
print "==================================================="
sys.exit(certificateStatus)
print "Invalid option specified"
sys.exit(1)

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

@ -1,50 +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/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_PROFILE_DIR = $(DEPTH)/_profile/pgo/js-input
_PGO_FILES = \
3d-cube.html \
3d-morph.html \
3d-raytrace.html \
3d-thingy.html \
access-binary-trees.html \
access-fannkuch.html \
access-nbody.html \
access-nsieve.html \
bitops-3bit-bits-in-byte.html \
bitops-bits-in-byte.html \
bitops-bitwise-and.html \
bitops-nsieve-bits.html \
controlflow-recursive.html \
crypto-aes.html \
crypto-md5.html \
crypto-sha1.html \
crypto-otp.html \
date-format-tofte.html \
date-format-xparb.html \
math-cordic.html \
math-partial-sums.html \
math-spectral-norm.html \
regexp-dna.html \
string-base64.html \
string-fasta.html \
string-tagcloud.html \
string-unpack-code.html \
string-validate-input.html \
key.gif \
valid-xhtml10.png \
$(NULL)
libs:: $(_PGO_FILES)
$(INSTALL) $^ $(_PROFILE_DIR)

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

@ -1,6 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

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

@ -1,7 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['blueprint', 'js-input']

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

@ -1,59 +1,71 @@
#literal #!/usr/bin/python
#!/usr/bin/python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import SimpleHTTPServer
import SocketServer
from mozprofile import FirefoxProfile, Profile, Preferences
from mozprofile.permissions import ServerLocations
from mozrunner import FirefoxRunner, CLI
from mozhttpd import MozHttpd
import json
import socket
import threading
import os
import sys
import shutil
import tempfile
from datetime import datetime
SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])))
sys.path.insert(0, SCRIPT_DIR)
from automation import Automation
from automationutils import getDebuggerInfo, addCommonOptions
from mozbuild.base import MozbuildObject
PORT = 8888
PROFILE_DIRECTORY = os.path.abspath(os.path.join(SCRIPT_DIR, "./pgoprofile"))
MOZ_JAR_LOG_FILE = os.path.abspath(os.getenv("JARLOG_FILE"))
os.chdir(SCRIPT_DIR)
class EasyServer(SocketServer.TCPServer):
allow_reuse_address = True
if __name__ == '__main__':
from optparse import OptionParser
automation = Automation()
cli = CLI()
debug_args, interactive = cli.debugger_arguments()
parser = OptionParser()
addCommonOptions(parser)
build = MozbuildObject.from_environment()
httpd = MozHttpd(port=PORT,
docroot=os.path.join(build.topsrcdir, "build", "pgo"))
httpd.start(block=False)
options, args = parser.parse_args()
locations = ServerLocations()
locations.add_host(host='127.0.0.1',
port=PORT,
options='primary,privileged')
debuggerInfo = getDebuggerInfo(".", options.debugger, options.debuggerArgs,
options.debuggerInteractive)
#TODO: mozfile.TemporaryDirectory
profilePath = tempfile.mkdtemp()
try:
#TODO: refactor this into mozprofile
prefpath = os.path.join(build.topsrcdir, "testing", "profiles", "prefs_general.js")
prefs = {}
prefs.update(Preferences.read_prefs(prefpath))
interpolation = { "server": "%s:%d" % httpd.httpd.server_address,
"OOP": "false"}
prefs = json.loads(json.dumps(prefs) % interpolation)
for pref in prefs:
prefs[pref] = Preferences.cast(prefs[pref])
profile = FirefoxProfile(profile=profilePath,
preferences=prefs,
#addons=[os.path.join(here, 'extension')],
locations=locations)
httpd = EasyServer(("", PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
t = threading.Thread(target=httpd.serve_forever)
t.setDaemon(True) # don't hang on exit
t.start()
automation.setServerInfo("localhost", PORT)
automation.initializeProfile(PROFILE_DIRECTORY)
browserEnv = automation.environment()
browserEnv["XPCOM_DEBUG_BREAK"] = "warn"
browserEnv["MOZ_JAR_LOG_FILE"] = MOZ_JAR_LOG_FILE
env = os.environ.copy()
env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
env["XPCOM_DEBUG_BREAK"] = "warn"
jarlog = os.getenv("JARLOG_FILE")
if jarlog:
env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"]
url = "http://localhost:%d/index.html" % PORT
appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
debuggerInfo=debuggerInfo,
# the profiling HTML doesn't output anything,
# so let's just run this without a timeout
timeout = None)
sys.exit(status)
cmdargs = ["http://localhost:%d/index.html" % PORT]
runner = FirefoxRunner(profile=profile,
binary=build.get_binary_path(where="staged-package"),
cmdargs=cmdargs,
env=env)
runner.start(debug_args=debug_args, interactive=interactive)
runner.wait()
httpd.stop()
finally:
shutil.rmtree(profilePath)

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

@ -62,6 +62,7 @@ PERL_VERSION=5.006
CAIRO_VERSION=1.10
PANGO_VERSION=1.14.0
GTK2_VERSION=2.10.0
GTK3_VERSION=3.0.0
WINDRES_VERSION=2.14.90
W32API_VERSION=3.14
GNOMEVFS_VERSION=2.0
@ -4478,6 +4479,7 @@ MOZ_ARG_HEADER(Toolkit Options)
OS/2 - cairo-os2
Win32 - cairo-windows
* - cairo-gtk2
* - cairo-gtk3
* - cairo-qt],
[ _DEFAULT_TOOLKIT=$enableval ],
[ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
@ -4485,6 +4487,7 @@ MOZ_ARG_HEADER(Toolkit Options)
if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk3" \
-o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
-o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
-o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
@ -4521,8 +4524,29 @@ cairo-windows)
fi
;;
cairo-gtk3)
MOZ_WIDGET_TOOLKIT=gtk3
MOZ_ENABLE_GTK=1
MOZ_ENABLE_GTK3=1
MOZ_ENABLE_XREMOTE=1
MOZ_WEBGL=1
MOZ_GL_DEFAULT_PROVIDER=GLX
AC_DEFINE(MOZ_X11)
MOZ_X11=1
USE_FC_FREETYPE=1
TK_CFLAGS='$(MOZ_GTK3_CFLAGS)'
TK_LIBS='$(MOZ_GTK3_LIBS)'
MOZ_WIDGET_GTK=3
AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK)
MOZ_PDF_PRINTING=1
MOZ_INSTRUMENT_EVENT_LOOP=1
;;
cairo-gtk2|cairo-gtk2-x11)
MOZ_WIDGET_TOOLKIT=gtk2
MOZ_ENABLE_GTK=1
MOZ_ENABLE_GTK2=1
MOZ_ENABLE_XREMOTE=1
MOZ_WEBGL=1
@ -4638,6 +4662,9 @@ if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
fi
if test "$COMPILE_ENVIRONMENT"; then
if test "$MOZ_ENABLE_GTK3"; then
PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
fi
if test "$MOZ_ENABLE_GTK2"; then
if test "$MOZ_X11"; then
GDK_PACKAGES=gdk-x11-2.0
@ -4665,7 +4692,7 @@ dnl ========================================================
dnl = startup-notification support module
dnl ========================================================
if test "$MOZ_ENABLE_GTK2"
if test "$MOZ_ENABLE_GTK"
then
MOZ_ENABLE_STARTUP_NOTIFICATION=
@ -4805,6 +4832,8 @@ AC_SUBST(TK_CFLAGS)
AC_SUBST(TK_LIBS)
AC_SUBST(MOZ_ENABLE_GTK2)
AC_SUBST(MOZ_ENABLE_GTK3)
AC_SUBST(MOZ_ENABLE_GTK)
AC_SUBST(MOZ_ENABLE_QT)
AC_SUBST(MOZ_ENABLE_QTNETWORK)
AC_SUBST(MOZ_ENABLE_QMSYSTEM2)
@ -4812,6 +4841,8 @@ AC_SUBST(MOZ_ENABLE_QTMOBILITY)
AC_SUBST(MOZ_ENABLE_XREMOTE)
AC_SUBST(MOZ_GTK2_CFLAGS)
AC_SUBST(MOZ_GTK2_LIBS)
AC_SUBST(MOZ_GTK3_CFLAGS)
AC_SUBST(MOZ_GTK3_LIBS)
AC_SUBST(MOZ_WIDGET_GTK)
AC_SUBST(MOZ_QT_CFLAGS)
AC_SUBST(MOZ_QT_LIBS)
@ -4904,7 +4935,7 @@ MOZ_ARG_DISABLE_BOOL(pango,
dnl ========================================================
dnl = Pango
dnl ========================================================
if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT"
then
AC_SUBST(MOZ_PANGO)
@ -4931,7 +4962,7 @@ if test "$MOZ_X11"
then
dnl build the GIO extension by default only when the
dnl GTK2 toolkit is in use.
if test "$MOZ_ENABLE_GTK2"
if test "$MOZ_ENABLE_GTK"
then
MOZ_ENABLE_GIO=1
MOZ_ENABLE_GCONF=1
@ -4972,7 +5003,7 @@ then
MOZ_ENABLE_GIO=,
MOZ_ENABLE_GIO=force)
if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK"
then
PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, ,
[AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])])
@ -5028,7 +5059,7 @@ dnl ========================================================
dnl = libproxy support
dnl ========================================================
if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT"
then
MOZ_ENABLE_LIBPROXY=
@ -5061,7 +5092,7 @@ dnl ========================================================
dnl = libgnomeui support module
dnl ========================================================
if test "$MOZ_ENABLE_GTK2"
if test "$MOZ_ENABLE_GTK"
then
MOZ_ARG_ENABLE_BOOL(gnomeui,
[ --enable-gnomeui Enable libgnomeui instead of GIO & GTK for icon theme support ],
@ -5094,7 +5125,7 @@ dnl ========================================================
dnl = dbus support
dnl ========================================================
if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT"
then
MOZ_ENABLE_DBUS=1
@ -5977,7 +6008,7 @@ i?86-apple-darwin*|x86_64-apple-darwin*)
MOZ_CRASHREPORTER=1
;;
i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
if test "$MOZ_ENABLE_GTK2"; then
if test "$MOZ_ENABLE_GTK"; then
MOZ_CRASHREPORTER=1
fi
;;
@ -9001,7 +9032,7 @@ if test "$MOZ_DEBUG"; then
AC_DEFINE(MOZ_REFLOW_PERF_DSP)
fi
if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then
AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`

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

@ -6429,6 +6429,9 @@ nsContentUtils::ReleaseWrapper(void* aScriptObjectHolder,
JSObject* obj = aCache->GetWrapperPreserveColor();
if (aCache->IsDOMBinding() && obj && js::IsProxy(obj)) {
DOMProxyHandler::GetAndClearExpandoObject(obj);
if (!aCache->PreservingWrapper()) {
return;
}
}
aCache->SetPreservingWrapper(false);
DropJSObjects(aScriptObjectHolder);

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

@ -834,6 +834,7 @@ GK_ATOM(percent, "percent")
GK_ATOM(persist, "persist")
GK_ATOM(phase, "phase")
GK_ATOM(ping, "ping")
GK_ATOM(pinned,"pinned")
GK_ATOM(placeholder, "placeholder")
GK_ATOM(plaintext, "plaintext")
GK_ATOM(playbackrate, "playbackrate")

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

@ -16,6 +16,7 @@
#include "nsIXPConnect.h"
#include "nsError.h"
#include "nsIGfxInfo.h"
#include "nsIWidget.h"
#include "nsIPropertyBag.h"
#include "nsIVariant.h"
@ -49,6 +50,10 @@
#include "Layers.h"
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/ShadowLayers.h"
#endif
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::gfx;
@ -463,6 +468,20 @@ WebGLContext::SetDimensions(int32_t width, int32_t height)
caps.preserve = mOptions.preserveDrawingBuffer;
#ifdef MOZ_WIDGET_GONK
nsIWidget *docWidget = nsContentUtils::WidgetForDocument(mCanvasElement->OwnerDoc());
if (docWidget) {
layers::LayerManager *layerManager = docWidget->GetLayerManager();
if (layerManager) {
// XXX we really want "AsSurfaceAllocator" here for generality
layers::ShadowLayerForwarder *forwarder = layerManager->AsShadowForwarder();
if (forwarder) {
caps.surfaceAllocator = static_cast<layers::ISurfaceAllocator*>(forwarder);
}
}
}
#endif
bool forceMSAA =
Preferences::GetBool("webgl.msaa-force", false);

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

@ -38,6 +38,7 @@ CPP_SOURCES += [
'nsDOMDragEvent.cpp',
'nsDOMEvent.cpp',
'nsDOMEventTargetHelper.cpp',
'nsDOMFocusEvent.cpp',
'nsDOMKeyboardEvent.cpp',
'nsDOMMessageEvent.cpp',
'nsDOMMouseEvent.cpp',

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

@ -161,6 +161,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEvent)
case NS_MUTATION_EVENT:
static_cast<nsMutationEvent*>(tmp->mEvent)->mRelatedNode = nullptr;
break;
case NS_FOCUS_EVENT:
static_cast<nsFocusEvent*>(tmp->mEvent)->relatedTarget = nullptr;
break;
default:
break;
}
@ -203,6 +206,11 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
cb.NoteXPCOMChild(
static_cast<nsMutationEvent*>(tmp->mEvent)->mRelatedNode);
break;
case NS_FOCUS_EVENT:
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget");
cb.NoteXPCOMChild(
static_cast<nsFocusEvent*>(tmp->mEvent)->relatedTarget);
break;
default:
break;
}

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

@ -0,0 +1,87 @@
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* 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/. */
#include "nsDOMFocusEvent.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_ISUPPORTS_INHERITED1(nsDOMFocusEvent, nsDOMUIEvent, nsIDOMFocusEvent)
nsDOMFocusEvent::nsDOMFocusEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsFocusEvent* aEvent)
: nsDOMUIEvent(aOwner, aPresContext, aEvent ?
static_cast<nsGUIEvent*>(aEvent) :
static_cast<nsGUIEvent*>(new nsFocusEvent(false, NS_FOCUS_CONTENT)))
{
if (aEvent) {
mEventIsInternal = false;
} else {
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMFocusEvent::~nsDOMFocusEvent()
{
if (mEventIsInternal && mEvent) {
delete static_cast<nsFocusEvent*>(mEvent);
mEvent = nullptr;
}
}
/* readonly attribute nsIDOMEventTarget relatedTarget; */
NS_IMETHODIMP
nsDOMFocusEvent::GetRelatedTarget(nsIDOMEventTarget** aRelatedTarget)
{
NS_ENSURE_ARG_POINTER(aRelatedTarget);
NS_IF_ADDREF(*aRelatedTarget = GetRelatedTarget());
return NS_OK;
}
mozilla::dom::EventTarget*
nsDOMFocusEvent::GetRelatedTarget()
{
return static_cast<nsFocusEvent*>(mEvent)->relatedTarget;
}
nsresult
nsDOMFocusEvent::InitFocusEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
nsIDOMWindow* aView,
int32_t aDetail,
mozilla::dom::EventTarget* aRelatedTarget)
{
nsresult rv = nsDOMUIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, aDetail);
NS_ENSURE_SUCCESS(rv, rv);
static_cast<nsFocusEvent*>(mEvent)->relatedTarget = aRelatedTarget;
return NS_OK;
}
already_AddRefed<nsDOMFocusEvent>
nsDOMFocusEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType,
const mozilla::dom::FocusEventInit& aParam,
mozilla::ErrorResult& aRv)
{
nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.Get());
nsRefPtr<nsDOMFocusEvent> e = new nsDOMFocusEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);
aRv = e->InitFocusEvent(aType, aParam.mBubbles, aParam.mCancelable, aParam.mView,
aParam.mDetail, aParam.mRelatedTarget);
e->SetTrusted(trusted);
return e.forget();
}
nsresult NS_NewDOMFocusEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsFocusEvent* aEvent)
{
nsDOMFocusEvent* it = new nsDOMFocusEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);
}

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

@ -0,0 +1,47 @@
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* 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/. */
#ifndef nsDOMFocusEvent_h_
#define nsDOMFocusEvent_h_
#include "nsDOMUIEvent.h"
#include "nsIDOMFocusEvent.h"
#include "mozilla/dom/FocusEventBinding.h"
class nsDOMFocusEvent : public nsDOMUIEvent,
public nsIDOMFocusEvent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMFOCUSEVENT
// Forward to base class
NS_FORWARD_TO_NSDOMUIEVENT
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{
return mozilla::dom::FocusEventBinding::Wrap(aCx, aScope, this);
}
nsDOMFocusEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsFocusEvent* aEvent);
mozilla::dom::EventTarget* GetRelatedTarget();
static already_AddRefed<nsDOMFocusEvent> Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType,
const mozilla::dom::FocusEventInit& aParam,
mozilla::ErrorResult& aRv);
protected:
nsresult InitFocusEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
nsIDOMWindow* aView,
int32_t aDetail,
mozilla::dom::EventTarget* aRelatedTarget);
~nsDOMFocusEvent();
};
#endif /* !defined(nsDOMFocusEvent_h_) */

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

@ -730,6 +730,9 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
case NS_MOUSE_EVENT:
return NS_NewDOMMouseEvent(aDOMEvent, aOwner, aPresContext,
static_cast<nsInputEvent*>(aEvent));
case NS_FOCUS_EVENT:
return NS_NewDOMFocusEvent(aDOMEvent, aOwner, aPresContext,
static_cast<nsFocusEvent*>(aEvent));
case NS_MOUSE_SCROLL_EVENT:
return NS_NewDOMMouseScrollEvent(aDOMEvent, aOwner, aPresContext,
static_cast<nsInputEvent*>(aEvent));

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

@ -103,6 +103,7 @@ MOCHITEST_FILES = \
test_addEventListenerExtraArg.html \
test_focus_disabled.html \
test_bug847597.html \
test_bug855741.html \
$(NULL)
MOCHITEST_CHROME_FILES = \

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

@ -0,0 +1,90 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=855741
-->
<head>
<title>Test for Bug 855741</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<input type="text" id="testTarget" value="focus">
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 855741 **/
function testFocusEvent(event) {
ok(('relatedTarget' in event), 'FocusEvent.relatedTarget exists');
if (event.construct_test == true) {
ok(event.relatedTarget == $("content"), 'FocusEvent.relatedTarget is ' + $("content").id);
}
}
function testUIEvent(event) {
ok((event.detail == 0),
'UIEvent.detail should be 0 in ' + event.target.value + ' event');
ok((event.defaultView == null),
'UIEvent.defaultView should be null in ' + event.target.value + ' event');
}
function testEventType(event, type) {
ok((event.type == type), 'Event.type match: ' + type);
}
function eventhandle(event) {
testFocusEvent(event);
testUIEvent(event);
testEventType(event, event.target.value);
if (event.target.value == 'blur') {
event.target.value = 'focus';
} else {
event.target.value = 'blur';
}
}
//
// event handler:
//
$("testTarget").addEventListener("focus", eventhandle, true);
$("testTarget").addEventListener("blur", eventhandle, true);
//
// FocusEvent structure test
//
$("testTarget").focus();
$("testTarget").blur();
//
// Focus/Blur constructor test
//
var focus_event = new FocusEvent("focus",
{bubbles: true,
cancelable: true,
relatedTarget: $("content")});
focus_event.construct_test = true;
var blur_event = new FocusEvent("blur",
{bubbles: true,
cancelable: true,
relatedTarget: $("content")});
blur_event.construct_test = true;
// create cycle referece for leak test
$("content").foo_focus = focus_event;
$("content").foo_blur = blur_event;
$("testTarget").dispatchEvent(focus_event);
$("testTarget").dispatchEvent(blur_event);
</script>
</pre>
</body>
</html>

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

@ -113,12 +113,12 @@ AudioBlockPanStereoToStereo(const float aInputL[WEBAUDIO_BLOCK_SIZE],
if (aIsOnTheLeft) {
for (i = 0; i < WEBAUDIO_BLOCK_SIZE; ++i) {
*aOutputL++ = *aInputL++ + *aInputR * aGainL;
*aOutputL++ = *aInputL++ + *aInputR++ * aGainL;
*aOutputR++ = *aInputR++ * aGainR;
}
} else {
for (i = 0; i < WEBAUDIO_BLOCK_SIZE; ++i) {
*aOutputL++ = *aInputL * aGainL;
*aOutputL++ = *aInputL++ * aGainL;
*aOutputR++ = *aInputR++ + *aInputL++ * aGainR;
}
}

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

@ -39,8 +39,8 @@ namespace layers {
VideoGraphicBuffer::VideoGraphicBuffer(const android::wp<android::OmxDecoder> aOmxDecoder,
android::MediaBuffer *aBuffer,
SurfaceDescriptor *aDescriptor)
: GraphicBufferLocked(*aDescriptor),
SurfaceDescriptor& aDescriptor)
: GraphicBufferLocked(aDescriptor),
mMediaBuffer(aBuffer),
mOmxDecoder(aOmxDecoder)
{
@ -592,11 +592,11 @@ bool OmxDecoder::ReadVideo(VideoFrame *aFrame, int64_t aTimeUs,
// Change the descriptor's size to video's size. There are cases that
// GraphicBuffer's size and actual video size is different.
// See Bug 850566.
const mozilla::layers::SurfaceDescriptorGralloc& grallocDesc = descriptor->get_SurfaceDescriptorGralloc();
mozilla::layers::SurfaceDescriptor newDescriptor = mozilla::layers::SurfaceDescriptorGralloc(grallocDesc.bufferParent(),
grallocDesc.bufferChild(), nsIntSize(mVideoWidth, mVideoHeight), grallocDesc.external());
mozilla::layers::SurfaceDescriptorGralloc newDescriptor = descriptor->get_SurfaceDescriptorGralloc();
newDescriptor.size() = nsIntSize(mVideoWidth, mVideoHeight);
aFrame->mGraphicBuffer = new mozilla::layers::VideoGraphicBuffer(this, mVideoBuffer, &newDescriptor);
mozilla::layers::SurfaceDescriptor descWrapper(newDescriptor);
aFrame->mGraphicBuffer = new mozilla::layers::VideoGraphicBuffer(this, mVideoBuffer, descWrapper);
aFrame->mRotation = mVideoRotation;
aFrame->mTimeUs = timeUs;
aFrame->mKeyFrame = keyFrame;

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

@ -27,7 +27,7 @@ class VideoGraphicBuffer : public GraphicBufferLocked {
public:
VideoGraphicBuffer(const android::wp<android::OmxDecoder> aOmxDecoder,
android::MediaBuffer *aBuffer,
SurfaceDescriptor *aDescriptor);
SurfaceDescriptor& aDescriptor);
~VideoGraphicBuffer();
void Unlock();
};

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

@ -0,0 +1,37 @@
<script>
try { o1 = new window.AudioContext(2, 5, 44100); } catch(e) { }
try { o2 = o1.createChannelMerger(1); } catch(e) { }
try { o3 = o1.createDelay(10); } catch(e) { }
try { o4 = o1.createBuffer(2, 2048, 8000); } catch(e) { }
try { o5 = o1.createPanner(); } catch(e) { }
try { o6 = o1.createBufferSource(); } catch(e) { }
try { o7 = (function() {
var buf = o1.createBuffer(1, 50000, o1.sampleRate);
for(var j=0; j<1; ++j) {
for(var i=0; i<50000; ++i) { buf.getChannelData(j)[i] = Math.sin(i * (9.8));}
}
return buf;
})(); } catch(e) { }
try { o6.buffer = o7; } catch(e) { }
try { o6.connect(o5); } catch(e) { }
try { o5.connect(o1.destination); } catch(e) { }
try { o1.listener.speedOfSound = 0.0000019073486328125; } catch(e) { }
try { o6.loop = true; } catch(e) { }
try { o8 = (function() {
var buf = o1.createBuffer(2, 1000, o1.sampleRate);
for(var j=0; j<2; ++j) {
for(var i=0; i<1000; ++i) { buf.getChannelData(j)[i] = Math.sin(i * (1));}
}
return buf;
})(); } catch(e) { }
try { o6.buffer = o7; } catch(e) { }
try { o6.connect(o5); } catch(e) { }
try { o5.connect(o1.destination); } catch(e) { }
try { o6.loopEnd = 1.4901161193847656e-8; } catch(e) { }
try { o6.connect(o1.destination); } catch(e) { }
try { o6.buffer = o8; } catch(e) { }
try { o5.setPosition(0.36, o1.destination.context.destination.channelCountMode, o1.destination.context.destination.channelInterpretation) } catch(e) { }
try { o2.channelCountMode = 'explicit'; } catch(e) { }
try { o1.listener.speedOfSound = 4; } catch(e) { }
try { o1.startRendering(); } catch(e) { }
</script>

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

@ -36,3 +36,4 @@ load 878014.html
load 878328.html
load 878407.html
load 878478.html
load 877527.html

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

@ -7,6 +7,7 @@
#ifndef nsDOMClassInfo_h___
#define nsDOMClassInfo_h___
#include "mozilla/Attributes.h"
#include "nsIDOMClassInfo.h"
#include "nsIXPCScriptable.h"
#include "jsapi.h"
@ -139,11 +140,11 @@ protected:
const nsDOMClassInfoData* mData;
virtual void PreserveWrapper(nsISupports *aNative)
virtual void PreserveWrapper(nsISupports *aNative) MOZ_OVERRIDE
{
}
virtual uint32_t GetInterfacesBitmap()
virtual uint32_t GetInterfacesBitmap() MOZ_OVERRIDE
{
return mData->mInterfacesBitmap;
}
@ -285,11 +286,11 @@ protected:
}
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
virtual void PreserveWrapper(nsISupports *aNative);
virtual void PreserveWrapper(nsISupports *aNative) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
@ -310,11 +311,11 @@ protected:
}
public:
NS_IMETHOD PreCreate(nsISupports* aNativeObj, JSContext* aCx,
JSObject* aGlobalObj, JSObject** aParentObj);
JSObject* aGlobalObj, JSObject** aParentObj) MOZ_OVERRIDE;
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative* aWrapper, JSContext* aCx,
JSObject* aObj, jsid Id, jsval* aVp, bool* aRetval);
JSObject* aObj, jsid Id, jsval* aVp, bool* aRetval) MOZ_OVERRIDE;
virtual void PreserveWrapper(nsISupports *aNative);
virtual void PreserveWrapper(nsISupports *aNative) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
@ -341,10 +342,10 @@ protected:
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
#ifdef DEBUG
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj)
JSObject *obj) MOZ_OVERRIDE
{
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryWrappedNative(wrapper));
@ -353,21 +354,21 @@ public:
return NS_OK;
}
virtual uint32_t GetScriptableFlags()
virtual uint32_t GetScriptableFlags() MOZ_OVERRIDE
{
return nsDOMGenericSH::GetScriptableFlags() |
nsIXPCScriptable::WANT_POSTCREATE;
}
#endif
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, bool *_retval);
JSObject *obj, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSFreeOp *fop,
JSObject *obj);
JSObject *obj) MOZ_OVERRIDE;
NS_IMETHOD OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
JSObject * obj, JSObject * *_retval);
JSObject * obj, JSObject * *_retval) MOZ_OVERRIDE;
static JSBool GlobalScopePolluterNewResolve(JSContext *cx, JSHandleObject obj,
JSHandleId id, unsigned flags,
@ -400,10 +401,10 @@ protected:
public:
NS_IMETHOD CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t mode,
jsval *vp, bool *_retval);
jsval *vp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
NS_IMETHODIMP AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
@ -429,10 +430,10 @@ protected:
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
@ -456,15 +457,15 @@ protected:
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
NS_IMETHOD GetFlags(uint32_t *aFlags);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD GetFlags(uint32_t *aFlags) MOZ_OVERRIDE;
virtual void PreserveWrapper(nsISupports *aNative);
virtual void PreserveWrapper(nsISupports *aNative) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
@ -488,11 +489,11 @@ protected:
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj);
JSObject *obj) MOZ_OVERRIDE;
NS_IMETHOD PostTransplant(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj);
JSObject *obj) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
@ -517,9 +518,9 @@ protected:
public:
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, bool *_retval);
JSObject *obj, bool *_retval) MOZ_OVERRIDE;
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, uint32_t *length);
@ -551,7 +552,7 @@ protected:
public:
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
private:
// Not implemented, nothing should create an instance of this class.
@ -574,7 +575,7 @@ protected:
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
virtual nsISupports* GetNamedItem(nsISupports *aNative,
const nsAString& aName,
@ -583,7 +584,7 @@ protected:
public:
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
private:
// Not implemented, nothing should create an instance of this class.
@ -633,15 +634,15 @@ protected:
public:
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp,
bool *_retval);
bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper,
JSContext *cx, JSObject *obj,
uint32_t enum_op, jsval *statep,
jsid *idp, bool *_retval);
jsid *idp, bool *_retval) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
@ -664,13 +665,13 @@ protected:
}
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
nsWrapperCache **aCache, nsresult *aResult);
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
// Override nsNamedArraySH::GetNamedItem()
virtual nsISupports* GetNamedItem(nsISupports *aNative,
const nsAString& aName,
nsWrapperCache **cache,
nsresult *aResult);
nsresult *aResult) MOZ_OVERRIDE;
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
@ -694,13 +695,13 @@ protected:
}
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
nsWrapperCache **aCache, nsresult *aResult);
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
// Override nsNamedArraySH::GetNamedItem()
virtual nsISupports* GetNamedItem(nsISupports *aNative,
const nsAString& aName,
nsWrapperCache **cache,
nsresult *aResult);
nsresult *aResult) MOZ_OVERRIDE;
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
@ -724,13 +725,13 @@ protected:
}
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
nsWrapperCache **aCache, nsresult *aResult);
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
// Override nsNamedArraySH::GetNamedItem()
virtual nsISupports* GetNamedItem(nsISupports *aNative,
const nsAString& aName,
nsWrapperCache **cache,
nsresult *aResult);
nsresult *aResult) MOZ_OVERRIDE;
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
@ -758,7 +759,7 @@ protected:
public:
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
};
@ -776,13 +777,13 @@ protected:
}
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
nsAString& aResult);
nsAString& aResult) MOZ_OVERRIDE;
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
@ -804,7 +805,7 @@ protected:
}
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
nsAString& aResult);
nsAString& aResult) MOZ_OVERRIDE;
public:
// Inherit GetProperty, Enumerate from nsStringArraySH
@ -830,7 +831,7 @@ protected:
}
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
nsAString& aResult);
nsAString& aResult) MOZ_OVERRIDE;
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
@ -854,7 +855,7 @@ protected:
}
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
nsWrapperCache **aCache, nsresult *aResult);
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
@ -878,7 +879,7 @@ protected:
}
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
nsWrapperCache **aCache, nsresult *aResult);
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
@ -899,7 +900,7 @@ class nsDOMTouchListSH : public nsArraySH
}
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
nsWrapperCache **aCache, nsresult *aResult);
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
public:
static nsIClassInfo* doCreate(nsDOMClassInfoData* aData)
@ -923,16 +924,16 @@ protected:
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, jsval *vp, bool *_retval);
JSObject *obj, jsid id, jsval *vp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, bool *_retval);
JSObject *obj, jsid id, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, uint32_t enum_op, jsval *statep,
jsid *idp, bool *_retval);
jsid *idp, bool *_retval) MOZ_OVERRIDE;
public:
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
@ -975,19 +976,19 @@ protected:
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto)
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto) MOZ_OVERRIDE
{
return NS_OK;
}
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsid id, uint32_t flags,
JSObject **objp, bool *_retval);
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, const JS::CallArgs &args, bool *_retval);
JSObject *obj, const JS::CallArgs &args, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, const JS::CallArgs &args, bool *_retval);
JSObject *obj, const JS::CallArgs &args, bool *_retval) MOZ_OVERRIDE;
NS_IMETHOD HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, const jsval &val, bool *bp,
@ -1011,7 +1012,7 @@ protected:
}
public:
NS_IMETHOD GetFlags(uint32_t *aFlags);
NS_IMETHOD GetFlags(uint32_t *aFlags) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{

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

@ -36,8 +36,8 @@ public:
NS_DECL_NSIOBSERVER
// nsIDOMScriptObjectFactory
NS_IMETHOD_(nsISupports *) GetClassInfoInstance(nsDOMClassInfoID aID);
NS_IMETHOD_(nsISupports *) GetExternalClassInfoInstance(const nsAString& aName);
NS_IMETHOD_(nsISupports *) GetClassInfoInstance(nsDOMClassInfoID aID) MOZ_OVERRIDE;
NS_IMETHOD_(nsISupports *) GetExternalClassInfoInstance(const nsAString& aName) MOZ_OVERRIDE;
NS_IMETHOD RegisterDOMClassInfo(const char *aName,
nsDOMClassInfoExternalConstructorFnc aConstructorFptr,
@ -45,7 +45,7 @@ public:
const nsIID **aInterfaces,
uint32_t aScriptableFlags,
bool aHasClassInterface,
const nsCID *aConstructorCID);
const nsCID *aConstructorCID) MOZ_OVERRIDE;
};
class nsDOMExceptionProvider MOZ_FINAL : public nsIExceptionProvider

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

@ -64,7 +64,6 @@
#include "nsIIOService.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/indexedDB/FileInfo.h"
#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
#include "mozilla/dom/quota/QuotaManager.h"
#include "GeckoProfiler.h"
@ -2868,28 +2867,15 @@ nsDOMWindowUtils::GetFileReferences(const nsAString& aDatabaseName,
indexedDB::IndexedDatabaseManager::Get();
if (mgr) {
nsRefPtr<indexedDB::FileManager> fileManager =
mgr->GetFileManager(origin, aDatabaseName);
if (fileManager) {
nsRefPtr<indexedDB::FileInfo> fileInfo = fileManager->GetFileInfo(aId);
if (fileInfo) {
fileInfo->GetReferences(aRefCnt, aDBRefCnt, aSliceRefCnt);
if (*aRefCnt != -1) {
// We added an extra temp ref, so account for that accordingly.
(*aRefCnt)--;
}
*aResult = true;
return NS_OK;
}
}
rv = mgr->BlockAndGetFileReferences(origin, aDatabaseName, aId, aRefCnt,
aDBRefCnt, aSliceRefCnt, aResult);
NS_ENSURE_SUCCESS(rv, rv);
}
else {
*aRefCnt = *aDBRefCnt = *aSliceRefCnt = -1;
*aResult = false;
}
*aRefCnt = *aDBRefCnt = *aSliceRefCnt = -1;
*aResult = false;
return NS_OK;
}

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

@ -48,7 +48,7 @@ public:
JS::Handle<JSObject*> aScopeObject,
JS::CompileOptions &aOptions,
bool aCoerceToString,
JS::Value* aRetValue);
JS::Value* aRetValue) MOZ_OVERRIDE;
virtual nsresult CompileScript(const PRUnichar* aText,
int32_t aTextLength,
@ -57,46 +57,46 @@ public:
uint32_t aLineNo,
uint32_t aVersion,
JS::MutableHandle<JSScript*> aScriptObject,
bool aSaveSource = false);
bool aSaveSource = false) MOZ_OVERRIDE;
virtual nsresult ExecuteScript(JSScript* aScriptObject,
JSObject* aScopeObject);
JSObject* aScopeObject) MOZ_OVERRIDE;
virtual nsresult BindCompiledEventHandler(nsISupports *aTarget,
JS::Handle<JSObject*> aScope,
JS::Handle<JSObject*> aHandler,
JS::MutableHandle<JSObject*> aBoundHandler);
JS::MutableHandle<JSObject*> aBoundHandler) MOZ_OVERRIDE;
virtual nsIScriptGlobalObject *GetGlobalObject();
virtual nsIScriptGlobalObject *GetGlobalObject() MOZ_OVERRIDE;
inline nsIScriptGlobalObject *GetGlobalObjectRef() { return mGlobalObjectRef; }
virtual JSContext* GetNativeContext();
virtual JSObject* GetNativeGlobal();
virtual nsresult InitContext();
virtual bool IsContextInitialized();
virtual JSContext* GetNativeContext() MOZ_OVERRIDE;
virtual JSObject* GetNativeGlobal() MOZ_OVERRIDE;
virtual nsresult InitContext() MOZ_OVERRIDE;
virtual bool IsContextInitialized() MOZ_OVERRIDE;
virtual void ScriptEvaluated(bool aTerminated);
virtual bool GetScriptsEnabled();
virtual void SetScriptsEnabled(bool aEnabled, bool aFireTimeouts);
virtual void ScriptEvaluated(bool aTerminated) MOZ_OVERRIDE;
virtual bool GetScriptsEnabled() MOZ_OVERRIDE;
virtual void SetScriptsEnabled(bool aEnabled, bool aFireTimeouts) MOZ_OVERRIDE;
virtual nsresult SetProperty(JS::Handle<JSObject*> aTarget, const char* aPropName, nsISupports* aVal);
virtual nsresult SetProperty(JS::Handle<JSObject*> aTarget, const char* aPropName, nsISupports* aVal) MOZ_OVERRIDE;
virtual bool GetProcessingScriptTag();
virtual void SetProcessingScriptTag(bool aResult);
virtual bool GetProcessingScriptTag() MOZ_OVERRIDE;
virtual void SetProcessingScriptTag(bool aResult) MOZ_OVERRIDE;
virtual bool GetExecutingScript();
virtual bool GetExecutingScript() MOZ_OVERRIDE;
virtual nsresult InitClasses(JS::Handle<JSObject*> aGlobalObj);
virtual nsresult InitClasses(JS::Handle<JSObject*> aGlobalObj) MOZ_OVERRIDE;
virtual void WillInitializeContext();
virtual void DidInitializeContext();
virtual void WillInitializeContext() MOZ_OVERRIDE;
virtual void DidInitializeContext() MOZ_OVERRIDE;
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
JS::Handle<JSScript*> aScriptObject);
JS::Handle<JSScript*> aScriptObject) MOZ_OVERRIDE;
virtual nsresult Deserialize(nsIObjectInputStream* aStream,
JS::MutableHandle<JSScript*> aResult);
JS::MutableHandle<JSScript*> aResult) MOZ_OVERRIDE;
virtual void EnterModalState();
virtual void LeaveModalState();
virtual void EnterModalState() MOZ_OVERRIDE;
virtual void LeaveModalState() MOZ_OVERRIDE;
NS_DECL_NSIXPCSCRIPTNOTIFY
@ -144,7 +144,7 @@ public:
// Calling LikelyShortLivingObjectCreated() makes a GC more likely.
static void LikelyShortLivingObjectCreated();
virtual void GC(JS::gcreason::Reason aReason);
virtual void GC(JS::gcreason::Reason aReason) MOZ_OVERRIDE;
static uint32_t CleanupsSinceLastGC();
@ -223,7 +223,7 @@ public:
virtual already_AddRefed<nsIScriptContext>
CreateContext(bool aGCOnDestruction,
nsIScriptGlobalObject* aGlobalObject);
nsIScriptGlobalObject* aGlobalObject) MOZ_OVERRIDE;
static void Startup();
static void Shutdown();

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

@ -14,6 +14,7 @@ class nsIDOMEvent;
class nsEventChainPreVisitor;
class nsEventChainPostVisitor;
#include "mozilla/Attributes.h"
#include "nsIDOMEventTarget.h"
#include "nsEventListenerManager.h"
#include "nsPIWindowRoot.h"
@ -36,20 +37,20 @@ public:
// nsPIWindowRoot
virtual nsPIDOMWindow* GetWindow();
virtual nsPIDOMWindow* GetWindow() MOZ_OVERRIDE;
virtual nsresult GetControllers(nsIControllers** aResult);
virtual nsresult GetControllers(nsIControllers** aResult) MOZ_OVERRIDE;
virtual nsresult GetControllerForCommand(const char * aCommand,
nsIController** _retval);
nsIController** _retval) MOZ_OVERRIDE;
virtual nsIDOMNode* GetPopupNode();
virtual void SetPopupNode(nsIDOMNode* aNode);
virtual nsIDOMNode* GetPopupNode() MOZ_OVERRIDE;
virtual void SetPopupNode(nsIDOMNode* aNode) MOZ_OVERRIDE;
virtual void SetParentTarget(mozilla::dom::EventTarget* aTarget)
virtual void SetParentTarget(mozilla::dom::EventTarget* aTarget) MOZ_OVERRIDE
{
mParent = aTarget;
}
virtual mozilla::dom::EventTarget* GetParentTarget() { return mParent; }
virtual mozilla::dom::EventTarget* GetParentTarget() MOZ_OVERRIDE { return mParent; }
virtual nsIDOMWindow* GetOwnerGlobal() MOZ_OVERRIDE;
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsWindowRoot,

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

@ -390,6 +390,10 @@ DOMInterfaces = {
'nativeType': 'JSObject'
}],
'FocusEvent': {
'nativeType': 'nsDOMFocusEvent',
},
'GainNode': {
'resultNotAddRefed': [ 'gain' ],
},

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

@ -81,6 +81,7 @@ DOMProxyHandler::GetAndClearExpandoObject(JSObject* obj)
if (v.isObject()) {
js::SetProxyExtra(obj, JSPROXYSLOT_EXPANDO, UndefinedValue());
xpc::GetObjectScope(obj)->RemoveDOMExpandoObject(obj);
} else {
js::ExpandoAndGeneration* expandoAndGeneration =
static_cast<js::ExpandoAndGeneration*>(v.toPrivate());
@ -88,10 +89,15 @@ DOMProxyHandler::GetAndClearExpandoObject(JSObject* obj)
if (v.isUndefined()) {
return nullptr;
}
nsISupports* native = UnwrapDOMObject<nsISupports>(obj);
nsWrapperCache* cache;
CallQueryInterface(native, &cache);
cache->SetPreservingWrapper(false);
nsContentUtils::DropJSObjects(native);
expandoAndGeneration->expando = UndefinedValue();
}
xpc::GetObjectScope(obj)->RemoveDOMExpandoObject(obj);
return &v.toObject();
}
@ -122,20 +128,23 @@ DOMProxyHandler::EnsureExpandoObject(JSContext* cx, JS::Handle<JSObject*> obj)
return nullptr;
}
nsISupports* native = UnwrapDOMObject<nsISupports>(obj);
nsWrapperCache* cache;
CallQueryInterface(native, &cache);
if (expandoAndGeneration) {
nsContentUtils::PreserveWrapper(native, cache);
expandoAndGeneration->expando.setObject(*expando);
return expando;
}
XPCWrappedNativeScope* scope = xpc::GetObjectScope(obj);
if (!scope->RegisterDOMExpandoObject(obj)) {
return nullptr;
}
nsWrapperCache* cache;
CallQueryInterface(UnwrapDOMObject<nsISupports>(obj), &cache);
cache->SetPreservingWrapper(true);
if (expandoAndGeneration) {
expandoAndGeneration->expando.setObject(*expando);
} else {
js::SetProxyExtra(obj, JSPROXYSLOT_EXPANDO, ObjectValue(*expando));
}
js::SetProxyExtra(obj, JSPROXYSLOT_EXPANDO, ObjectValue(*expando));
return expando;
}

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

@ -137,9 +137,6 @@ FillPropertyDescriptor(JSPropertyDescriptor* desc, JSObject* obj, JS::Value v, b
FillPropertyDescriptor(desc, obj, readonly);
}
JSObject*
EnsureExpandoObject(JSContext* cx, JS::Handle<JSObject*> obj);
} // namespace dom
} // namespace mozilla

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_bluetooth_bluetoothadapter_h__
#define mozilla_dom_bluetooth_bluetoothadapter_h__
#include "mozilla/Attributes.h"
#include "BluetoothCommon.h"
#include "BluetoothPropertyContainer.h"
#include "nsCOMPtr.h"
@ -48,7 +49,7 @@ public:
}
void Unroot();
virtual void SetPropertyByValue(const BluetoothNamedValue& aValue);
virtual void SetPropertyByValue(const BluetoothNamedValue& aValue) MOZ_OVERRIDE;
private:
BluetoothAdapter(nsPIDOMWindow* aOwner, const BluetoothValue& aValue);

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_bluetooth_bluetoothdevice_h__
#define mozilla_dom_bluetooth_bluetoothdevice_h__
#include "mozilla/Attributes.h"
#include "BluetoothCommon.h"
#include "BluetoothPropertyContainer.h"
#include "nsDOMEventTargetHelper.h"
@ -48,7 +49,7 @@ public:
return static_cast<EventTarget*>(this);
}
void SetPropertyByValue(const BluetoothNamedValue& aValue);
void SetPropertyByValue(const BluetoothNamedValue& aValue) MOZ_OVERRIDE;
void Unroot();
private:

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_bluetooth_bluetoothmanager_h__
#define mozilla_dom_bluetooth_bluetoothmanager_h__
#include "mozilla/Attributes.h"
#include "BluetoothCommon.h"
#include "BluetoothPropertyContainer.h"
#include "nsDOMEventTargetHelper.h"
@ -31,7 +32,7 @@ public:
static already_AddRefed<BluetoothManager>
Create(nsPIDOMWindow* aWindow);
void Notify(const BluetoothSignal& aData);
virtual void SetPropertyByValue(const BluetoothNamedValue& aValue);
virtual void SetPropertyByValue(const BluetoothNamedValue& aValue) MOZ_OVERRIDE;
private:
BluetoothManager(nsPIDOMWindow* aWindow);
~BluetoothManager();

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_bluetooth_bluetoothreplyrunnable_h__
#define mozilla_dom_bluetooth_bluetoothreplyrunnable_h__
#include "mozilla/Attributes.h"
#include "BluetoothCommon.h"
#include "nsThreadUtils.h"
#include "jsapi.h"
@ -58,7 +59,7 @@ public:
~BluetoothVoidReplyRunnable();
protected:
virtual bool ParseSuccessfulReply(JS::Value* aValue)
virtual bool ParseSuccessfulReply(JS::Value* aValue) MOZ_OVERRIDE
{
*aValue = JSVAL_VOID;
return true;

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

@ -18,6 +18,7 @@
#ifndef mozilla_dom_bluetooth_bluetoothgonkservice_h__
#define mozilla_dom_bluetooth_bluetoothgonkservice_h__
#include "mozilla/Attributes.h"
#include "BluetoothCommon.h"
#include "BluetoothDBusService.h"
@ -41,21 +42,21 @@ public:
*
* @return NS_OK if connection starts successfully, NS_ERROR_FAILURE otherwise
*/
virtual nsresult StartInternal();
virtual nsresult StartInternal() MOZ_OVERRIDE;
/**
* Stop the platform specific connection. Must be called from non-main thread.
*
* @return NS_OK if connection starts successfully, NS_ERROR_FAILURE otherwise
*/
virtual nsresult StopInternal();
virtual nsresult StopInternal() MOZ_OVERRIDE;
/**
* Get status of Bluetooth. Must be called from non-main thread.
*
* @return true if Bluetooth is enabled, false otherwise
*/
virtual bool IsEnabledInternal();
virtual bool IsEnabledInternal() MOZ_OVERRIDE;
};
END_BLUETOOTH_NAMESPACE

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_bluetooth_bluetoothdbuseventservice_h__
#define mozilla_dom_bluetooth_bluetoothdbuseventservice_h__
#include "mozilla/Attributes.h"
#include "BluetoothCommon.h"
#include "mozilla/ipc/RawDBusConnection.h"
#include "BluetoothService.h"
@ -26,38 +27,38 @@ class BluetoothDBusService : public BluetoothService
public:
bool IsReady();
virtual nsresult StartInternal();
virtual nsresult StartInternal() MOZ_OVERRIDE;
virtual nsresult StopInternal();
virtual nsresult StopInternal() MOZ_OVERRIDE;
virtual bool IsEnabledInternal();
virtual bool IsEnabledInternal() MOZ_OVERRIDE;
virtual nsresult GetDefaultAdapterPathInternal(
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual nsresult GetConnectedDevicePropertiesInternal(uint16_t aProfileId,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual nsresult GetPairedDevicePropertiesInternal(
const nsTArray<nsString>& aDeviceAddresses,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual nsresult StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable);
virtual nsresult StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable);
virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual nsresult
GetDevicePropertiesInternal(const BluetoothSignal& aSignal);
GetDevicePropertiesInternal(const BluetoothSignal& aSignal) MOZ_OVERRIDE;
virtual nsresult
SetProperty(BluetoothObjectType aType,
const BluetoothNamedValue& aValue,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual bool
GetDevicePath(const nsAString& aAdapterPath,
const nsAString& aDeviceAddress,
nsAString& aDevicePath);
nsAString& aDevicePath) MOZ_OVERRIDE;
static bool
AddServiceRecords(const char* serviceName,
@ -82,44 +83,44 @@ public:
GetScoSocket(const nsAString& aObjectPath,
bool aAuth,
bool aEncrypt,
mozilla::ipc::UnixSocketConsumer* aConsumer);
mozilla::ipc::UnixSocketConsumer* aConsumer) MOZ_OVERRIDE;
virtual nsresult
GetServiceChannel(const nsAString& aDeviceAddress,
const nsAString& aServiceUuid,
BluetoothProfileManagerBase* aManager);
BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;
virtual bool
UpdateSdpRecords(const nsAString& aDeviceAddress,
BluetoothProfileManagerBase* aManager);
BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;
virtual nsresult
CreatePairedDeviceInternal(const nsAString& aDeviceAddress,
int aTimeout,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual nsresult
RemoveDeviceInternal(const nsAString& aDeviceObjectPath,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual bool
SetPinCodeInternal(const nsAString& aDeviceAddress, const nsAString& aPinCode,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual bool
SetPasskeyInternal(const nsAString& aDeviceAddress, uint32_t aPasskey,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual bool
SetPairingConfirmationInternal(const nsAString& aDeviceAddress, bool aConfirm,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual bool
SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual nsresult
PrepareAdapterInternal();
PrepareAdapterInternal() MOZ_OVERRIDE;
virtual void
Connect(const nsAString& aDeviceAddress,
@ -127,7 +128,7 @@ public:
BluetoothReplyRunnable* aRunnable);
virtual bool
IsConnected(uint16_t aProfileId);
IsConnected(uint16_t aProfileId) MOZ_OVERRIDE;
virtual void
Disconnect(const uint16_t aProfileId, BluetoothReplyRunnable* aRunnable);
@ -136,24 +137,24 @@ public:
SendFile(const nsAString& aDeviceAddress,
BlobParent* aBlobParent,
BlobChild* aBlobChild,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual void
StopSendingFile(const nsAString& aDeviceAddress,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual void
ConfirmReceivingFile(const nsAString& aDeviceAddress, bool aConfirm,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual void
ConnectSco(BluetoothReplyRunnable* aRunnable);
ConnectSco(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual void
DisconnectSco(BluetoothReplyRunnable* aRunnable);
DisconnectSco(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual void
IsScoConnected(BluetoothReplyRunnable* aRunnable);
IsScoConnected(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
private:
nsresult SendGetPropertyMessage(const nsAString& aPath,

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

@ -372,10 +372,13 @@ const ContentPanning = {
let isScrolling = false;
let oldX, oldY, newX, newY;
let win, doc, htmlNode, bodyNode;
let xScrollable = content.scrollWidth > content.clientWidth;
let yScrollable = content.scrollHeight > content.clientHeight;
let xScrollable;
let yScrollable;
function doScroll(node, delta) {
// recalculate scrolling direction
xScrollable = node.scrollWidth > node.clientWidth;
yScrollable = node.scrollHeight > node.clientHeight;
if (node instanceof Ci.nsIDOMHTMLElement) {
newX = oldX = node.scrollLeft, newY = oldY = node.scrollTop;
if (xScrollable) {

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

@ -5,6 +5,7 @@
#ifndef DOM_CAMERA_CAMERACONTROLIMPL_H
#define DOM_CAMERA_CAMERACONTROLIMPL_H
#include "mozilla/Attributes.h"
#include "nsDOMFile.h"
#include "nsProxyRelease.h"
#include "DictionaryHelpers.h"
@ -165,7 +166,7 @@ public:
, mWindowId(aWindowId)
{ }
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
@ -202,7 +203,7 @@ public:
}
// Run() method is implementation specific.
NS_IMETHOD Run();
NS_IMETHOD Run() MOZ_OVERRIDE;
protected:
nsRefPtr<CameraControlImpl> mCameraControl;
@ -231,7 +232,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
nsresult rv = mCameraControl->GetPreviewStreamImpl(this);
@ -261,7 +262,7 @@ public:
virtual ~AutoFocusResult() { }
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
@ -295,7 +296,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
nsresult rv = mCameraControl->AutoFocusImpl(this);
@ -334,7 +335,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
@ -380,7 +381,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
nsresult rv = mCameraControl->TakePictureImpl(this);
@ -416,7 +417,7 @@ public:
virtual ~StartRecordingResult() { }
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
@ -452,7 +453,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
nsresult rv = mCameraControl->StartRecordingImpl(this);
@ -496,7 +497,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
nsresult rv = mCameraControl->StopRecordingImpl(this);
@ -525,7 +526,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
nsresult rv = mCameraControl->StartPreviewImpl(this);
@ -554,7 +555,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
mCameraControl->StopPreviewImpl(this);
@ -577,7 +578,7 @@ public:
, mOnErrorCb(new nsMainThreadPtrHolder<nsICameraErrorCallback>(onError))
{ }
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGI("%s:%d -- BEFORE IMPL\n", __func__, __LINE__);
nsresult rv = mCameraControl->GetPreviewStreamVideoModeImpl(this);
@ -613,7 +614,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
@ -645,7 +646,7 @@ public:
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
nsresult rv = mCameraControl->ReleaseHardwareImpl(this);
@ -676,7 +677,7 @@ public:
, mWindowId(aWindowId)
{ }
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());

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

@ -81,7 +81,7 @@ public:
, mCameraThread(aCameraThread)
{ }
NS_IMETHOD Run();
NS_IMETHOD Run() MOZ_OVERRIDE;
protected:
uint32_t mCameraId;

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

@ -6,6 +6,7 @@
#ifndef mozilla_dom_devicestorage_DeviceStorageRequestParent_h
#define mozilla_dom_devicestorage_DeviceStorageRequestParent_h
#include "mozilla/Attributes.h"
#include "mozilla/dom/devicestorage/PDeviceStorageRequestParent.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"
@ -50,7 +51,7 @@ private:
virtual ~CancelableRunnable() {
}
NS_IMETHOD Run() {
NS_IMETHOD Run() MOZ_OVERRIDE {
nsresult rv = NS_OK;
if (!mCanceled) {
rv = CancelableRun();

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

@ -6,6 +6,7 @@
#define nsDeviceStorage_h
class nsPIDOMWindow;
#include "mozilla/Attributes.h"
#include "PCOMContentPermissionRequestChild.h"
#include "DOMRequest.h"
@ -72,7 +73,7 @@ public:
~InvalidateRunnable() {}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
mozilla::RefPtr<DeviceStorageUsedSpaceCache::CacheEntry> cacheEntry;
cacheEntry = mCache->GetCacheEntry(mStorageName);
@ -169,7 +170,7 @@ public:
~ContinueCursorEvent();
void Continue();
NS_IMETHOD Run();
NS_IMETHOD Run() MOZ_OVERRIDE;
private:
already_AddRefed<DeviceStorageFile> GetNextFile();
nsRefPtr<mozilla::dom::DOMRequest> mRequest;
@ -199,12 +200,12 @@ public:
bool mOkToCallContinue;
PRTime mSince;
virtual bool Recv__delete__(const bool& allow);
virtual void IPDLRelease();
virtual bool Recv__delete__(const bool& allow) MOZ_OVERRIDE;
virtual void IPDLRelease() MOZ_OVERRIDE;
void GetStorageType(nsAString & aType);
void RequestComplete();
void RequestComplete() MOZ_OVERRIDE;
private:
~nsDOMDeviceStorageCursor();

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_domarchiverequest_h__
#define mozilla_dom_file_domarchiverequest_h__
#include "mozilla/Attributes.h"
#include "ArchiveReader.h"
#include "DOMRequest.h"
@ -40,7 +41,7 @@ public:
ArchiveReader* aReader);
// nsIDOMEventTarget
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
public:
// This is called by the DOMArchiveRequestEvent

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_domarchivezipevent_h__
#define mozilla_dom_file_domarchivezipevent_h__
#include "mozilla/Attributes.h"
#include "ArchiveEvent.h"
#include "FileCommon.h"
@ -27,10 +28,10 @@ public:
const nsAString& aEncoding);
virtual ~ArchiveZipItem();
nsresult GetFilename(nsString& aFilename);
nsresult GetFilename(nsString& aFilename) MOZ_OVERRIDE;
// From zipItem to DOMFile:
virtual nsIDOMFile* File(ArchiveReader* aArchiveReader);
virtual nsIDOMFile* File(ArchiveReader* aArchiveReader) MOZ_OVERRIDE;
public: // for the event
static uint32_t StrToInt32(const uint8_t* aStr);
@ -57,7 +58,7 @@ public:
ArchiveReaderZipEvent(ArchiveReader* aArchiveReader,
const nsAString& aEncoding);
nsresult Exec();
nsresult Exec() MOZ_OVERRIDE;
private:
nsString mEncoding;

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_domarchivefile_h__
#define mozilla_dom_file_domarchivefile_h__
#include "mozilla/Attributes.h"
#include "nsDOMFile.h"
#include "ArchiveReader.h"
@ -57,7 +58,7 @@ public:
}
// Overrides:
NS_IMETHOD GetInternalStream(nsIInputStream**);
NS_IMETHOD GetInternalStream(nsIInputStream**) MOZ_OVERRIDE;
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ArchiveZipFile, nsDOMFileCC)
@ -65,7 +66,7 @@ public:
protected:
virtual already_AddRefed<nsIDOMBlob> CreateSlice(uint64_t aStart,
uint64_t aLength,
const nsAString& aContentType);
const nsAString& aContentType) MOZ_OVERRIDE;
private: // Data
ZipCentral mCentral;

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_domfilehandle_h__
#define mozilla_dom_file_domfilehandle_h__
#include "mozilla/Attributes.h"
#include "FileCommon.h"
#include "FileHandle.h"
@ -22,10 +23,10 @@ public:
nsIFile* aFile);
virtual already_AddRefed<nsISupports>
CreateStream(nsIFile* aFile, bool aReadOnly);
CreateStream(nsIFile* aFile, bool aReadOnly) MOZ_OVERRIDE;
virtual already_AddRefed<nsIDOMFile>
CreateFileObject(LockedFile* aLockedFile, uint32_t aFileSize);
CreateFileObject(LockedFile* aLockedFile, uint32_t aFileSize) MOZ_OVERRIDE;
protected:
DOMFileHandle()

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_file_h__
#define mozilla_dom_file_file_h__
#include "mozilla/Attributes.h"
#include "FileCommon.h"
#include "nsDOMFile.h"
@ -48,10 +49,10 @@ public:
// Overrides
NS_IMETHOD
GetMozFullPathInternal(nsAString& aFullPath);
GetMozFullPathInternal(nsAString& aFullPath) MOZ_OVERRIDE;
NS_IMETHOD
GetInternalStream(nsIInputStream** aStream);
GetInternalStream(nsIInputStream** aStream) MOZ_OVERRIDE;
protected:
// Create slice
@ -63,22 +64,22 @@ protected:
virtual already_AddRefed<nsIDOMBlob>
CreateSlice(uint64_t aStart, uint64_t aLength,
const nsAString& aContentType);
const nsAString& aContentType) MOZ_OVERRIDE;
virtual bool
IsStoredFile() const
IsStoredFile() const MOZ_OVERRIDE
{
return mStoredFile;
}
virtual bool
IsWholeFile() const
IsWholeFile() const MOZ_OVERRIDE
{
return mWholeFile;
}
virtual bool
IsSnapshot() const
IsSnapshot() const MOZ_OVERRIDE
{
return true;
}

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_filerequest_h__
#define mozilla_dom_file_filerequest_h__
#include "mozilla/Attributes.h"
#include "FileCommon.h"
#include "DOMRequest.h"
@ -27,7 +28,7 @@ public:
// nsIDOMEventTarget
virtual nsresult
PreHandleEvent(nsEventChainPreVisitor& aVisitor);
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
void
OnProgress(uint64_t aProgress, uint64_t aProgressMax)

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

@ -70,16 +70,16 @@ private:
public:
NS_IMETHOD_(nsrefcnt)
AddRef();
AddRef() MOZ_OVERRIDE;
NS_IMETHOD_(nsrefcnt)
Release();
Release() MOZ_OVERRIDE;
inline nsresult
Enqueue(FileHelper* aFileHelper);
virtual void
OnFileHelperComplete(FileHelper* aFileHelper);
OnFileHelperComplete(FileHelper* aFileHelper) MOZ_OVERRIDE;
private:
inline

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_lockedfile_h__
#define mozilla_dom_file_lockedfile_h__
#include "mozilla/Attributes.h"
#include "FileCommon.h"
#include "nsIDOMLockedFile.h"
@ -65,7 +66,7 @@ public:
// nsIDOMEventTarget
virtual nsresult
PreHandleEvent(nsEventChainPreVisitor& aVisitor);
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
nsresult
CreateParallelStream(nsISupports** aStream);

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_file_metadatahelper_h__
#define mozilla_dom_file_metadatahelper_h__
#include "mozilla/Attributes.h"
#include "FileCommon.h"
#include "nsIFileStreams.h"
@ -90,10 +91,10 @@ public:
{ }
nsresult
DoAsyncRun(nsISupports* aStream);
DoAsyncRun(nsISupports* aStream) MOZ_OVERRIDE;
nsresult
GetSuccessResult(JSContext* aCx, JS::Value* aVal);
GetSuccessResult(JSContext* aCx, JS::Value* aVal) MOZ_OVERRIDE;
protected:
class AsyncMetadataGetter : public AsyncHelper
@ -107,7 +108,7 @@ protected:
protected:
nsresult
DoStreamWork(nsISupports* aStream);
DoStreamWork(nsISupports* aStream) MOZ_OVERRIDE;
private:
nsRefPtr<MetadataParameters> mParams;

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

@ -15,6 +15,7 @@
#include "TransactionThreadPool.h"
USING_INDEXEDDB_NAMESPACE
using mozilla::dom::quota::AssertIsOnIOThread;
using mozilla::dom::quota::QuotaManager;
namespace {
@ -46,6 +47,8 @@ NS_IMPL_RELEASE(mozilla::dom::indexedDB::Client)
nsresult
Client::InitOrigin(const nsACString& aOrigin, UsageRunnable* aUsageRunnable)
{
AssertIsOnIOThread();
nsCOMPtr<nsIFile> directory;
nsresult rv = GetDirectory(aOrigin, getter_AddRefs(directory));
NS_ENSURE_SUCCESS(rv, rv);
@ -162,6 +165,7 @@ nsresult
Client::GetUsageForOrigin(const nsACString& aOrigin,
UsageRunnable* aUsageRunnable)
{
AssertIsOnIOThread();
NS_ASSERTION(aUsageRunnable, "Null pointer!");
nsCOMPtr<nsIFile> directory;
@ -174,9 +178,33 @@ Client::GetUsageForOrigin(const nsACString& aOrigin,
return NS_OK;
}
void
Client::OnOriginClearCompleted(const nsACString& aPattern)
{
AssertIsOnIOThread();
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
if (mgr) {
mgr->InvalidateFileManagersForPattern(aPattern);
}
}
void
Client::ReleaseIOThreadObjects()
{
AssertIsOnIOThread();
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
if (mgr) {
mgr->InvalidateAllFileManagers();
}
}
bool
Client::IsTransactionServiceActivated()
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
return !!TransactionThreadPool::Get();
}
@ -184,6 +212,7 @@ void
Client::WaitForStoragesToComplete(nsTArray<nsIOfflineStorage*>& aStorages,
nsIRunnable* aCallback)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(!aStorages.IsEmpty(), "No storages to wait on!");
NS_ASSERTION(aCallback, "Passed null callback!");
@ -206,6 +235,7 @@ Client::WaitForStoragesToComplete(nsTArray<nsIOfflineStorage*>& aStorages,
void
Client::AbortTransactionsForStorage(nsIOfflineStorage* aStorage)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(aStorage, "Passed null storage!");
TransactionThreadPool* pool = TransactionThreadPool::Get();
@ -220,6 +250,8 @@ Client::AbortTransactionsForStorage(nsIOfflineStorage* aStorage)
bool
Client::HasTransactionsForStorage(nsIOfflineStorage* aStorage)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
TransactionThreadPool* pool = TransactionThreadPool::Get();
NS_ASSERTION(pool, "Should have checked if transaction service is active!");
@ -229,28 +261,12 @@ Client::HasTransactionsForStorage(nsIOfflineStorage* aStorage)
return pool->HasTransactionsForDatabase(database);
}
void
Client::OnOriginClearCompleted(const nsACString& aPattern)
{
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
if (mgr) {
mgr->InvalidateFileManagersForPattern(aPattern);
}
}
void
Client::ShutdownTransactionService()
{
TransactionThreadPool::Shutdown();
}
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
void
Client::OnShutdownCompleted()
{
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
if (mgr) {
mgr->InvalidateAllFileManagers();
}
TransactionThreadPool::Shutdown();
}
nsresult

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

@ -41,6 +41,12 @@ public:
GetUsageForOrigin(const nsACString& aOrigin,
UsageRunnable* aUsageRunnable) MOZ_OVERRIDE;
virtual void
OnOriginClearCompleted(const nsACString& aPattern) MOZ_OVERRIDE;
virtual void
ReleaseIOThreadObjects() MOZ_OVERRIDE;
virtual bool
IsFileServiceUtilized() MOZ_OVERRIDE
{
@ -60,15 +66,9 @@ public:
virtual bool
HasTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE;
virtual void
OnOriginClearCompleted(const nsACString& aPattern) MOZ_OVERRIDE;
virtual void
ShutdownTransactionService() MOZ_OVERRIDE;
virtual void
OnShutdownCompleted() MOZ_OVERRIDE;
private:
nsresult
GetDirectory(const nsACString& aOrigin, nsIFile** aDirectory);

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

@ -73,6 +73,7 @@ FileInfo::UpdateReferences(nsAutoRefCnt& aRefCount, int32_t aDelta,
return;
}
bool needsCleanup;
{
MutexAutoLock lock(IndexedDatabaseManager::FileMutex());
@ -83,9 +84,13 @@ FileInfo::UpdateReferences(nsAutoRefCnt& aRefCount, int32_t aDelta,
}
mFileManager->mFileInfos.Remove(Id());
needsCleanup = !mFileManager->Invalidated();
}
Cleanup();
if (needsCleanup) {
Cleanup();
}
delete this;
}
@ -93,8 +98,9 @@ FileInfo::UpdateReferences(nsAutoRefCnt& aRefCount, int32_t aDelta,
void
FileInfo::Cleanup()
{
if (quota::QuotaManager::IsShuttingDown() ||
mFileManager->Invalidated()) {
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
if (quota::QuotaManager::IsShuttingDown()) {
return;
}

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

@ -27,11 +27,7 @@ public:
{ }
virtual ~FileInfo()
{
#ifdef DEBUG
NS_ASSERTION(NS_IsMainThread(), "File info destroyed on wrong thread!");
#endif
}
{ }
static
FileInfo* Create(FileManager* aFileManager, int64_t aId);

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

@ -24,6 +24,7 @@
#include <algorithm>
USING_INDEXEDDB_NAMESPACE
using mozilla::dom::quota::AssertIsOnIOThread;
namespace {
@ -62,7 +63,7 @@ nsresult
FileManager::Init(nsIFile* aDirectory,
mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(aDirectory, "Null directory!");
NS_ASSERTION(aConnection, "Null connection!");
@ -269,7 +270,7 @@ FileManager::InitDirectory(nsIFile* aDirectory,
nsIFile* aDatabaseFile,
const nsACString& aOrigin)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(aDirectory, "Null directory!");
NS_ASSERTION(aDatabaseFile, "Null database file!");
@ -385,7 +386,7 @@ FileManager::InitDirectory(nsIFile* aDirectory,
nsresult
FileManager::GetUsage(nsIFile* aDirectory, uint64_t* aUsage)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
bool exists;
nsresult rv = aDirectory->Exists(&exists);

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

@ -40,6 +40,7 @@
USING_INDEXEDDB_NAMESPACE
using mozilla::dom::ContentParent;
using mozilla::dom::quota::AssertIsOnIOThread;
using mozilla::dom::quota::Client;
using mozilla::dom::quota::QuotaManager;
using namespace mozilla::dom;
@ -975,7 +976,7 @@ DeleteObjectStoreHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
nsresult
CreateFileHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "CreateFileHelper::DoDatabaseWork");

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_indexeddb_idbdatabase_h__
#define mozilla_dom_indexeddb_idbdatabase_h__
#include "mozilla/Attributes.h"
#include "mozilla/dom/indexedDB/IndexedDatabase.h"
#include "nsIDocument.h"
@ -79,7 +80,7 @@ public:
}
// nsIDOMEventTarget
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
DatabaseInfo* Info() const
{

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

@ -334,7 +334,7 @@ IDBFactory::LoadDatabaseInformation(mozIStorageConnection* aConnection,
uint64_t* aVersion,
ObjectStoreInfoArray& aObjectStores)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(aConnection, "Null pointer!");
aObjectStores.Clear();

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_indexeddb_idbrequest_h__
#define mozilla_dom_indexeddb_idbrequest_h__
#include "mozilla/Attributes.h"
#include "mozilla/dom/indexedDB/IndexedDatabase.h"
#include "nsIIDBRequest.h"
@ -41,7 +42,7 @@ public:
JSContext* aCallingCx);
// nsIDOMEventTarget
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
nsISupports* Source()
{
@ -139,7 +140,7 @@ public:
void SetTransaction(IDBTransaction* aTransaction);
// nsIDOMEventTarget
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
DOMError* GetError(ErrorResult& aRv)
{

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_indexeddb_idbtransaction_h__
#define mozilla_dom_indexeddb_idbtransaction_h__
#include "mozilla/Attributes.h"
#include "mozilla/dom/indexedDB/IndexedDatabase.h"
#include "mozIStorageConnection.h"
@ -98,7 +99,7 @@ public:
}
// nsIDOMEventTarget
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
void OnNewRequest();
void OnRequestFinished();

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

@ -15,6 +15,7 @@
#include "nsIScriptError.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/CondVar.h"
#include "mozilla/dom/quota/QuotaManager.h"
#include "mozilla/dom/quota/Utilities.h"
#include "mozilla/dom/TabContext.h"
@ -60,13 +61,52 @@ private:
int64_t mFileId;
};
class GetFileReferencesHelper MOZ_FINAL : public nsIRunnable
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIRUNNABLE
GetFileReferencesHelper(const nsACString& aOrigin,
const nsAString& aDatabaseName,
int64_t aFileId)
: mOrigin(aOrigin), mDatabaseName(aDatabaseName), mFileId(aFileId),
mMutex(IndexedDatabaseManager::FileMutex()),
mCondVar(mMutex, "GetFileReferencesHelper::mCondVar"),
mMemRefCnt(-1),
mDBRefCnt(-1),
mSliceRefCnt(-1),
mResult(false),
mWaiting(true)
{ }
nsresult
DispatchAndReturnFileReferences(int32_t* aMemRefCnt,
int32_t* aDBRefCnt,
int32_t* aSliceRefCnt,
bool* aResult);
private:
nsCString mOrigin;
nsString mDatabaseName;
int64_t mFileId;
mozilla::Mutex& mMutex;
mozilla::CondVar mCondVar;
int32_t mMemRefCnt;
int32_t mDBRefCnt;
int32_t mSliceRefCnt;
bool mResult;
bool mWaiting;
};
PLDHashOperator
InvalidateAndRemoveFileManagers(
const nsACString& aKey,
nsAutoPtr<nsTArray<nsRefPtr<FileManager> > >& aValue,
void* aUserArg)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(!aKey.IsEmpty(), "Empty key!");
NS_ASSERTION(aValue, "Null pointer!");
@ -347,6 +387,8 @@ already_AddRefed<FileManager>
IndexedDatabaseManager::GetFileManager(const nsACString& aOrigin,
const nsAString& aDatabaseName)
{
AssertIsOnIOThread();
nsTArray<nsRefPtr<FileManager> >* array;
if (!mFileManagers.Get(aOrigin, &array)) {
return nullptr;
@ -367,6 +409,7 @@ IndexedDatabaseManager::GetFileManager(const nsACString& aOrigin,
void
IndexedDatabaseManager::AddFileManager(FileManager* aFileManager)
{
AssertIsOnIOThread();
NS_ASSERTION(aFileManager, "Null file manager!");
nsTArray<nsRefPtr<FileManager> >* array;
@ -381,6 +424,8 @@ IndexedDatabaseManager::AddFileManager(FileManager* aFileManager)
void
IndexedDatabaseManager::InvalidateAllFileManagers()
{
AssertIsOnIOThread();
mFileManagers.Enumerate(InvalidateAndRemoveFileManagers, nullptr);
}
@ -388,7 +433,9 @@ void
IndexedDatabaseManager::InvalidateFileManagersForPattern(
const nsACString& aPattern)
{
AssertIsOnIOThread();
NS_ASSERTION(!aPattern.IsEmpty(), "Empty pattern!");
mFileManagers.Enumerate(InvalidateAndRemoveFileManagers,
const_cast<nsACString*>(&aPattern));
}
@ -397,6 +444,8 @@ void
IndexedDatabaseManager::InvalidateFileManager(const nsACString& aOrigin,
const nsAString& aDatabaseName)
{
AssertIsOnIOThread();
nsTArray<nsRefPtr<FileManager> >* array;
if (!mFileManagers.Get(aOrigin, &array)) {
return;
@ -444,6 +493,26 @@ IndexedDatabaseManager::AsyncDeleteFile(FileManager* aFileManager,
return NS_OK;
}
nsresult
IndexedDatabaseManager::BlockAndGetFileReferences(
const nsACString& aOrigin,
const nsAString& aDatabaseName,
int64_t aFileId,
int32_t* aRefCnt,
int32_t* aDBRefCnt,
int32_t* aSliceRefCnt,
bool* aResult)
{
nsRefPtr<GetFileReferencesHelper> helper =
new GetFileReferencesHelper(aOrigin, aDatabaseName, aFileId);
nsresult rv = helper->DispatchAndReturnFileReferences(aRefCnt, aDBRefCnt,
aSliceRefCnt, aResult);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
NS_IMPL_ADDREF(IndexedDatabaseManager)
NS_IMPL_RELEASE_WITH_DESTROY(IndexedDatabaseManager, Destroy())
NS_IMPL_QUERY_INTERFACE2(IndexedDatabaseManager, nsIIndexedDatabaseManager,
@ -548,7 +617,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncDeleteFileRunnable,
NS_IMETHODIMP
AsyncDeleteFileRunnable::Run()
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
nsCOMPtr<nsIFile> directory = mFileManager->GetDirectory();
NS_ENSURE_TRUE(directory, NS_ERROR_FAILURE);
@ -585,3 +654,69 @@ AsyncDeleteFileRunnable::Run()
return NS_OK;
}
nsresult
GetFileReferencesHelper::DispatchAndReturnFileReferences(int32_t* aMemRefCnt,
int32_t* aDBRefCnt,
int32_t* aSliceRefCnt,
bool* aResult)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
QuotaManager* quotaManager = QuotaManager::Get();
NS_ASSERTION(quotaManager, "Shouldn't be null!");
nsresult rv =
quotaManager->IOThread()->Dispatch(this, NS_DISPATCH_NORMAL);
NS_ENSURE_SUCCESS(rv, rv);
mozilla::MutexAutoLock autolock(mMutex);
while (mWaiting) {
mCondVar.Wait();
}
*aMemRefCnt = mMemRefCnt;
*aDBRefCnt = mDBRefCnt;
*aSliceRefCnt = mSliceRefCnt;
*aResult = mResult;
return NS_OK;
}
NS_IMPL_THREADSAFE_ISUPPORTS1(GetFileReferencesHelper,
nsIRunnable)
NS_IMETHODIMP
GetFileReferencesHelper::Run()
{
AssertIsOnIOThread();
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
NS_ASSERTION(mgr, "This should never fail!");
nsRefPtr<FileManager> fileManager =
mgr->GetFileManager(mOrigin, mDatabaseName);
if (fileManager) {
nsRefPtr<FileInfo> fileInfo = fileManager->GetFileInfo(mFileId);
if (fileInfo) {
fileInfo->GetReferences(&mMemRefCnt, &mDBRefCnt, &mSliceRefCnt);
if (mMemRefCnt != -1) {
// We added an extra temp ref, so account for that accordingly.
mMemRefCnt--;
}
mResult = true;
}
}
mozilla::MutexAutoLock lock(mMutex);
NS_ASSERTION(mWaiting, "Huh?!");
mWaiting = false;
mCondVar.Notify();
return NS_OK;
}

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

@ -96,6 +96,18 @@ public:
AsyncDeleteFile(FileManager* aFileManager,
int64_t aFileId);
// Don't call this method in real code, it blocks the main thread!
// It is intended to be used by mochitests to test correctness of the special
// reference counting of stored blobs/files.
nsresult
BlockAndGetFileReferences(const nsACString& aOrigin,
const nsAString& aDatabaseName,
int64_t aFileId,
int32_t* aRefCnt,
int32_t* aDBRefCnt,
int32_t* aSliceRefCnt,
bool* aResult);
static mozilla::Mutex&
FileMutex()
{

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

@ -96,7 +96,7 @@ GetDatabaseFilename(const nsAString& aName,
nsresult
CreateFileTables(mozIStorageConnection* aDBConn)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "CreateFileTables");
@ -158,7 +158,7 @@ CreateFileTables(mozIStorageConnection* aDBConn)
nsresult
CreateTables(mozIStorageConnection* aDBConn)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
NS_ASSERTION(aDBConn, "Passing a null database connection!");
@ -275,7 +275,7 @@ CreateTables(mozIStorageConnection* aDBConn)
nsresult
UpgradeSchemaFrom4To5(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom4To5");
@ -364,7 +364,7 @@ UpgradeSchemaFrom4To5(mozIStorageConnection* aConnection)
nsresult
UpgradeSchemaFrom5To6(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom5To6");
@ -722,7 +722,7 @@ UpgradeSchemaFrom5To6(mozIStorageConnection* aConnection)
nsresult
UpgradeSchemaFrom6To7(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom6To7");
@ -781,7 +781,7 @@ UpgradeSchemaFrom6To7(mozIStorageConnection* aConnection)
nsresult
UpgradeSchemaFrom7To8(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom7To8");
@ -905,7 +905,7 @@ NS_IMPL_ISUPPORTS1(CompressDataBlobsFunction, mozIStorageFunction)
nsresult
UpgradeSchemaFrom8To9_0(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom8To9_0");
@ -946,7 +946,7 @@ UpgradeSchemaFrom8To9_0(mozIStorageConnection* aConnection)
nsresult
UpgradeSchemaFrom9_0To10_0(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom9_0To10_0");
@ -973,7 +973,7 @@ UpgradeSchemaFrom9_0To10_0(mozIStorageConnection* aConnection)
nsresult
UpgradeSchemaFrom10_0To11_0(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom10_0To11_0");
@ -1163,7 +1163,7 @@ NS_IMPL_ISUPPORTS1(EncodeKeysFunction, mozIStorageFunction)
nsresult
UpgradeSchemaFrom11_0To12_0(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom11_0To12_0");
@ -1380,7 +1380,7 @@ nsresult
UpgradeSchemaFrom12_0To13_0(mozIStorageConnection* aConnection,
bool* aVacuumNeeded)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "UpgradeSchemaFrom12_0To13_0");
@ -1717,15 +1717,7 @@ OpenDatabaseHelper::RunImmediately()
nsresult
OpenDatabaseHelper::DoDatabaseWork()
{
#ifdef DEBUG
{
bool correctThread;
NS_ASSERTION(NS_SUCCEEDED(QuotaManager::Get()->IOThread()->
IsOnCurrentThread(&correctThread)) &&
correctThread,
"Running on the wrong thread!");
}
#endif
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "OpenDatabaseHelper::DoDatabaseWork");
@ -1871,7 +1863,7 @@ OpenDatabaseHelper::CreateDatabaseConnection(
const nsACString& aOrigin,
mozIStorageConnection** aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
PROFILER_LABEL("IndexedDB", "OpenDatabaseHelper::CreateDatabaseConnection");
@ -2172,11 +2164,6 @@ OpenDatabaseHelper::Run()
DatabaseInfo::Remove(mDatabaseId);
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
NS_ASSERTION(mgr, "This should never fail!");
mgr->InvalidateFileManager(mASCIIOrigin, mName);
mState = eFiringEvents;
break;
}
@ -2579,7 +2566,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(DeleteDatabaseHelper, AsyncConnectionHelper);
nsresult
DeleteDatabaseHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
{
NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
AssertIsOnIOThread();
NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
NS_ASSERTION(!aConnection, "How did we get a connection here?");
@ -2683,6 +2670,11 @@ DeleteDatabaseHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
}
}
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
NS_ASSERTION(mgr, "This should never fail!");
mgr->InvalidateFileManager(mASCIIOrigin, mName);
return NS_OK;
}

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

@ -97,7 +97,7 @@ public:
}
NS_IMETHOD
HandleEvent(nsIDOMEvent* aEvent)
HandleEvent(nsIDOMEvent* aEvent) MOZ_OVERRIDE
{
return mActor ? mActor->HandleEvent(aEvent) : NS_OK;
}

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

@ -25,6 +25,7 @@ XPIDL_SOURCES += [
'nsIDOMEvent.idl',
'nsIDOMEventListener.idl',
'nsIDOMEventTarget.idl',
'nsIDOMFocusEvent.idl',
'nsIDOMGamepadAxisMoveEvent.idl',
'nsIDOMGamepadButtonEvent.idl',
'nsIDOMGamepadEvent.idl',

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

@ -280,6 +280,11 @@ NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
nsPresContext* aPresContext,
class nsInputEvent* aEvent);
nsresult
NS_NewDOMFocusEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
class nsFocusEvent* aEvent);
nsresult
NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,

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

@ -0,0 +1,12 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMUIEvent.idl"
[scriptable, builtinclass, uuid(4faecbd6-1bcd-42d8-bc66-ec6b95050063)]
interface nsIDOMFocusEvent : nsIDOMUIEvent
{
readonly attribute nsIDOMEventTarget relatedTarget;
};

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

@ -111,10 +111,10 @@ public:
* MessageManagerCallback methods that we override.
*/
virtual bool DoSendAsyncMessage(const nsAString& aMessage,
const mozilla::dom::StructuredCloneData& aData);
virtual bool CheckPermission(const nsAString& aPermission);
virtual bool CheckManifestURL(const nsAString& aManifestURL);
virtual bool CheckAppHasPermission(const nsAString& aPermission);
const mozilla::dom::StructuredCloneData& aData) MOZ_OVERRIDE;
virtual bool CheckPermission(const nsAString& aPermission) MOZ_OVERRIDE;
virtual bool CheckManifestURL(const nsAString& aManifestURL) MOZ_OVERRIDE;
virtual bool CheckAppHasPermission(const nsAString& aPermission) MOZ_OVERRIDE;
/** Notify that a tab is beginning its destruction sequence. */
void NotifyTabDestroying(PBrowserParent* aTab);
@ -167,7 +167,7 @@ public:
void FriendlyName(nsAString& aName);
protected:
void OnChannelConnected(int32_t pid);
void OnChannelConnected(int32_t pid) MOZ_OVERRIDE;
virtual void ActorDestroy(ActorDestroyReason why);
private:

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

@ -91,17 +91,17 @@ public:
? mMessageManager->SendSyncMessage(aMessageName, aObject, aCx, aArgc, aRetval)
: NS_ERROR_NULL_POINTER;
}
NS_IMETHOD GetContent(nsIDOMWindow** aContent);
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell);
NS_IMETHOD Dump(const nsAString& aStr)
NS_IMETHOD GetContent(nsIDOMWindow** aContent) MOZ_OVERRIDE;
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell) MOZ_OVERRIDE;
NS_IMETHOD Dump(const nsAString& aStr) MOZ_OVERRIDE
{
return mMessageManager ? mMessageManager->Dump(aStr) : NS_OK;
}
NS_IMETHOD PrivateNoteIntentionalCrash();
NS_IMETHOD PrivateNoteIntentionalCrash() MOZ_OVERRIDE;
NS_IMETHOD Btoa(const nsAString& aBinaryData,
nsAString& aAsciiBase64String);
nsAString& aAsciiBase64String) MOZ_OVERRIDE;
NS_IMETHOD Atob(const nsAString& aAsciiString,
nsAString& aBinaryData);
nsAString& aBinaryData) MOZ_OVERRIDE;
NS_IMETHOD AddEventListener(const nsAString& aType,
nsIDOMEventListener* aListener,
@ -115,7 +115,7 @@ public:
NS_IMETHOD AddEventListener(const nsAString& aType,
nsIDOMEventListener* aListener,
bool aUseCapture, bool aWantsUntrusted,
uint8_t optional_argc)
uint8_t optional_argc) MOZ_OVERRIDE
{
return nsDOMEventTargetHelper::AddEventListener(aType, aListener,
aUseCapture,
@ -123,8 +123,8 @@ public:
optional_argc);
}
virtual JSContext* GetJSContextForEventHandlers();
virtual nsIPrincipal* GetPrincipal();
virtual JSContext* GetJSContextForEventHandlers() MOZ_OVERRIDE;
virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE;
nsCOMPtr<nsIContentFrameMessageManager> mMessageManager;
TabChild* mTabChild;

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

@ -212,7 +212,7 @@ class GetUserMediaNotificationEvent: public nsRunnable
}
NS_IMETHOD
Run()
Run() MOZ_OVERRIDE
{
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
// Make sure mStream is cleared and our reference to the DOMMediaStream
@ -291,7 +291,7 @@ public:
}
NS_IMETHOD
Run()
Run() MOZ_OVERRIDE
{
SourceMediaStream *source = mListener->GetSourceStream();
// No locking between these is required as all the callbacks for the

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

@ -7,6 +7,7 @@
#ifndef nsPluginInstanceOwner_h_
#define nsPluginInstanceOwner_h_
#include "mozilla/Attributes.h"
#include "npapi.h"
#include "nsCOMPtr.h"
#include "nsIPluginInstanceOwner.h"
@ -60,19 +61,19 @@ public:
NS_IMETHOD GetURL(const char *aURL, const char *aTarget,
nsIInputStream *aPostStream,
void *aHeadersData, uint32_t aHeadersDataLen);
void *aHeadersData, uint32_t aHeadersDataLen) MOZ_OVERRIDE;
NS_IMETHOD ShowStatus(const PRUnichar *aStatusMsg);
NS_IMETHOD ShowStatus(const PRUnichar *aStatusMsg) MOZ_OVERRIDE;
NPError ShowNativeContextMenu(NPMenu* menu, void* event);
NPError ShowNativeContextMenu(NPMenu* menu, void* event) MOZ_OVERRIDE;
NPBool ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
double *destX, double *destY, NPCoordinateSpace destSpace);
double *destX, double *destY, NPCoordinateSpace destSpace) MOZ_OVERRIDE;
virtual NPError InitAsyncSurface(NPSize *size, NPImageFormat format,
void *initData, NPAsyncSurface *surface);
virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface);
virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed);
void *initData, NPAsyncSurface *surface) MOZ_OVERRIDE;
virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface) MOZ_OVERRIDE;
virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed) MOZ_OVERRIDE;
//nsIPluginTagInfo interface
NS_DECL_NSIPLUGINTAGINFO

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

@ -6,6 +6,7 @@
#ifndef nsPluginTags_h_
#define nsPluginTags_h_
#include "mozilla/Attributes.h"
#include "nscore.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
@ -110,26 +111,26 @@ public:
virtual ~DOMMimeTypeImpl() {
}
NS_METHOD GetDescription(nsAString& aDescription)
NS_METHOD GetDescription(nsAString& aDescription) MOZ_OVERRIDE
{
aDescription.Assign(mDescription);
return NS_OK;
}
NS_METHOD GetEnabledPlugin(nsIDOMPlugin** aEnabledPlugin)
NS_METHOD GetEnabledPlugin(nsIDOMPlugin** aEnabledPlugin) MOZ_OVERRIDE
{
// this has to be implemented by the DOM version.
*aEnabledPlugin = nullptr;
return NS_OK;
}
NS_METHOD GetSuffixes(nsAString& aSuffixes)
NS_METHOD GetSuffixes(nsAString& aSuffixes) MOZ_OVERRIDE
{
aSuffixes.Assign(mSuffixes);
return NS_OK;
}
NS_METHOD GetType(nsAString& aType)
NS_METHOD GetType(nsAString& aType) MOZ_OVERRIDE
{
aType.Assign(mType);
return NS_OK;

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

@ -7,6 +7,7 @@
#ifndef dom_plugins_PluginProcessParent_h
#define dom_plugins_PluginProcessParent_h 1
#include "mozilla/Attributes.h"
#include "base/basictypes.h"
#include "base/file_path.h"
@ -35,7 +36,7 @@ public:
void Delete();
virtual bool CanShutdown()
virtual bool CanShutdown() MOZ_OVERRIDE
{
return true;
}

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

@ -68,6 +68,7 @@ public:
return NS_OK;
}
// Methods which are called on the IO thred.
virtual nsresult
InitOrigin(const nsACString& aOrigin, UsageRunnable* aUsageRunnable) = 0;
@ -75,6 +76,13 @@ public:
GetUsageForOrigin(const nsACString& aOrigin,
UsageRunnable* aUsageRunnable) = 0;
virtual void
OnOriginClearCompleted(const nsACString& aPattern) = 0;
virtual void
ReleaseIOThreadObjects() = 0;
// Methods which are called on the main thred.
virtual bool
IsFileServiceUtilized() = 0;
@ -91,15 +99,9 @@ public:
virtual bool
HasTransactionsForStorage(nsIOfflineStorage* aStorage) = 0;
virtual void
OnOriginClearCompleted(const nsACString& aPattern) = 0;
virtual void
ShutdownTransactionService() = 0;
virtual void
OnShutdownCompleted() = 0;
protected:
virtual ~Client()
{ }

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше