merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-01-20 15:34:34 +01:00
commit 94d175ba23
424 changed files with 3838 additions and 2583 deletions

View File

@ -22,4 +22,5 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 1228641 - Remove initializer_list from config/stl-headers
Bug 1240627 - Enable AVX2 optimizations in ffvpx on Mac

View File

@ -1075,7 +1075,8 @@ function traverse (node, cb) {
cb(node);
keys(node).map(key => {
if (key === 'parent' || !node[key]) return;
node[key].parent = node;
if (typeof node[key] === "object")
node[key].parent = node;
traverse(node[key], cb);
});
}

View File

@ -354,6 +354,7 @@ pref("browser.safebrowsing.malware.enabled", true);
pref("browser.safebrowsing.downloads.enabled", true);
pref("browser.safebrowsing.downloads.remote.enabled", true);
pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.debug", false);
pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
@ -364,7 +365,6 @@ pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.goo
pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.id", "Firefox");

View File

@ -952,6 +952,7 @@ pref("browser.safebrowsing.malware.enabled", true);
pref("browser.safebrowsing.downloads.enabled", true);
pref("browser.safebrowsing.downloads.remote.enabled", true);
pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.debug", false);
pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
@ -962,7 +963,6 @@ pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.goo
pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
#ifdef MOZILLA_OFFICIAL
// Normally the "client ID" sent in updates is appinfo.name, but for

View File

@ -231,7 +231,7 @@ define([MOZ_BUILD_BACKEND],
BUILD_BACKENDS="RecursiveMake"
MOZ_ARG_ENABLE_STRING(build-backend,
[ --enable-build-backend={AndroidEclipse,CppEclipse,VisualStudio,FasterMake,CompileDB}
[ --enable-build-backend={AndroidEclipse,CppEclipse,VisualStudio,FasterMake,CompileDB,ChromeMap}
Enable additional build backends],
[ BUILD_BACKENDS="RecursiveMake `echo $enableval | sed 's/,/ /g'`"])

View File

@ -55,15 +55,8 @@ file should be processed by the :ref:`preprocessor` before being packaged::
* path/in/jar/preprocessed.xul (source/tree/location/file_name.xul)
A plus marker (``+``) at the beginning of the line indicates that the file
should replace an existing file, even if the source file's timestamp isn't
newer than the existing file::
+ path/in/jar/file_name.xul (source/tree/location/my_file_name.xul)
Preprocessed files always replace existing files, to ensure that changes in
``#expand`` or ``#include`` directives are picked up, so ``+`` and ``*`` are
equivalent.
``#expand`` or ``#include`` directives are picked up.
There is a special source-directory format for localized files (note the
percent sign in the source file location): this format reads ``localized.dtd``

View File

@ -44,3 +44,6 @@ else:
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
if CONFIG['NSS_EXTRA_SYMBOLS_FILE']:
DEFINES['NSS_EXTRA_SYMBOLS_FILE'] = CONFIG['NSS_EXTRA_SYMBOLS_FILE']

View File

@ -123,3 +123,6 @@ $(TOPOBJDIR)/toolkit/xre/platform.ini: $(TOPOBJDIR)/config/buildid
# The xpidl target in config/makefiles/xpidl requires the install manifest for
# dist/idl to have been processed.
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(TOPOBJDIR)/install-dist_idl
# It also requires all the install manifests for dist/bin to have been processed
# because it adds interfaces.manifest references with buildlist.py.
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS)))

View File

@ -27,6 +27,7 @@ marker.label.consoleTime=Console
marker.label.garbageCollection2=Garbage Collection
marker.label.garbageCollection.incremental=Incremental GC
marker.label.garbageCollection.nonIncremental=Non-incremental GC
marker.label.minorGC=Minor GC
marker.label.cycleCollection=Cycle Collection
marker.label.cycleCollection.forgetSkippable=CC Graph Reduction
marker.label.timestamp=Timestamp
@ -125,6 +126,9 @@ marker.gcreason.label.FINISH_LARGE_EVALUATE=Large Eval
marker.gcreason.label.DOM_WINDOW_UTILS=User Inactive
marker.gcreason.label.USER_INACTIVE=User Inactive
# The name of a nursery collection.
marker.nurseryCollection=Nursery Collection
# LOCALIZATION NOTE (marker.gcreason.description.*):
# These strings are used to give an expanded description of why a GC occurred.
marker.gcreason.description.API=There was an API call to force garbage collection.

View File

@ -407,6 +407,15 @@ const Formatters = {
return fields;
},
MinorGCFields: function (marker) {
const cause = marker.causeName;
const label = L10N.getStr(`marker.gcreason.label.${cause}`) || cause;
return {
[L10N.getStr("marker.field.type")]: L10N.getStr("marker.nurseryCollection"),
[L10N.getStr("marker.field.causeName")]: label,
};
},
DOMEventFields: function (marker) {
let fields = Object.create(null);
if ("type" in marker) {

View File

@ -123,6 +123,12 @@ const TIMELINE_BLUEPRINT = {
label: Formatters.GCLabel,
fields: Formatters.GCFields,
},
"MinorGC": {
group: 1,
colorName: "graphs-red",
label: L10N.getStr("marker.label.minorGC"),
fields: Formatters.MinorGCFields,
},
"nsCycleCollector::Collect": {
group: 1,
colorName: "graphs-red",

View File

@ -54,6 +54,7 @@ skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still di
[browser_markers-docloading-02.js]
[browser_markers-docloading-03.js]
[browser_markers-gc.js]
[browser_markers-minor-gc.js]
[browser_markers-parse-html.js]
[browser_markers-styles.js]
[browser_markers-timestamp.js]

View File

@ -0,0 +1,32 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that we get "MinorGC" markers when we continue to steadily allocate
* objects.
*/
const { PerformanceFront } = require("devtools/server/actors/performance");
add_task(function*() {
// This test runs very slowly on linux32 debug EC2 instances.
requestLongerTimeout(2);
let doc = yield addTab(MAIN_DOMAIN + "doc_allocations.html");
initDebuggerServer();
let client = new DebuggerClient(DebuggerServer.connectPipe());
let form = yield connectDebuggerClient(client);
let front = PerformanceFront(client, form);
yield front.connect();
let rec = yield front.startRecording({ withMarkers: true });
let markers = yield waitForMarkerType(front, ["MinorGC"]);
yield front.stopRecording(rec);
ok(markers.some(m => m.name === "MinorGC" && m.causeName),
"got some MinorGC markers");
yield closeDebuggerClient(client);
gBrowser.removeCurrentTab();
});

View File

@ -5,10 +5,12 @@
</head>
<body>
<script>
window.allocs = [];
window.onload = function() {
var allocs = [];
function allocator() {
allocs.push(new Object);
for (var i = 0; i < 1000; i++) {
window.allocs.push(new Object);
}
}
window.setInterval(allocator, 1);

View File

@ -10984,9 +10984,15 @@ nsDocShell::DoChannelLoad(nsIChannel* aChannel,
break;
}
case LOAD_RELOAD_CHARSET_CHANGE:
loadFlags |= nsIRequest::LOAD_FROM_CACHE;
case LOAD_RELOAD_CHARSET_CHANGE: {
// Use SetAllowStaleCacheContent (not LOAD_FROM_CACHE flag) since we only want
// to force cache load for this channel, not the whole loadGroup.
nsCOMPtr<nsICacheInfoChannel> cachingChannel = do_QueryInterface(aChannel);
if (cachingChannel) {
cachingChannel->SetAllowStaleCacheContent(true);
}
break;
}
case LOAD_RELOAD_NORMAL:
case LOAD_REFRESH:

View File

@ -12,9 +12,9 @@ function rectangleContains(rect, x, y, width, height) {
}
function sanitizeMarkers(list) {
// Worker markers are currently gathered from all docshells, which may
// These markers are currently gathered from all docshells, which may
// interfere with this test.
return list.filter(e => e.name != "Worker")
return list.filter(e => e.name != "Worker" && e.name != "MinorGC");
}
var TESTS = [{

View File

@ -116,12 +116,6 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
nsContentPolicyType externalType =
nsContentUtils::InternalContentPolicyTypeToExternal(contentType);
nsContentPolicyType externalTypeOrMCBInternal =
nsContentUtils::InternalContentPolicyTypeToExternalOrMCBInternal(contentType);
nsContentPolicyType externalTypeOrCSPInternal =
nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(contentType);
nsCOMPtr<nsIContentPolicy> mixedContentBlocker =
do_GetService(NS_MIXEDCONTENTBLOCKER_CONTRACTID);
@ -138,27 +132,10 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
int32_t count = entries.Count();
for (int32_t i = 0; i < count; i++) {
/* check the appropriate policy */
// Send the internal content policy type to the mixed content blocker
// which needs to know about TYPE_INTERNAL_WORKER,
// TYPE_INTERNAL_SHARED_WORKER and TYPE_INTERNAL_SERVICE_WORKER
// and also preloads: TYPE_INTERNAL_SCRIPT_PRELOAD,
// TYPE_INTERNAL_IMAGE_PRELOAD, TYPE_INTERNAL_STYLESHEET_PRELOAD
bool isMixedContentBlocker = mixedContentBlocker == entries[i];
// Send internal content policy type to CSP and mixed content blocker
nsContentPolicyType type = externalType;
if (isMixedContentBlocker) {
type = externalTypeOrMCBInternal;
}
// Send the internal content policy type for CSP which needs to
// know about preloads and workers, in particular:
// * TYPE_INTERNAL_SCRIPT_PRELOAD
// * TYPE_INTERNAL_IMAGE_PRELOAD
// * TYPE_INTERNAL_STYLESHEET_PRELOAD
// * TYPE_INTERNAL_WORKER
// * TYPE_INTERNAL_SHARED_WORKER
// * TYPE_INTERNAL_SERVICE_WORKER
bool isCSP = cspService == entries[i];
if (isCSP) {
type = externalTypeOrCSPInternal;
if (mixedContentBlocker == entries[i] || cspService == entries[i]) {
type = contentType;
}
rv = (entries[i]->*policyMethod)(type, contentLocation,
requestingLocation, requestingContext,

View File

@ -8035,35 +8035,6 @@ nsContentUtils::InternalContentPolicyTypeToExternal(nsContentPolicyType aType)
}
}
/* static */
nsContentPolicyType
nsContentUtils::InternalContentPolicyTypeToExternalOrMCBInternal(nsContentPolicyType aType)
{
switch (aType) {
case nsIContentPolicy::TYPE_INTERNAL_SCRIPT:
case nsIContentPolicy::TYPE_INTERNAL_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER:
return aType;
default:
return InternalContentPolicyTypeToExternalOrPreload(aType);
}
}
/* static */
nsContentPolicyType
nsContentUtils::InternalContentPolicyTypeToExternalOrPreload(nsContentPolicyType aType)
{
if (aType == nsIContentPolicy::TYPE_INTERNAL_SCRIPT_PRELOAD ||
aType == nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD ||
aType == nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD) {
return aType;
}
return InternalContentPolicyTypeToExternal(aType);
}
/* static */
nsContentPolicyType
nsContentUtils::InternalContentPolicyTypeToExternalOrWorker(nsContentPolicyType aType)
@ -8091,17 +8062,6 @@ nsContentUtils::IsPreloadType(nsContentPolicyType aType)
return false;
}
/* static */
nsContentPolicyType
nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(nsContentPolicyType aType)
{
if (aType == InternalContentPolicyTypeToExternalOrWorker(aType) ||
aType == InternalContentPolicyTypeToExternalOrPreload(aType)) {
return aType;
}
return InternalContentPolicyTypeToExternal(aType);
}
nsresult
nsContentUtils::SetFetchReferrerURIWithPolicy(nsIPrincipal* aPrincipal,
nsIDocument* aDoc,

View File

@ -985,20 +985,6 @@ public:
*/
static nsContentPolicyType InternalContentPolicyTypeToExternal(nsContentPolicyType aType);
/**
* Map internal content policy types to external ones or script types or preload types:
* * TYPE_INTERNAL_SCRIPT
* * TYPE_INTERNAL_WORKER
* * TYPE_INTERNAL_SHARED_WORKER
* * TYPE_INTERNAL_SERVICE_WORKER
* * TYPE_INTERNAL_SCRIPT_PRELOAD
* * TYPE_INTERNAL_IMAGE_PRELOAD
* * TYPE_INTERNAL_STYLESHEET_PRELOAD
*
* Note: DO NOT call this function unless you know what you're doing!
*/
static nsContentPolicyType InternalContentPolicyTypeToExternalOrMCBInternal(nsContentPolicyType aType);
/**
* Map internal content policy types to external ones or preload types:
* * TYPE_INTERNAL_SCRIPT_PRELOAD
@ -1009,19 +995,6 @@ public:
*/
static nsContentPolicyType InternalContentPolicyTypeToExternalOrPreload(nsContentPolicyType aType);
/**
* Map internal content policy types to external ones, worker, or preload types:
* * TYPE_INTERNAL_WORKER
* * TYPE_INTERNAL_SHARED_WORKER
* * TYPE_INTERNAL_SERVICE_WORKER
* * TYPE_INTERNAL_SCRIPT_PRELOAD
* * TYPE_INTERNAL_IMAGE_PRELOAD
* * TYPE_INTERNAL_STYLESHEET_PRELOAD
*
* Note: DO NOT call this function unless you know what you're doing!
*/
static nsContentPolicyType InternalContentPolicyTypeToExternalOrCSPInternal(nsContentPolicyType aType);
/**
* Map internal content policy types to external ones, worker, or preload types:
* * TYPE_INTERNAL_WORKER

View File

@ -60,6 +60,7 @@ MSG_DEF(MSG_INVALID_HEADER_SEQUENCE, 0, JSEXN_TYPEERR, "Headers require name/val
MSG_DEF(MSG_PERMISSION_DENIED_TO_PASS_ARG, 1, JSEXN_TYPEERR, "Permission denied to pass cross-origin object as {0}.")
MSG_DEF(MSG_MISSING_REQUIRED_DICTIONARY_MEMBER, 1, JSEXN_TYPEERR, "Missing required {0}.")
MSG_DEF(MSG_INVALID_REQUEST_METHOD, 1, JSEXN_TYPEERR, "Invalid request method {0}.")
MSG_DEF(MSG_INVALID_REQUEST_MODE, 1, JSEXN_TYPEERR, "Invalid request mode {0}.")
MSG_DEF(MSG_FETCH_BODY_CONSUMED_ERROR, 0, JSEXN_TYPEERR, "Body has already been consumed.")
MSG_DEF(MSG_RESPONSE_INVALID_STATUSTEXT_ERROR, 0, JSEXN_TYPEERR, "Response statusText may not contain newline or carriage return.")
MSG_DEF(MSG_FETCH_FAILED, 0, JSEXN_TYPEERR, "NetworkError when attempting to fetch resource.")

View File

@ -37,7 +37,7 @@ const int32_t kFirstShippedSchemaVersion = 15;
namespace {
// Update this whenever the DB schema is changed.
const int32_t kLatestSchemaVersion = 18;
const int32_t kLatestSchemaVersion = 19;
// ---------
// The following constants define the SQL schema. These are defined in the
@ -192,7 +192,8 @@ static_assert(int(HeadersGuardEnum::None) == 0 &&
static_assert(int(RequestMode::Same_origin) == 0 &&
int(RequestMode::No_cors) == 1 &&
int(RequestMode::Cors) == 2 &&
int(RequestMode::EndGuard_) == 3,
int(RequestMode::Navigate) == 3 &&
int(RequestMode::EndGuard_) == 4,
"RequestMode values are as expected");
static_assert(int(RequestCredentials::Omit) == 0 &&
int(RequestCredentials::Same_origin) == 1 &&
@ -2411,12 +2412,14 @@ struct Migration
nsresult MigrateFrom15To16(mozIStorageConnection* aConn);
nsresult MigrateFrom16To17(mozIStorageConnection* aConn);
nsresult MigrateFrom17To18(mozIStorageConnection* aConn);
nsresult MigrateFrom18To19(mozIStorageConnection* aConn);
// Configure migration functions to run for the given starting version.
Migration sMigrationList[] = {
Migration(15, MigrateFrom15To16),
Migration(16, MigrateFrom16To17),
Migration(17, MigrateFrom17To18),
Migration(18, MigrateFrom18To19),
};
uint32_t sMigrationListLength = sizeof(sMigrationList) / sizeof(Migration);
@ -2684,6 +2687,38 @@ MigrateFrom17To18(mozIStorageConnection* aConn)
return rv;
}
nsresult
MigrateFrom18To19(mozIStorageConnection* aConn)
{
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
mozStorageTransaction trans(aConn, true,
mozIStorageConnection::TRANSACTION_IMMEDIATE);
// This migration is needed in order to update the RequestMode values for
// Request objects corresponding to a navigation content policy type to
// "navigate".
static_assert(int(nsIContentPolicy::TYPE_DOCUMENT) == 6 &&
int(nsIContentPolicy::TYPE_SUBDOCUMENT) == 7 &&
int(nsIContentPolicy::TYPE_INTERNAL_FRAME) == 28 &&
int(nsIContentPolicy::TYPE_INTERNAL_IFRAME) == 29 &&
int(nsIContentPolicy::TYPE_REFRESH) == 8 &&
int(RequestMode::Navigate) == 3,
"This is where the numbers below come from!");
nsresult rv = aConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
"UPDATE entries SET request_mode = 3 "
"WHERE request_contentpolicytype IN (6, 7, 28, 29, 8);"
));
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
rv = aConn->SetSchemaVersion(19);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
return rv;
}
} // anonymous namespace

Binary file not shown.

View File

@ -21,6 +21,7 @@ function run_test() {
ok(request, 'each request in list should be non-null');
ok(request.redirect === 'follow', 'request.redirect should default to "follow"');
ok(request.cache === 'default', 'request.cache should have been updated to "default"' + request.cache);
ok(request.mode === 'navigate', 'request.mode should have been updated to "navigate"');
});
return Promise.all(requestList.map(function(request) {
return cache.match(request);

View File

@ -2488,8 +2488,11 @@ CanvasRenderingContext2D::UpdateFilter()
//
static bool
ValidateRect(double& aX, double& aY, double& aWidth, double& aHeight)
ValidateRect(double& aX, double& aY, double& aWidth, double& aHeight, bool aIsZeroSizeValid)
{
if (!aIsZeroSizeValid && (aWidth == 0.0 || aHeight == 0.0)) {
return false;
}
// bug 1018527
// The values of canvas API input are in double precision, but Moz2D APIs are
@ -2520,7 +2523,8 @@ void
CanvasRenderingContext2D::ClearRect(double x, double y, double w,
double h)
{
if(!ValidateRect(x, y, w, h)) {
// Do not allow zeros - it's a no-op at that point per spec.
if (!ValidateRect(x, y, w, h, false)) {
return;
}
@ -2537,7 +2541,7 @@ CanvasRenderingContext2D::FillRect(double x, double y, double w,
{
const ContextState &state = CurrentState();
if(!ValidateRect(x, y, w, h)) {
if (!ValidateRect(x, y, w, h, true)) {
return;
}
@ -2615,7 +2619,7 @@ CanvasRenderingContext2D::StrokeRect(double x, double y, double w,
return;
}
if(!ValidateRect(x, y, w, h)) {
if (!ValidateRect(x, y, w, h, true)) {
return;
}
@ -2804,7 +2808,7 @@ void CanvasRenderingContext2D::DrawFocusIfNeeded(mozilla::dom::Element& aElement
return;
}
if(DrawCustomFocusRing(aElement)) {
if (DrawCustomFocusRing(aElement)) {
Save();
// set state to conforming focus state
@ -3051,7 +3055,7 @@ void
CanvasRenderingContext2D::EnsureUserSpacePath(const CanvasWindingRule& winding)
{
FillRule fillRule = CurrentState().fillRule;
if(winding == CanvasWindingRule::Evenodd)
if (winding == CanvasWindingRule::Evenodd)
fillRule = FillRule::FILL_EVEN_ODD;
EnsureTarget();
@ -3342,7 +3346,7 @@ CanvasRenderingContext2D::AddHitRegion(const HitRegionOptions& options, ErrorRes
path = mPath;
}
if(!path) {
if (!path) {
error.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
@ -4396,8 +4400,8 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& image,
MOZ_ASSERT(optional_argc == 0 || optional_argc == 2 || optional_argc == 6);
if (optional_argc == 6) {
if (!ValidateRect(sx, sy, sw, sh) ||
!ValidateRect(dx, dy, dw, dh)) {
if (!ValidateRect(sx, sy, sw, sh, true) ||
!ValidateRect(dx, dy, dw, dh, true)) {
return;
}
}

View File

@ -736,7 +736,7 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
}
switch (attachment) {
case LOCAL_GL_COLOR:
case LOCAL_GL_BACK:
case LOCAL_GL_DEPTH:
case LOCAL_GL_STENCIL:
break;
@ -760,12 +760,12 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
if (attachment == LOCAL_GL_COLOR)
if (attachment == LOCAL_GL_BACK)
return JS::NumberValue(8);
return JS::NumberValue(0);
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
if (attachment == LOCAL_GL_COLOR)
if (attachment == LOCAL_GL_BACK)
return JS::NumberValue(mOptions.alpha ? 8 : 0);
return JS::NumberValue(0);

View File

@ -172,10 +172,12 @@ QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl)
// Collect active locations:
GLint loc = gl->fGetAttribLocation(prog->mGLName, mappedName.BeginReading());
if (loc == -1)
MOZ_CRASH("Active attrib has no location.");
info->activeAttribLocs.insert(loc);
if (loc == -1) {
if (mappedName != "gl_InstanceID")
MOZ_CRASH("Active attrib has no location.");
} else {
info->activeAttribLocs.insert(loc);
}
}
// Uniforms

View File

@ -27,8 +27,7 @@ DepthStencilDepthFormat(gl::GLContext* gl)
static bool
SupportsDepthStencil(gl::GLContext* gl)
{
return gl->IsExtensionSupported(gl::GLContext::EXT_packed_depth_stencil) ||
gl->IsExtensionSupported(gl::GLContext::OES_packed_depth_stencil);
return gl->IsSupported(gl::GLFeature::packed_depth_stencil);
}
static bool

View File

@ -43,7 +43,7 @@ namespace mozilla {
namespace dom {
NS_IMPL_ISUPPORTS(FetchDriver,
nsIStreamListener, nsIInterfaceRequestor,
nsIStreamListener, nsIChannelEventSink, nsIInterfaceRequestor,
nsIThreadRetargetableStreamListener)
FetchDriver::FetchDriver(InternalRequest* aRequest, nsIPrincipal* aPrincipal,
@ -170,7 +170,8 @@ FetchDriver::HttpFetch()
nsSecurityFlags secFlags = nsILoadInfo::SEC_ABOUT_BLANK_INHERITS;
if (mRequest->Mode() == RequestMode::Cors) {
secFlags |= nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS;
} else if (mRequest->Mode() == RequestMode::Same_origin) {
} else if (mRequest->Mode() == RequestMode::Same_origin ||
mRequest->Mode() == RequestMode::Navigate) {
secFlags |= nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS;
} else if (mRequest->Mode() == RequestMode::No_cors) {
secFlags |= nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS;
@ -230,6 +231,17 @@ FetchDriver::HttpFetch()
mLoadGroup = nullptr;
// Insert ourselves into the notification callbacks chain so we can set
// headers on redirects.
#ifdef DEBUG
{
nsCOMPtr<nsIInterfaceRequestor> notificationCallbacks;
chan->GetNotificationCallbacks(getter_AddRefs(notificationCallbacks));
MOZ_ASSERT(!notificationCallbacks);
}
#endif
chan->SetNotificationCallbacks(this);
// FIXME(nsm): Bug 1120715.
// Step 3.4 "If request's cache mode is default and request's header list
// contains a header named `If-Modified-Since`, `If-None-Match`,
@ -249,25 +261,7 @@ FetchDriver::HttpFetch()
NS_ENSURE_SUCCESS(rv, rv);
// Set the same headers.
nsAutoTArray<InternalHeaders::Entry, 5> headers;
mRequest->Headers()->GetEntries(headers);
bool hasAccept = false;
for (uint32_t i = 0; i < headers.Length(); ++i) {
if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
hasAccept = true;
}
if (headers[i].mValue.IsEmpty()) {
httpChan->SetEmptyRequestHeader(headers[i].mName);
} else {
httpChan->SetRequestHeader(headers[i].mName, headers[i].mValue, false /* merge */);
}
}
if (!hasAccept) {
httpChan->SetRequestHeader(NS_LITERAL_CSTRING("accept"),
NS_LITERAL_CSTRING("*/*"),
false /* merge */);
}
SetRequestHeaders(httpChan);
// Step 2. Set the referrer.
nsAutoString referrer;
@ -300,16 +294,6 @@ FetchDriver::HttpFetch()
NS_ENSURE_SUCCESS(rv, rv);
}
// Step 3 "If HTTPRequest's force Origin header flag is set..."
if (mRequest->ForceOriginHeader()) {
nsAutoString origin;
rv = nsContentUtils::GetUTFOrigin(mPrincipal, origin);
NS_ENSURE_SUCCESS(rv, rv);
httpChan->SetRequestHeader(NS_LITERAL_CSTRING("origin"),
NS_ConvertUTF16toUTF8(origin),
false /* merge */);
}
// Bug 1120722 - Authorization will be handled later.
// Auth may require prompting, we don't support it yet.
// The next patch in this same bug prevents this from aborting the request.
@ -683,6 +667,21 @@ FetchDriver::OnStopRequest(nsIRequest* aRequest,
return NS_OK;
}
NS_IMETHODIMP
FetchDriver::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
nsIChannel* aNewChannel,
uint32_t aFlags,
nsIAsyncVerifyRedirectCallback *aCallback)
{
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aNewChannel);
if (httpChannel) {
SetRequestHeaders(httpChannel);
}
aCallback->OnRedirectVerifyCallback(NS_OK);
return NS_OK;
}
NS_IMETHODIMP
FetchDriver::CheckListenerChain()
{
@ -692,6 +691,11 @@ FetchDriver::CheckListenerChain()
NS_IMETHODIMP
FetchDriver::GetInterface(const nsIID& aIID, void **aResult)
{
if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) {
*aResult = static_cast<nsIChannelEventSink*>(this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIStreamListener))) {
*aResult = static_cast<nsIStreamListener*>(this);
NS_ADDREF_THIS();
@ -714,5 +718,40 @@ FetchDriver::SetDocument(nsIDocument* aDocument)
mDocument = aDocument;
}
void
FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const
{
MOZ_ASSERT(aChannel);
nsAutoTArray<InternalHeaders::Entry, 5> headers;
mRequest->Headers()->GetEntries(headers);
bool hasAccept = false;
for (uint32_t i = 0; i < headers.Length(); ++i) {
if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
hasAccept = true;
}
if (headers[i].mValue.IsEmpty()) {
aChannel->SetEmptyRequestHeader(headers[i].mName);
} else {
aChannel->SetRequestHeader(headers[i].mName, headers[i].mValue, false /* merge */);
}
}
if (!hasAccept) {
aChannel->SetRequestHeader(NS_LITERAL_CSTRING("accept"),
NS_LITERAL_CSTRING("*/*"),
false /* merge */);
}
if (mRequest->ForceOriginHeader()) {
nsAutoString origin;
if (NS_SUCCEEDED(nsContentUtils::GetUTFOrigin(mPrincipal, origin))) {
aChannel->SetRequestHeader(NS_LITERAL_CSTRING("origin"),
NS_ConvertUTF16toUTF8(origin),
false /* merge */);
}
}
}
} // namespace dom
} // namespace mozilla

View File

@ -55,6 +55,7 @@ private:
};
class FetchDriver final : public nsIStreamListener,
public nsIChannelEventSink,
public nsIInterfaceRequestor,
public nsIThreadRetargetableStreamListener
{
@ -62,6 +63,7 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSICHANNELEVENTSINK
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
@ -99,6 +101,8 @@ private:
// Utility since not all cases need to do any post processing of the filtered
// response.
nsresult FailWithNetworkError();
void SetRequestHeaders(nsIHttpChannel* aChannel) const;
};
} // namespace dom

View File

@ -275,14 +275,13 @@ InternalRequest::MapChannelToRequestMode(nsIChannel* aChannel)
nsCOMPtr<nsILoadInfo> loadInfo;
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aChannel->GetLoadInfo(getter_AddRefs(loadInfo))));
// RequestMode deviates from our internal security mode for navigations.
// While navigations normally allow cross origin we must set a same-origin
// RequestMode to get the correct service worker interception restrictions
// in place.
// TODO: remove the worker override once securityMode is fully implemented (bug 1189945)
nsContentPolicyType contentPolicy = loadInfo->InternalContentPolicyType();
if (IsNavigationContentPolicy(contentPolicy) ||
IsWorkerContentPolicy(contentPolicy)) {
if (IsNavigationContentPolicy(contentPolicy)) {
return RequestMode::Navigate;
}
// TODO: remove the worker override once securityMode is fully implemented (bug 1189945)
if (IsWorkerContentPolicy(contentPolicy)) {
return RequestMode::Same_origin;
}
@ -319,6 +318,7 @@ InternalRequest::MapChannelToRequestMode(nsIChannel* aChannel)
uint32_t corsMode;
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(httpChannel->GetCorsMode(&corsMode)));
MOZ_ASSERT(corsMode != nsIHttpChannelInternal::CORS_MODE_NAVIGATE);
// This cast is valid due to static asserts in ServiceWorkerManager.cpp.
return static_cast<RequestMode>(corsMode);

View File

@ -284,6 +284,11 @@ Request::Constructor(const GlobalObject& aGlobal,
aInit.mCredentials.WasPassed() ? aInit.mCredentials.Value()
: fallbackCredentials;
if (mode == RequestMode::Navigate) {
aRv.ThrowTypeError<MSG_INVALID_REQUEST_MODE>(NS_LITERAL_STRING("navigate"));
return nullptr;
}
if (mode != RequestMode::EndGuard_) {
request->ClearCreatedByFetchEvent();
request->SetMode(mode);

View File

@ -551,6 +551,14 @@ HTMLMediaElement::GetMozMediaSourceObject() const
return source.forget();
}
void
HTMLMediaElement::GetMozDebugReaderData(nsAString& aString)
{
if (mDecoder && !mSrcStream) {
mDecoder->GetMozDebugReaderData(aString);
}
}
already_AddRefed<DOMMediaStream>
HTMLMediaElement::GetSrcObject() const
{

View File

@ -553,6 +553,10 @@ public:
}
already_AddRefed<MediaSource> GetMozMediaSourceObject() const;
// Returns a string describing the state of the media player internal
// data. Used for debugging purposes.
void GetMozDebugReaderData(nsAString& aString);
already_AddRefed<DOMMediaStream> GetSrcObject() const;
void SetSrcObject(DOMMediaStream& aValue);
void SetSrcObject(DOMMediaStream* aValue);

View File

@ -113,8 +113,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=829606
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=829606">Mozilla Bug 829606</a>
<p id="display"></p>
<div id="content">
<textarea rows='1' cols='5'>this is a \n long text</textarea>
<input size='5' value="this is a very long text">
<textarea rows='1' cols='5' style='-moz-appearance:none;'>this is a \n long text</textarea>
<input size='5' value="this is a very long text" style='-moz-appearance:none;'>
</div>
<pre id="test">
</pre>

View File

@ -529,15 +529,9 @@ TabParent::ShouldSwitchProcess(nsIChannel* aChannel, const nsACString& aSignedPk
return false;
}
// If this is a brand new process created to load the signed package
// (triggered by previous OnStartSignedPackageRequest), the loading origin
// will be "moz-safe-about:blank". In that case, we don't need to switch process
// again. We compare with "moz-safe-about:blank" without appId/isBrowserElement/etc
// taken into account. That's why we use originNoSuffix.
nsCString loadingOriginNoSuffix;
loadingPrincipal->GetOriginNoSuffix(loadingOriginNoSuffix);
if (loadingOriginNoSuffix.EqualsLiteral("moz-safe-about:blank")) {
LOG("The content is already loaded by a brand new process.\n");
DocShellOriginAttributes attrs = OriginAttributesRef();
if (attrs.mSignedPkg == NS_ConvertUTF8toUTF16(aSignedPkg)) {
// This tab is made for the incoming signed content.
return false;
}

View File

@ -61,7 +61,7 @@ this.ManifestProcessor = { // jshint ignore:line
docURL: aDocURL
}) {
const console = new ConsoleAPI({
prefix: 'Web Manifest: '
prefix: 'Web Manifest'
});
const manifestURL = new URL(aManifestURL);
const docURL = new URL(aDocURL);
@ -90,6 +90,7 @@ this.ManifestProcessor = { // jshint ignore:line
),
'short_name': processShortNameMember(),
'theme_color': processThemeColorMember(),
'background_color': processBackgroundColorMember(),
};
processedManifest.scope = processScopeMember();
return processedManifest;
@ -224,6 +225,17 @@ this.ManifestProcessor = { // jshint ignore:line
return extractor.extractColorValue(spec);
}
function processBackgroundColorMember() {
const spec = {
objectName: 'manifest',
object: rawManifest,
property: 'background_color',
expectedType: 'string',
trim: true
};
return extractor.extractColorValue(spec);
}
function processLangMember() {
const spec = {
objectName: 'manifest',

View File

@ -53,7 +53,7 @@ ValueExtractor.prototype = {
if (DOMUtils.isValidCSSColor(value)) {
color = value;
} else if (value) {
const msg = `background_color: ${value} is not a valid CSS color.`;
const msg = `${spec.property}: ${value} is not a valid CSS color.`;
this.console.warn(msg);
}
return color;

View File

@ -26,7 +26,7 @@ public:
mBuffers.SwapElements(*aBuffers);
}
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = 0;
amount += mBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf);
@ -37,7 +37,7 @@ public:
return amount;
}
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
@ -384,7 +384,7 @@ public:
static Type StaticType() { return AUDIO; }
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -17,12 +17,12 @@ public:
AudioStreamTrack(DOMMediaStream* aStream, TrackID aTrackID, const nsString& aLabel)
: MediaStreamTrack(aStream, aTrackID, aLabel) {}
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
virtual AudioStreamTrack* AsAudioStreamTrack() override { return this; }
AudioStreamTrack* AsAudioStreamTrack() override { return this; }
// WebIDL
virtual void GetKind(nsAString& aKind) override { aKind.AssignLiteral("audio"); }
void GetKind(nsAString& aKind) override { aKind.AssignLiteral("audio"); }
};
} // namespace dom

View File

@ -21,14 +21,14 @@ public:
const nsAString& aLanguage,
bool aEnabled);
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
virtual AudioTrack* AsAudioTrack() override
AudioTrack* AsAudioTrack() override
{
return this;
}
virtual void SetEnabledInternal(bool aEnabled, int aFlags) override;
void SetEnabledInternal(bool aEnabled, int aFlags) override;
// WebIDL
bool Enabled() const

View File

@ -21,7 +21,7 @@ public:
AudioTrackList(nsPIDOMWindow* aOwnerWindow, HTMLMediaElement* aMediaElement)
: MediaTrackList(aOwnerWindow, aMediaElement) {}
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
AudioTrack* operator[](uint32_t aIndex);
@ -31,7 +31,7 @@ public:
AudioTrack* GetTrackById(const nsAString& aId);
protected:
virtual AudioTrackList* AsAudioTrackList() override { return this; }
AudioTrackList* AsAudioTrackList() override { return this; }
};
} // namespace dom

View File

@ -40,27 +40,27 @@ protected:
}
private:
virtual nsresult Close() override { return NS_OK; }
virtual void Suspend(bool aCloseImmediately) override {}
virtual void Resume() override {}
nsresult Close() override { return NS_OK; }
void Suspend(bool aCloseImmediately) override {}
void Resume() override {}
// Get the current principal for the channel
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
{
nsCOMPtr<nsIPrincipal> principal = mPrincipal;
return principal.forget();
}
virtual bool CanClone() override { return false; }
virtual already_AddRefed<MediaResource> CloneData(MediaResourceCallback*) override
bool CanClone() override { return false; }
already_AddRefed<MediaResource> CloneData(MediaResourceCallback*) override
{
return nullptr;
}
// These methods are called off the main thread.
// The mode is initially MODE_PLAYBACK.
virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
virtual nsresult ReadAt(int64_t aOffset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override
void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
nsresult ReadAt(int64_t aOffset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override
{
if (aOffset < 0 || aOffset > mLength) {
return NS_ERROR_FAILURE;
@ -70,20 +70,20 @@ private:
mOffset = aOffset + *aBytes;
return NS_OK;
}
virtual int64_t Tell() override { return mOffset; }
int64_t Tell() override { return mOffset; }
virtual void Pin() override {}
virtual void Unpin() override {}
virtual double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0.; }
virtual int64_t GetLength() override { return mLength; }
virtual int64_t GetNextCachedData(int64_t aOffset) override { return aOffset; }
virtual int64_t GetCachedDataEnd(int64_t aOffset) override { return mLength; }
virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; }
virtual bool IsSuspendedByCache() override { return false; }
virtual bool IsSuspended() override { return false; }
virtual nsresult ReadFromCache(char* aBuffer,
int64_t aOffset,
uint32_t aCount) override
void Pin() override {}
void Unpin() override {}
double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0.; }
int64_t GetLength() override { return mLength; }
int64_t GetNextCachedData(int64_t aOffset) override { return aOffset; }
int64_t GetCachedDataEnd(int64_t aOffset) override { return mLength; }
bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; }
bool IsSuspendedByCache() override { return false; }
bool IsSuspended() override { return false; }
nsresult ReadFromCache(char* aBuffer,
int64_t aOffset,
uint32_t aCount) override
{
if (aOffset < 0) {
return NS_ERROR_FAILURE;
@ -94,12 +94,12 @@ private:
return NS_OK;
}
virtual nsresult Open(nsIStreamListener** aStreamListener) override
nsresult Open(nsIStreamListener** aStreamListener) override
{
return NS_ERROR_FAILURE;
}
virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override
nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override
{
aRanges += MediaByteRange(0, int64_t(mLength));
return NS_OK;
@ -107,13 +107,12 @@ private:
bool IsTransportSeekable() override { return true; }
virtual const nsCString& GetContentType() const override
const nsCString& GetContentType() const override
{
return mContentType;
}
virtual size_t SizeOfExcludingThis(
MallocSizeOf aMallocSizeOf) const override
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Not owned:
// - mBuffer
@ -124,8 +123,7 @@ private:
return size;
}
virtual size_t SizeOfIncludingThis(
MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -44,7 +44,7 @@ public:
mImage = aImage;
}
virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime) override
void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime) override
{
// Called on the MediaStreamGraph thread.
StreamTime delta = aDesiredTime - mSourceStream->GetEndOfAppendedData(mTrackId);

View File

@ -103,7 +103,7 @@ public:
nsresult Init(const dom::Optional<double>& aFPS, const TrackID& aTrackId);
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
// WebIDL
HTMLCanvasElement* Canvas() const { return mCanvas; }

View File

@ -28,8 +28,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GetUserMediaRequest)
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
override;
JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
nsISupports* GetParentObject();
uint64_t WindowID();

View File

@ -258,21 +258,21 @@ class ThreadedDriver : public GraphDriver
public:
explicit ThreadedDriver(MediaStreamGraphImpl* aGraphImpl);
virtual ~ThreadedDriver();
virtual void Start() override;
virtual void Stop() override;
virtual void Resume() override;
virtual void Revive() override;
void Start() override;
void Stop() override;
void Resume() override;
void Revive() override;
/**
* Runs main control loop on the graph thread. Normally a single invocation
* of this runs for the entire lifetime of the graph thread.
*/
void RunThread();
friend class MediaStreamGraphInitThreadRunnable;
virtual uint32_t IterationDuration() override {
uint32_t IterationDuration() override {
return MEDIA_GRAPH_TARGET_PERIOD_MS;
}
virtual bool OnThread() override { return !mThread || NS_GetCurrentThread() == mThread; }
bool OnThread() override { return !mThread || NS_GetCurrentThread() == mThread; }
/* When the graph wakes up to do an iteration, implementations return the
* range of time that will be processed. This is called only once per
@ -292,9 +292,9 @@ class SystemClockDriver : public ThreadedDriver
public:
explicit SystemClockDriver(MediaStreamGraphImpl* aGraphImpl);
virtual ~SystemClockDriver();
virtual MediaTime GetIntervalForIteration() override;
virtual void WaitForNextIteration() override;
virtual void WakeUp() override;
MediaTime GetIntervalForIteration() override;
void WaitForNextIteration() override;
void WakeUp() override;
private:
@ -313,11 +313,11 @@ class OfflineClockDriver : public ThreadedDriver
public:
OfflineClockDriver(MediaStreamGraphImpl* aGraphImpl, GraphTime aSlice);
virtual ~OfflineClockDriver();
virtual MediaTime GetIntervalForIteration() override;
virtual void WaitForNextIteration() override;
virtual void WakeUp() override;
virtual TimeStamp GetCurrentTimeStamp() override;
virtual OfflineClockDriver* AsOfflineClockDriver() override {
MediaTime GetIntervalForIteration() override;
void WaitForNextIteration() override;
void WakeUp() override;
TimeStamp GetCurrentTimeStamp() override;
OfflineClockDriver* AsOfflineClockDriver() override {
return this;
}
@ -368,13 +368,13 @@ public:
explicit AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl);
virtual ~AudioCallbackDriver();
virtual void Destroy() override;
virtual void Start() override;
virtual void Stop() override;
virtual void Resume() override;
virtual void Revive() override;
virtual void WaitForNextIteration() override;
virtual void WakeUp() override;
void Destroy() override;
void Start() override;
void Stop() override;
void Resume() override;
void Revive() override;
void WaitForNextIteration() override;
void WakeUp() override;
/* Static wrapper function cubeb calls back. */
static long DataCallback_s(cubeb_stream * aStream,
@ -394,17 +394,17 @@ public:
void StateCallback(cubeb_state aState);
/* This is an approximation of the number of millisecond there are between two
* iterations of the graph. */
virtual uint32_t IterationDuration() override;
uint32_t IterationDuration() override;
/* This function gets called when the graph has produced the audio frames for
* this iteration. */
virtual void MixerCallback(AudioDataValue* aMixedBuffer,
AudioSampleFormat aFormat,
uint32_t aChannels,
uint32_t aFrames,
uint32_t aSampleRate) override;
void MixerCallback(AudioDataValue* aMixedBuffer,
AudioSampleFormat aFormat,
uint32_t aChannels,
uint32_t aFrames,
uint32_t aSampleRate) override;
virtual AudioCallbackDriver* AsAudioCallbackDriver() override {
AudioCallbackDriver* AsAudioCallbackDriver() override {
return this;
}
@ -427,7 +427,7 @@ public:
*/
bool InCallback();
virtual bool OnThread() override { return !mStarted || InCallback(); }
bool OnThread() override { return !mStarted || InCallback(); }
/* Whether the underlying cubeb stream has been started. See comment for
* mStarted for details. */

View File

@ -530,6 +530,10 @@ private:
virtual MediaDecoderOwner::NextFrameStatus NextFrameStatus() { return mNextFrameStatus; }
virtual MediaDecoderOwner::NextFrameStatus NextFrameBufferedStatus();
// Returns a string describing the state of the media player internal
// data. Used for debugging purposes.
virtual void GetMozDebugReaderData(nsAString& aString) {}
protected:
virtual ~MediaDecoder();

View File

@ -1363,6 +1363,7 @@ MediaFormatReader::OnVideoSkipCompleted(uint32_t aSkipped)
if (mDecoder) {
mDecoder->NotifyDecodedFrames(aSkipped, 0, aSkipped);
}
mVideo.mNumSamplesSkippedTotal += aSkipped;
MOZ_ASSERT(!mVideo.mError); // We have flushed the decoder, no frame could
// have been decoded (and as such errored)
NotifyDecodingRequested(TrackInfo::kVideoTrack);
@ -1661,4 +1662,19 @@ MediaFormatReader::GetImageContainer()
? mVideoFrameContainer->GetImageContainer() : nullptr;
}
void
MediaFormatReader::GetMozDebugReaderData(nsAString& aString)
{
nsAutoCString result;
result += nsPrintfCString("hardware video decoding: %s\n",
VideoIsHardwareAccelerated() ? "enabled" : "disabled");
result += nsPrintfCString("audio frames decoded: %lld (skipped:%lld)\n"
"video frames decoded: %lld (skipped:%lld)\n",
mAudio.mNumSamplesOutputTotal,
mAudio.mNumSamplesSkippedTotal,
mVideo.mNumSamplesOutputTotal,
mVideo.mNumSamplesSkippedTotal);
aString += NS_ConvertUTF8toUTF16(result);
}
} // namespace mozilla

View File

@ -55,7 +55,7 @@ protected:
public:
media::TimeIntervals GetBuffered() override;
virtual bool ForceZeroStartTime() const override;
bool ForceZeroStartTime() const override;
// For Media Resource Management
void ReleaseMediaResources() override;
@ -96,6 +96,10 @@ public:
void SetCDMProxy(CDMProxy* aProxy) override;
#endif
// Returns a string describing the state of the decoder data.
// Used for debugging purposes.
void GetMozDebugReaderData(nsAString& aString);
private:
bool HasVideo() { return mVideo.mTrackDemuxer; }
bool HasAudio() { return mAudio.mTrackDemuxer; }
@ -226,6 +230,7 @@ private:
, mNumSamplesInput(0)
, mNumSamplesOutput(0)
, mNumSamplesOutputTotal(0)
, mNumSamplesSkippedTotal(0)
, mSizeOfQueue(0)
, mIsHardwareAccelerated(false)
, mLastStreamSourceID(UINT32_MAX)
@ -289,6 +294,7 @@ private:
uint64_t mNumSamplesInput;
uint64_t mNumSamplesOutput;
uint64_t mNumSamplesOutputTotal;
uint64_t mNumSamplesSkippedTotal;
// These get overriden in the templated concrete class.
// Indicate if we have a pending promise for decoded frame.

View File

@ -200,22 +200,22 @@ public:
{
}
virtual bool IsValid() const override
bool IsValid() const override
{
return mDisplay.width > 0 && mDisplay.height > 0;
}
virtual VideoInfo* GetAsVideoInfo() override
VideoInfo* GetAsVideoInfo() override
{
return this;
}
virtual const VideoInfo* GetAsVideoInfo() const override
const VideoInfo* GetAsVideoInfo() const override
{
return this;
}
virtual UniquePtr<TrackInfo> Clone() const override
UniquePtr<TrackInfo> Clone() const override
{
return MakeUnique<VideoInfo>(*this);
}
@ -260,22 +260,22 @@ public:
{
}
virtual bool IsValid() const override
bool IsValid() const override
{
return mChannels > 0 && mRate > 0;
}
virtual AudioInfo* GetAsAudioInfo() override
AudioInfo* GetAsAudioInfo() override
{
return this;
}
virtual const AudioInfo* GetAsAudioInfo() const override
const AudioInfo* GetAsAudioInfo() const override
{
return this;
}
virtual UniquePtr<TrackInfo> Clone() const override
UniquePtr<TrackInfo> Clone() const override
{
return MakeUnique<AudioInfo>(*this);
}

View File

@ -703,7 +703,7 @@ public:
// single-source trackunion like we have here, the TrackUnion will assign trackids
// that match the source's trackids, so we can avoid needing a mapping function.
// XXX This will not handle more complex cases well.
virtual void StopTrack(TrackID aTrackID) override
void StopTrack(TrackID aTrackID) override
{
if (GetSourceStream()) {
GetSourceStream()->EndTrack(aTrackID);
@ -719,7 +719,7 @@ public:
}
}
virtual already_AddRefed<Promise>
already_AddRefed<Promise>
ApplyConstraintsToTrack(TrackID aTrackID,
const MediaTrackConstraints& aConstraints,
ErrorResult &aRv) override
@ -781,7 +781,7 @@ public:
#endif
// Allow getUserMedia to pass input data directly to PeerConnection/MediaPipeline
virtual bool AddDirectListener(MediaStreamDirectListener *aListener) override
bool AddDirectListener(MediaStreamDirectListener *aListener) override
{
if (GetSourceStream()) {
GetSourceStream()->AddDirectListener(aListener);
@ -790,7 +790,7 @@ public:
return false;
}
virtual void
void
AudioConfig(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAgc,
bool aNoiseOn, uint32_t aNoise,
@ -805,19 +805,19 @@ public:
mPlayoutDelay = aPlayoutDelay;
}
virtual void RemoveDirectListener(MediaStreamDirectListener *aListener) override
void RemoveDirectListener(MediaStreamDirectListener *aListener) override
{
if (GetSourceStream()) {
GetSourceStream()->RemoveDirectListener(aListener);
}
}
virtual DOMLocalMediaStream* AsDOMLocalMediaStream() override
DOMLocalMediaStream* AsDOMLocalMediaStream() override
{
return this;
}
virtual MediaEngineSource* GetMediaEngine(TrackID aTrackID) override
MediaEngineSource* GetMediaEngine(TrackID aTrackID) override
{
// MediaEngine supports only one video and on video track now and TrackID is
// fixed in MediaEngine.
@ -920,7 +920,7 @@ public:
DOMMediaStream* aStream)
: mWindowID(aWindowID), mOnSuccess(aSuccess), mManager(aManager),
mStream(aStream) {}
virtual void NotifyTracksAvailable(DOMMediaStream* aStream) override
void NotifyTracksAvailable(DOMMediaStream* aStream) override
{
// We're in the main thread, so no worries here.
if (!(mManager->IsWindowStillActive(mWindowID))) {
@ -2667,8 +2667,8 @@ MediaManager::Shutdown()
: mManager(aManager)
, mReply(aReply) {}
private:
virtual void
Run()
void
Run() override
{
LOG(("MediaManager Thread Shutdown"));
MOZ_ASSERT(MediaManager::IsInMediaThread());

View File

@ -48,7 +48,7 @@ public:
MediaRecorder(AudioNode& aSrcAudioNode, uint32_t aSrcOutput, nsPIDOMWindow* aOwnerWindow);
// nsWrapperCache
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
nsPIDOMWindow* GetParentObject() { return GetOwner(); }

View File

@ -1151,70 +1151,68 @@ public:
}
// Main thread
virtual nsresult Open(nsIStreamListener** aStreamListener) override;
virtual nsresult Close() override;
virtual void Suspend(bool aCloseImmediately) override {}
virtual void Resume() override {}
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
virtual bool CanClone() override;
virtual already_AddRefed<MediaResource> CloneData(MediaResourceCallback* aCallback) override;
virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override;
nsresult Open(nsIStreamListener** aStreamListener) override;
nsresult Close() override;
void Suspend(bool aCloseImmediately) override {}
void Resume() override {}
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
bool CanClone() override;
already_AddRefed<MediaResource> CloneData(MediaResourceCallback* aCallback) override;
nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override;
// These methods are called off the main thread.
// Other thread
virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
virtual nsresult ReadAt(int64_t aOffset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override;
virtual already_AddRefed<MediaByteBuffer> MediaReadAt(int64_t aOffset, uint32_t aCount) override;
virtual int64_t Tell() override;
void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
nsresult ReadAt(int64_t aOffset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override;
already_AddRefed<MediaByteBuffer> MediaReadAt(int64_t aOffset, uint32_t aCount) override;
int64_t Tell() override;
// Any thread
virtual void Pin() override {}
virtual void Unpin() override {}
virtual double GetDownloadRate(bool* aIsReliable) override
void Pin() override {}
void Unpin() override {}
double GetDownloadRate(bool* aIsReliable) override
{
// The data's all already here
*aIsReliable = true;
return 100*1024*1024; // arbitray, use 100MB/s
}
virtual int64_t GetLength() override {
int64_t GetLength() override {
MutexAutoLock lock(mLock);
EnsureSizeInitialized();
return mSizeInitialized ? mSize : 0;
}
virtual int64_t GetNextCachedData(int64_t aOffset) override
int64_t GetNextCachedData(int64_t aOffset) override
{
MutexAutoLock lock(mLock);
EnsureSizeInitialized();
return (aOffset < mSize) ? aOffset : -1;
}
virtual int64_t GetCachedDataEnd(int64_t aOffset) override {
int64_t GetCachedDataEnd(int64_t aOffset) override {
MutexAutoLock lock(mLock);
EnsureSizeInitialized();
return std::max(aOffset, mSize);
}
virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; }
virtual bool IsSuspendedByCache() override { return true; }
virtual bool IsSuspended() override { return true; }
virtual bool IsTransportSeekable() override { return true; }
bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; }
bool IsSuspendedByCache() override { return true; }
bool IsSuspended() override { return true; }
bool IsTransportSeekable() override { return true; }
nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override;
virtual size_t SizeOfExcludingThis(
MallocSizeOf aMallocSizeOf) const override
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Might be useful to track in the future:
// - mInput
return BaseMediaResource::SizeOfExcludingThis(aMallocSizeOf);
}
virtual size_t SizeOfIncludingThis(
MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -380,11 +380,10 @@ private:
class BaseMediaResource : public MediaResource {
public:
virtual nsIURI* URI() const override { return mURI; }
virtual void SetLoadInBackground(bool aLoadInBackground) override;
nsIURI* URI() const override { return mURI; }
void SetLoadInBackground(bool aLoadInBackground) override;
virtual size_t SizeOfExcludingThis(
MallocSizeOf aMallocSizeOf) const override
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Might be useful to track in the future:
// - mChannel
@ -397,8 +396,7 @@ public:
return size;
}
virtual size_t SizeOfIncludingThis(
MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
@ -429,7 +427,7 @@ protected:
MOZ_COUNT_DTOR(BaseMediaResource);
}
virtual const nsCString& GetContentType() const override
const nsCString& GetContentType() const override
{
return mContentType;
}
@ -556,21 +554,21 @@ public:
// Ensure that the media cache writes any data held in its partial block.
// Called on the main thread.
virtual void FlushCache() override;
void FlushCache() override;
// Notify that the last data byte range was loaded.
virtual void NotifyLastByteRange() override;
void NotifyLastByteRange() override;
// Main thread
virtual nsresult Open(nsIStreamListener** aStreamListener) override;
virtual nsresult Close() override;
virtual void Suspend(bool aCloseImmediately) override;
virtual void Resume() override;
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
nsresult Open(nsIStreamListener** aStreamListener) override;
nsresult Close() override;
void Suspend(bool aCloseImmediately) override;
void Resume() override;
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
// Return true if the stream has been closed.
bool IsClosed() const { return mCacheStream.IsClosed(); }
virtual bool CanClone() override;
virtual already_AddRefed<MediaResource> CloneData(MediaResourceCallback* aDecoder) override;
bool IsClosed() const { return mCacheStream.IsClosed(); }
bool CanClone() override;
already_AddRefed<MediaResource> CloneData(MediaResourceCallback* aDecoder) override;
// Set statistics to be recorded to the object passed in. If not called,
// |ChannelMediaResource| will create it's own statistics objects in |Open|.
void RecordStatisticsTo(MediaChannelStatistics *aStatistics) override {
@ -580,31 +578,30 @@ public:
mChannelStatistics = aStatistics;
}
}
virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override;
virtual void EnsureCacheUpToDate() override;
nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override;
void EnsureCacheUpToDate() override;
// Other thread
virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override;
virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override;
virtual nsresult ReadAt(int64_t offset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override;
virtual already_AddRefed<MediaByteBuffer> MediaReadAt(int64_t aOffset, uint32_t aCount) override;
virtual int64_t Tell() override;
void SetReadMode(MediaCacheStream::ReadMode aMode) override;
void SetPlaybackRate(uint32_t aBytesPerSecond) override;
nsresult ReadAt(int64_t offset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override;
already_AddRefed<MediaByteBuffer> MediaReadAt(int64_t aOffset, uint32_t aCount) override;
int64_t Tell() override;
// Any thread
virtual void Pin() override;
virtual void Unpin() override;
virtual double GetDownloadRate(bool* aIsReliable) override;
virtual int64_t GetLength() override;
virtual int64_t GetNextCachedData(int64_t aOffset) override;
virtual int64_t GetCachedDataEnd(int64_t aOffset) override;
virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override;
virtual bool IsSuspendedByCache() override;
virtual bool IsSuspended() override;
virtual bool IsTransportSeekable() override;
void Pin() override;
void Unpin() override;
double GetDownloadRate(bool* aIsReliable) override;
int64_t GetLength() override;
int64_t GetNextCachedData(int64_t aOffset) override;
int64_t GetCachedDataEnd(int64_t aOffset) override;
bool IsDataCachedToEndOfResource(int64_t aOffset) override;
bool IsSuspendedByCache() override;
bool IsSuspended() override;
bool IsTransportSeekable() override;
virtual size_t SizeOfExcludingThis(
MallocSizeOf aMallocSizeOf) const override {
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override {
// Might be useful to track in the future:
// - mListener (seems minor)
// - mChannelStatistics (seems minor)
@ -616,8 +613,7 @@ public:
return size;
}
virtual size_t SizeOfIncludingThis(
MallocSizeOf aMallocSizeOf) const override {
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override {
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
@ -642,7 +638,7 @@ public:
};
friend class Listener;
virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override;
nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override;
protected:
// These are called on the main thread by Listener.

View File

@ -149,11 +149,11 @@ protected:
*/
template <class C, class Chunk> class MediaSegmentBase : public MediaSegment {
public:
virtual MediaSegment* CreateEmptyClone() const override
MediaSegment* CreateEmptyClone() const override
{
return new C();
}
virtual void AppendFrom(MediaSegment* aSource) override
void AppendFrom(MediaSegment* aSource) override
{
NS_ASSERTION(aSource->GetType() == C::StaticType(), "Wrong type");
AppendFromInternal(static_cast<C*>(aSource));
@ -162,8 +162,8 @@ public:
{
AppendFromInternal(aSource);
}
virtual void AppendSlice(const MediaSegment& aSource,
StreamTime aStart, StreamTime aEnd) override
void AppendSlice(const MediaSegment& aSource,
StreamTime aStart, StreamTime aEnd) override
{
NS_ASSERTION(aSource.GetType() == C::StaticType(), "Wrong type");
AppendSliceInternal(static_cast<const C&>(aSource), aStart, aEnd);
@ -176,7 +176,7 @@ public:
* Replace the first aDuration ticks with null media data, because the data
* will not be required again.
*/
virtual void ForgetUpTo(StreamTime aDuration) override
void ForgetUpTo(StreamTime aDuration) override
{
if (mChunks.IsEmpty() || aDuration <= 0) {
return;
@ -194,7 +194,7 @@ public:
mChunks.InsertElementAt(0)->SetNull(aDuration);
mDuration += aDuration;
}
virtual void FlushAfter(StreamTime aNewEnd) override
void FlushAfter(StreamTime aNewEnd) override
{
if (mChunks.IsEmpty()) {
return;
@ -217,7 +217,7 @@ public:
}
mDuration = aNewEnd;
}
virtual void InsertNullDataAtStart(StreamTime aDuration) override
void InsertNullDataAtStart(StreamTime aDuration) override
{
if (aDuration <= 0) {
return;
@ -232,7 +232,7 @@ public:
#endif
mDuration += aDuration;
}
virtual void AppendNullData(StreamTime aDuration) override
void AppendNullData(StreamTime aDuration) override
{
if (aDuration <= 0) {
return;
@ -244,7 +244,7 @@ public:
}
mDuration += aDuration;
}
virtual void ReplaceWithDisabled() override
void ReplaceWithDisabled() override
{
if (GetType() != AUDIO) {
MOZ_CRASH("Disabling unknown segment type");
@ -253,7 +253,7 @@ public:
Clear();
AppendNullData(duration);
}
virtual void Clear() override
void Clear() override
{
mDuration = 0;
mChunks.Clear();
@ -315,7 +315,7 @@ public:
}
#endif
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mChunks.Length(); i++) {
@ -324,7 +324,7 @@ public:
return amount;
}
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -75,7 +75,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamError)
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID)
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
nsPIDOMWindow* GetParentObject() const
{

View File

@ -1383,11 +1383,11 @@ private:
class CreateMessage : public ControlMessage {
public:
explicit CreateMessage(MediaStream* aStream) : ControlMessage(aStream) {}
virtual void Run() override
void Run() override
{
mStream->GraphImpl()->AddStreamGraphThread(mStream);
}
virtual void RunDuringShutdown() override
void RunDuringShutdown() override
{
// Make sure to run this message during shutdown too, to make sure
// that we balance the number of streams registered with the graph
@ -1797,14 +1797,14 @@ MediaStream::Destroy()
class Message : public ControlMessage {
public:
explicit Message(MediaStream* aStream) : ControlMessage(aStream) {}
virtual void Run()
void Run() override
{
mStream->RemoveAllListenersImpl();
auto graph = mStream->GraphImpl();
mStream->DestroyImpl();
graph->RemoveStreamGraphThread(mStream);
}
virtual void RunDuringShutdown()
void RunDuringShutdown() override
{ Run(); }
};
mWrapper = nullptr;
@ -1821,7 +1821,7 @@ MediaStream::AddAudioOutput(void* aKey)
class Message : public ControlMessage {
public:
Message(MediaStream* aStream, void* aKey) : ControlMessage(aStream), mKey(aKey) {}
virtual void Run()
void Run() override
{
mStream->AddAudioOutputImpl(mKey);
}
@ -1849,7 +1849,7 @@ MediaStream::SetAudioOutputVolume(void* aKey, float aVolume)
public:
Message(MediaStream* aStream, void* aKey, float aVolume) :
ControlMessage(aStream), mKey(aKey), mVolume(aVolume) {}
virtual void Run()
void Run() override
{
mStream->SetAudioOutputVolumeImpl(mKey, mVolume);
}
@ -1888,7 +1888,7 @@ MediaStream::RemoveAudioOutput(void* aKey)
public:
Message(MediaStream* aStream, void* aKey) :
ControlMessage(aStream), mKey(aKey) {}
virtual void Run()
void Run() override
{
mStream->RemoveAudioOutputImpl(mKey);
}
@ -1924,7 +1924,7 @@ MediaStream::AddVideoOutput(VideoFrameContainer* aContainer)
public:
Message(MediaStream* aStream, VideoFrameContainer* aContainer) :
ControlMessage(aStream), mContainer(aContainer) {}
virtual void Run()
void Run() override
{
mStream->AddVideoOutputImpl(mContainer.forget());
}
@ -1940,7 +1940,7 @@ MediaStream::RemoveVideoOutput(VideoFrameContainer* aContainer)
public:
Message(MediaStream* aStream, VideoFrameContainer* aContainer) :
ControlMessage(aStream), mContainer(aContainer) {}
virtual void Run()
void Run() override
{
mStream->RemoveVideoOutputImpl(mContainer);
}
@ -1956,7 +1956,7 @@ MediaStream::Suspend()
public:
explicit Message(MediaStream* aStream) :
ControlMessage(aStream) {}
virtual void Run()
void Run() override
{
mStream->GraphImpl()->IncrementSuspendCount(mStream);
}
@ -1977,7 +1977,7 @@ MediaStream::Resume()
public:
explicit Message(MediaStream* aStream) :
ControlMessage(aStream) {}
virtual void Run()
void Run() override
{
mStream->GraphImpl()->DecrementSuspendCount(mStream);
}
@ -2012,7 +2012,7 @@ MediaStream::AddListener(MediaStreamListener* aListener)
public:
Message(MediaStream* aStream, MediaStreamListener* aListener) :
ControlMessage(aStream), mListener(aListener) {}
virtual void Run()
void Run() override
{
mStream->AddListenerImpl(mListener.forget());
}
@ -2037,7 +2037,7 @@ MediaStream::RemoveListener(MediaStreamListener* aListener)
public:
Message(MediaStream* aStream, MediaStreamListener* aListener) :
ControlMessage(aStream), mListener(aListener) {}
virtual void Run()
void Run() override
{
mStream->RemoveListenerImpl(mListener);
}
@ -2070,12 +2070,12 @@ MediaStream::RunAfterPendingUpdates(already_AddRefed<nsIRunnable> aRunnable)
already_AddRefed<nsIRunnable> aRunnable)
: ControlMessage(aStream)
, mRunnable(aRunnable) {}
virtual void Run() override
void Run() override
{
mStream->Graph()->
DispatchToMainThreadAfterStreamStateUpdate(mRunnable.forget());
}
virtual void RunDuringShutdown() override
void RunDuringShutdown() override
{
// Don't run mRunnable now as it may call AppendMessage() which would
// assume that there are no remaining controlMessagesToRunDuringShutdown.
@ -2108,7 +2108,7 @@ MediaStream::SetTrackEnabled(TrackID aTrackID, bool aEnabled)
public:
Message(MediaStream* aStream, TrackID aTrackID, bool aEnabled) :
ControlMessage(aStream), mTrackID(aTrackID), mEnabled(aEnabled) {}
virtual void Run()
void Run() override
{
mStream->SetTrackEnabledImpl(mTrackID, mEnabled);
}
@ -2316,7 +2316,7 @@ SourceMediaStream::NotifyListenersEvent(MediaStreamListener::MediaStreamGraphEve
public:
Message(SourceMediaStream* aStream, MediaStreamListener::MediaStreamGraphEvent aEvent) :
ControlMessage(aStream), mEvent(aEvent) {}
virtual void Run()
void Run() override
{
mStream->AsSourceStream()->NotifyListenersEventImpl(mEvent);
}
@ -2481,14 +2481,14 @@ MediaInputPort::Destroy()
public:
explicit Message(MediaInputPort* aPort)
: ControlMessage(nullptr), mPort(aPort) {}
virtual void Run()
void Run() override
{
mPort->Disconnect();
--mPort->GraphImpl()->mPortCount;
mPort->SetGraphImpl(nullptr);
NS_RELEASE(mPort);
}
virtual void RunDuringShutdown()
void RunDuringShutdown() override
{
Run();
}
@ -2530,11 +2530,11 @@ MediaInputPort::BlockTrackId(TrackID aTrackId)
explicit Message(MediaInputPort* aPort, TrackID aTrackId)
: ControlMessage(aPort->GetDestination()),
mPort(aPort), mTrackId(aTrackId) {}
virtual void Run()
void Run() override
{
mPort->BlockTrackIdImpl(mTrackId);
}
virtual void RunDuringShutdown()
void RunDuringShutdown() override
{
Run();
}
@ -2558,14 +2558,14 @@ ProcessedMediaStream::AllocateInputPort(MediaStream* aStream, TrackID aTrackID,
explicit Message(MediaInputPort* aPort)
: ControlMessage(aPort->GetDestination()),
mPort(aPort) {}
virtual void Run()
void Run() override
{
mPort->Init();
// The graph holds its reference implicitly
mPort->GraphImpl()->SetStreamOrderDirty();
Unused << mPort.forget();
}
virtual void RunDuringShutdown()
void RunDuringShutdown() override
{
Run();
}
@ -2589,7 +2589,7 @@ ProcessedMediaStream::Finish()
public:
explicit Message(ProcessedMediaStream* aStream)
: ControlMessage(aStream) {}
virtual void Run()
void Run() override
{
mStream->GraphImpl()->FinishStream(mStream);
}
@ -2604,7 +2604,7 @@ ProcessedMediaStream::SetAutofinish(bool aAutofinish)
public:
Message(ProcessedMediaStream* aStream, bool aAutofinish)
: ControlMessage(aStream), mAutofinish(aAutofinish) {}
virtual void Run()
void Run() override
{
static_cast<ProcessedMediaStream*>(mStream)->SetAutofinishImpl(mAutofinish);
}
@ -2919,7 +2919,7 @@ MediaStreamGraph::NotifyWhenGraphStarted(AudioNodeStream* aStream)
: ControlMessage(aStream)
{
}
virtual void Run()
void Run() override
{
// This runs on the graph thread, so when this runs, and the current
// driver is an AudioCallbackDriver, we know the audio hardware is
@ -2936,7 +2936,7 @@ MediaStreamGraph::NotifyWhenGraphStarted(AudioNodeStream* aStream)
NS_DispatchToMainThread(event.forget());
}
}
virtual void RunDuringShutdown()
void RunDuringShutdown() override
{
}
};
@ -3144,12 +3144,12 @@ MediaStreamGraph::ApplyAudioContextOperation(MediaStream* aDestinationStream,
, mPromise(aPromise)
{
}
virtual void Run()
void Run() override
{
mStream->GraphImpl()->ApplyAudioContextOperationImpl(mStream,
mStreams, mAudioContextOperation, mPromise);
}
virtual void RunDuringShutdown()
void RunDuringShutdown() override
{
MOZ_ASSERT(false, "We should be reviving the graph?");
}

View File

@ -698,10 +698,10 @@ public:
mNeedsMixing(false)
{}
virtual SourceMediaStream* AsSourceStream() override { return this; }
SourceMediaStream* AsSourceStream() override { return this; }
// Media graph thread only
virtual void DestroyImpl() override;
void DestroyImpl() override;
// Call these on any thread.
/**
@ -796,14 +796,14 @@ public:
}
// Overriding allows us to hold the mMutex lock while changing the track enable status
virtual void
void
SetTrackEnabledImpl(TrackID aTrackID, bool aEnabled) override {
MutexAutoLock lock(mMutex);
MediaStream::SetTrackEnabledImpl(aTrackID, aEnabled);
}
// Overriding allows us to ensure mMutex is locked while changing the track enable status
virtual void
void
ApplyTrackDisabling(TrackID aTrackID, MediaSegment* aSegment,
MediaSegment* aRawSegment = nullptr) override {
mMutex.AssertCurrentThreadOwns();
@ -1071,7 +1071,7 @@ public:
*/
void SetAutofinish(bool aAutofinish);
virtual ProcessedMediaStream* AsProcessedStream() override { return this; }
ProcessedMediaStream* AsProcessedStream() override { return this; }
friend class MediaStreamGraphImpl;
@ -1089,7 +1089,7 @@ public:
{
return mInputs.Length();
}
virtual void DestroyImpl() override;
void DestroyImpl() override;
/**
* This gets called after we've computed the blocking states for all
* streams (mBlocked is up to date up to mStateComputedTime).
@ -1117,7 +1117,7 @@ public:
// true for echo loops, only for muted cycles.
bool InMutedCycle() const { return mCycleMarker; }
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = MediaStream::SizeOfExcludingThis(aMallocSizeOf);
// Not owned:
@ -1126,7 +1126,7 @@ public:
return amount;
}
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -79,7 +79,7 @@ public:
// Get the RtspMediaResource pointer if this MediaResource is a
// RtspMediaResource. For calling Rtsp specific functions.
virtual RtspMediaResource* GetRtspPointer() override final {
RtspMediaResource* GetRtspPointer() override final {
return this;
}
@ -94,7 +94,7 @@ public:
// Even it is a live stream, as long as it provides valid timestamps,
// we tell state machine it's not a live stream.
virtual bool IsRealTime() override {
bool IsRealTime() override {
return !mHasTimestamp;
}
@ -124,29 +124,29 @@ public:
void DisablePlayoutDelay();
// dummy
virtual nsresult ReadAt(int64_t aOffset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override{
nsresult ReadAt(int64_t aOffset, char* aBuffer,
uint32_t aCount, uint32_t* aBytes) override{
return NS_ERROR_FAILURE;
}
// dummy
virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
// dummy
virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
// dummy
virtual int64_t Tell() override { return 0; }
int64_t Tell() override { return 0; }
// Any thread
virtual void Pin() override {}
virtual void Unpin() override {}
void Pin() override {}
void Unpin() override {}
virtual bool IsSuspendedByCache() override { return mIsSuspend; }
bool IsSuspendedByCache() override { return mIsSuspend; }
virtual bool IsSuspended() override { return false; }
virtual bool IsTransportSeekable() override { return true; }
bool IsSuspended() override { return false; }
bool IsTransportSeekable() override { return true; }
// dummy
virtual double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0; }
double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0; }
virtual int64_t GetLength() override {
int64_t GetLength() override {
if (mIsLiveStream) {
return -1;
}
@ -154,11 +154,11 @@ public:
}
// dummy
virtual int64_t GetNextCachedData(int64_t aOffset) override { return 0; }
int64_t GetNextCachedData(int64_t aOffset) override { return 0; }
// dummy
virtual int64_t GetCachedDataEnd(int64_t aOffset) override { return 0; }
int64_t GetCachedDataEnd(int64_t aOffset) override { return 0; }
// dummy
virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override {
bool IsDataCachedToEndOfResource(int64_t aOffset) override {
return false;
}
// dummy
@ -168,29 +168,26 @@ public:
// The following methods can be called on main thread only.
virtual nsresult Open(nsIStreamListener** aStreamListener) override;
virtual nsresult Close() override;
virtual void Suspend(bool aCloseImmediately) override;
virtual void Resume() override;
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
virtual bool CanClone() override {
nsresult Open(nsIStreamListener** aStreamListener) override;
nsresult Close() override;
void Suspend(bool aCloseImmediately) override;
void Resume() override;
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
bool CanClone() override {
return false;
}
virtual already_AddRefed<MediaResource> CloneData(MediaResourceCallback*)
override {
already_AddRefed<MediaResource> CloneData(MediaResourceCallback*) override {
return nullptr;
}
// dummy
virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset,
nsresult ReadFromCache(char* aBuffer, int64_t aOffset,
uint32_t aCount) override {
return NS_ERROR_FAILURE;
}
virtual size_t SizeOfExcludingThis(
MallocSizeOf aMallocSizeOf) const override;
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
virtual size_t SizeOfIncludingThis(
MallocSizeOf aMallocSizeOf) const override {
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override {
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -67,7 +67,7 @@ public:
return p.forget();
}
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -59,7 +59,7 @@ public:
void SetDefaultSettings();
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
TextTrackKind Kind() const
{

View File

@ -50,7 +50,7 @@ public:
const nsAString& aText, HTMLTrackElement* aTrackElement,
ErrorResult& aRv);
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
TextTrack* GetTrack() const
{

View File

@ -28,7 +28,7 @@ public:
// TextTrackCueList WebIDL
explicit TextTrackCueList(nsISupports* aParent);
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
nsISupports* GetParentObject() const
{

View File

@ -29,7 +29,7 @@ public:
explicit TextTrackList(nsPIDOMWindow* aOwnerWindow);
TextTrackList(nsPIDOMWindow* aOwnerWindow, TextTrackManager* aTextTrackManager);
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
uint32_t Length() const
{

View File

@ -35,7 +35,7 @@ public:
Preferences::GetBool("media.webvtt.regions.enabled");
}
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
nsISupports* GetParentObject() const
{

View File

@ -18,8 +18,8 @@ class TrackUnionStream : public ProcessedMediaStream {
public:
explicit TrackUnionStream(DOMMediaStream* aWrapper);
virtual void RemoveInput(MediaInputPort* aPort) override;
virtual void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
void RemoveInput(MediaInputPort* aPort) override;
void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
protected:
// Only non-ended tracks are allowed to persist in this map.

View File

@ -129,7 +129,7 @@ public:
return &c->mFrame;
}
// Override default impl
virtual void ReplaceWithDisabled() override {
void ReplaceWithDisabled() override {
for (ChunkIterator i(*this);
!i.IsEnded(); i.Next()) {
VideoChunk& chunk = *i;
@ -140,7 +140,7 @@ public:
// Segment-generic methods not in MediaSegmentBase
static Type StaticType() { return VIDEO; }
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -17,12 +17,12 @@ public:
VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID, const nsString& aLabel)
: MediaStreamTrack(aStream, aTrackID, aLabel) {}
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
virtual VideoStreamTrack* AsVideoStreamTrack() override { return this; }
VideoStreamTrack* AsVideoStreamTrack() override { return this; }
// WebIDL
virtual void GetKind(nsAString& aKind) override { aKind.AssignLiteral("video"); }
void GetKind(nsAString& aKind) override { aKind.AssignLiteral("video"); }
};
} // namespace dom

View File

@ -22,9 +22,9 @@ public:
const nsAString& aLabel,
const nsAString& aLanguage);
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
virtual VideoTrack* AsVideoTrack() override
VideoTrack* AsVideoTrack() override
{
return this;
}
@ -34,7 +34,7 @@ public:
// default. If multiple video tracks are selected by its media resource at
// fetching phase, then the first enabled video track is set selected.
// aFlags contains FIRE_NO_EVENTS because no events are fired in such cases.
virtual void SetEnabledInternal(bool aEnabled, int aFlags) override;
void SetEnabledInternal(bool aEnabled, int aFlags) override;
// WebIDL
bool Selected() const

View File

@ -23,11 +23,11 @@ public:
, mSelectedIndex(-1)
{}
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
VideoTrack* operator[](uint32_t aIndex);
virtual void EmptyTracks() override;
void EmptyTracks() override;
// WebIDL
int32_t SelectedIndex() const
@ -42,7 +42,7 @@ public:
friend class VideoTrack;
protected:
virtual VideoTrackList* AsVideoTrackList() override { return this; }
VideoTrackList* AsVideoTrackList() override { return this; }
private:
int32_t mSelectedIndex;

View File

@ -17,15 +17,10 @@ class AndroidMediaDecoder : public MediaDecoder
public:
AndroidMediaDecoder(MediaDecoderOwner* aOwner, const nsACString& aType);
nsresult GetContentType(nsACString& aType) const {
aType = mType;
return NS_OK;
}
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) {
MediaDecoder* Clone(MediaDecoderOwner* aOwner) override {
return new AndroidMediaDecoder(aOwner, mType);
}
virtual MediaDecoderStateMachine* CreateStateMachine();
MediaDecoderStateMachine* CreateStateMachine() override;
};
} // namespace mozilla

View File

@ -42,18 +42,15 @@ public:
AndroidMediaReader(AbstractMediaDecoder* aDecoder,
const nsACString& aContentType);
virtual nsresult ResetDecode();
nsresult ResetDecode() override;
virtual bool DecodeAudioData();
virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
int64_t aTimeThreshold);
bool DecodeAudioData() override;
bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override;
virtual nsresult ReadMetadata(MediaInfo* aInfo,
MetadataTags** aTags);
virtual RefPtr<SeekPromise>
Seek(int64_t aTime, int64_t aEndTime) override;
nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override;
RefPtr<SeekPromise> Seek(int64_t aTime, int64_t aEndTime) override;
virtual RefPtr<ShutdownPromise> Shutdown() override;
RefPtr<ShutdownPromise> Shutdown() override;
class ImageBufferCallback : public MPAPI::BufferCallback {
typedef mozilla::layers::Image Image;

View File

@ -17,43 +17,43 @@ namespace mozilla {
// object on the main thread.
class CDMCallbackProxy : public GMPDecryptorProxyCallback {
public:
virtual void SetSessionId(uint32_t aCreateSessionToken,
const nsCString& aSessionId) override;
void SetSessionId(uint32_t aCreateSessionToken,
const nsCString& aSessionId) override;
virtual void ResolveLoadSessionPromise(uint32_t aPromiseId,
bool aSuccess) override;
void ResolveLoadSessionPromise(uint32_t aPromiseId,
bool aSuccess) override;
virtual void ResolvePromise(uint32_t aPromiseId) override;
void ResolvePromise(uint32_t aPromiseId) override;
virtual void RejectPromise(uint32_t aPromiseId,
nsresult aException,
const nsCString& aSessionId) override;
void RejectPromise(uint32_t aPromiseId,
nsresult aException,
const nsCString& aSessionId) override;
virtual void SessionMessage(const nsCString& aSessionId,
GMPSessionMessageType aMessageType,
const nsTArray<uint8_t>& aMessage) override;
void SessionMessage(const nsCString& aSessionId,
GMPSessionMessageType aMessageType,
const nsTArray<uint8_t>& aMessage) override;
virtual void ExpirationChange(const nsCString& aSessionId,
GMPTimestamp aExpiryTime) override;
void ExpirationChange(const nsCString& aSessionId,
GMPTimestamp aExpiryTime) override;
virtual void SessionClosed(const nsCString& aSessionId) override;
void SessionClosed(const nsCString& aSessionId) override;
virtual void SessionError(const nsCString& aSessionId,
nsresult aException,
uint32_t aSystemCode,
const nsCString& aMessage) override;
void SessionError(const nsCString& aSessionId,
nsresult aException,
uint32_t aSystemCode,
const nsCString& aMessage) override;
virtual void KeyStatusChanged(const nsCString& aSessionId,
const nsTArray<uint8_t>& aKeyId,
GMPMediaKeyStatus aStatus) override;
void KeyStatusChanged(const nsCString& aSessionId,
const nsTArray<uint8_t>& aKeyId,
GMPMediaKeyStatus aStatus) override;
virtual void SetCaps(uint64_t aCaps) override;
void SetCaps(uint64_t aCaps) override;
virtual void Decrypted(uint32_t aId,
GMPErr aResult,
const nsTArray<uint8_t>& aDecryptedData) override;
void Decrypted(uint32_t aId,
GMPErr aResult,
const nsTArray<uint8_t>& aDecryptedData) override;
virtual void Terminated() override;
void Terminated() override;
~CDMCallbackProxy() {}

View File

@ -36,7 +36,7 @@ protected:
public:
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<MediaEncryptedEvent>
Constructor(EventTarget* aOwner);

View File

@ -24,7 +24,7 @@ public:
MediaKeyError(EventTarget* aOwner, uint32_t aSystemCode);
~MediaKeyError();
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
uint32_t SystemCode() const;

View File

@ -37,7 +37,7 @@ protected:
public:
virtual MediaKeyMessageEvent* AsMediaKeyMessageEvent();
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<MediaKeyMessageEvent>
Constructor(EventTarget* aOwner,

View File

@ -47,7 +47,7 @@ public:
void SetSessionId(const nsAString& aSessionId);
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
// Mark this as resultNotAddRefed to return raw pointers
MediaKeyError* GetError() const;

View File

@ -42,7 +42,7 @@ protected:
public:
nsPIDOMWindow* GetParentObject() const;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
MediaKeyStatus Get(const ArrayBufferViewOrArrayBuffer& aKey) const;
bool Has(const ArrayBufferViewOrArrayBuffer& aKey) const;

View File

@ -40,7 +40,7 @@ protected:
public:
nsPIDOMWindow* GetParentObject() const;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
void GetKeySystem(nsString& aRetVal) const;

View File

@ -52,7 +52,7 @@ public:
nsPIDOMWindow* GetParentObject() const;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
nsresult Bind(HTMLMediaElement* aElement);
void Unbind();

View File

@ -82,18 +82,18 @@ public :
* Notified by the control loop of MediaStreamGraph; aQueueMedia is the raw
* track data in form of MediaSegment.
*/
virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
StreamTime aTrackOffset,
uint32_t aTrackEvents,
const MediaSegment& aQueuedMedia,
MediaStream* aInputStream,
TrackID aInputTrackID) override;
void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
StreamTime aTrackOffset,
uint32_t aTrackEvents,
const MediaSegment& aQueuedMedia,
MediaStream* aInputStream,
TrackID aInputTrackID) override;
/**
* Notified the stream is being removed.
*/
virtual void NotifyEvent(MediaStreamGraph* aGraph,
MediaStreamListener::MediaStreamGraphEvent event) override;
void NotifyEvent(MediaStreamGraph* aGraph,
MediaStreamListener::MediaStreamGraphEvent event) override;
/**
* Creates an encoder with a given MIME type. Returns null if we are unable

View File

@ -146,10 +146,10 @@ public:
, mAudioBitrate(0)
{}
virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
StreamTime aTrackOffset,
uint32_t aTrackEvents,
const MediaSegment& aQueuedMedia) override;
void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
StreamTime aTrackOffset,
uint32_t aTrackEvents,
const MediaSegment& aQueuedMedia) override;
template<typename T>
static
@ -194,7 +194,7 @@ public:
*/
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
virtual void SetBitrate(const uint32_t aBitrate) override
void SetBitrate(const uint32_t aBitrate) override
{
mAudioBitrate = aBitrate;
}
@ -227,7 +227,7 @@ protected:
* Notifies the audio encoder that we have reached the end of source stream,
* and wakes up mReentrantMonitor if encoder is waiting for more track data.
*/
virtual void NotifyEndOfStream() override;
void NotifyEndOfStream() override;
/**
* The number of channels are used for processing PCM data in the audio encoder.
@ -268,16 +268,16 @@ public:
* Notified by the same callback of MediaEncoder when it has received a track
* change from MediaStreamGraph. Called on the MediaStreamGraph thread.
*/
virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
StreamTime aTrackOffset,
uint32_t aTrackEvents,
const MediaSegment& aQueuedMedia) override;
void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
StreamTime aTrackOffset,
uint32_t aTrackEvents,
const MediaSegment& aQueuedMedia) override;
/**
* Measure size of mRawSegment
*/
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
virtual void SetBitrate(const uint32_t aBitrate) override
void SetBitrate(const uint32_t aBitrate) override
{
mVideoBitrate = aBitrate;
}
@ -303,7 +303,7 @@ protected:
* and wakes up mReentrantMonitor if encoder is waiting for more track data.
* Called on the MediaStreamGraph thread.
*/
virtual void NotifyEndOfStream() override;
void NotifyEndOfStream() override;
/**
* The width of source video frame, ceiled if the source width is odd.

View File

@ -6,7 +6,6 @@
#include "MP4Decoder.h"
#include "MediaDecoderStateMachine.h"
#include "MediaFormatReader.h"
#include "MP4Demuxer.h"
#include "mozilla/Preferences.h"
#include "nsCharSeparatedTokenizer.h"
@ -47,12 +46,12 @@ MP4Decoder::MP4Decoder(MediaDecoderOwner* aOwner)
MediaDecoderStateMachine* MP4Decoder::CreateStateMachine()
{
MediaDecoderReader* reader =
mReader =
new MediaFormatReader(this,
new MP4Demuxer(GetResource()),
GetVideoFrameContainer());
return new MediaDecoderStateMachine(this, reader);
return new MediaDecoderStateMachine(this, mReader);
}
static bool
@ -227,4 +226,12 @@ MP4Decoder::IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aFail
return result;
}
void
MP4Decoder::GetMozDebugReaderData(nsAString& aString)
{
if (mReader) {
mReader->GetMozDebugReaderData(aString);
}
}
} // namespace mozilla

View File

@ -7,6 +7,7 @@
#define MP4Decoder_h_
#include "MediaDecoder.h"
#include "MediaFormatReader.h"
namespace mozilla {
@ -16,14 +17,14 @@ class MP4Decoder : public MediaDecoder
public:
explicit MP4Decoder(MediaDecoderOwner* aOwner);
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override {
MediaDecoder* Clone(MediaDecoderOwner* aOwner) override {
if (!IsEnabled()) {
return nullptr;
}
return new MP4Decoder(aOwner);
}
virtual MediaDecoderStateMachine* CreateStateMachine() override;
MediaDecoderStateMachine* CreateStateMachine() override;
// Returns true if aMIMEType is a type that we think we can render with the
// a MP4 platform decoder backend. If aCodecs is non emtpy, it is filled
@ -38,6 +39,11 @@ public:
static bool IsEnabled();
static bool IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aReason);
void GetMozDebugReaderData(nsAString& aString) override;
private:
RefPtr<MediaFormatReader> mReader;
};
} // namespace mozilla

View File

@ -34,21 +34,21 @@ public:
UniquePtr<TrackInfo>&& aInfo,
const nsTArray<mp4_demuxer::Index::Indice>& indices);
virtual UniquePtr<TrackInfo> GetInfo() const override;
UniquePtr<TrackInfo> GetInfo() const override;
virtual RefPtr<SeekPromise> Seek(media::TimeUnit aTime) override;
RefPtr<SeekPromise> Seek(media::TimeUnit aTime) override;
virtual RefPtr<SamplesPromise> GetSamples(int32_t aNumSamples = 1) override;
RefPtr<SamplesPromise> GetSamples(int32_t aNumSamples = 1) override;
virtual void Reset() override;
void Reset() override;
virtual nsresult GetNextRandomAccessPoint(media::TimeUnit* aTime) override;
nsresult GetNextRandomAccessPoint(media::TimeUnit* aTime) override;
RefPtr<SkipAccessPointPromise> SkipToNextRandomAccessPoint(media::TimeUnit aTimeThreshold) override;
virtual media::TimeIntervals GetBuffered() override;
media::TimeIntervals GetBuffered() override;
virtual void BreakCycles() override;
void BreakCycles() override;
private:
friend class MP4Demuxer;

View File

@ -27,22 +27,22 @@ class MP4Demuxer : public MediaDataDemuxer
public:
explicit MP4Demuxer(MediaResource* aResource);
virtual RefPtr<InitPromise> Init() override;
RefPtr<InitPromise> Init() override;
virtual bool HasTrackType(TrackInfo::TrackType aType) const override;
bool HasTrackType(TrackInfo::TrackType aType) const override;
virtual uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override;
uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override;
virtual already_AddRefed<MediaTrackDemuxer> GetTrackDemuxer(TrackInfo::TrackType aType,
uint32_t aTrackNumber) override;
already_AddRefed<MediaTrackDemuxer> GetTrackDemuxer(TrackInfo::TrackType aType,
uint32_t aTrackNumber) override;
virtual bool IsSeekable() const override;
bool IsSeekable() const override;
virtual UniquePtr<EncryptionInfo> GetCrypto() override;
UniquePtr<EncryptionInfo> GetCrypto() override;
virtual void NotifyDataArrived() override;
void NotifyDataArrived() override;
virtual void NotifyDataRemoved() override;
void NotifyDataRemoved() override;
private:
friend class MP4TrackDemuxer;

View File

@ -24,11 +24,11 @@ public:
explicit MP4Stream(MediaResource* aResource);
virtual ~MP4Stream();
bool BlockingReadIntoCache(int64_t aOffset, size_t aCount, Monitor* aToUnlock);
virtual bool ReadAt(int64_t aOffset, void* aBuffer, size_t aCount,
size_t* aBytesRead) override;
virtual bool CachedReadAt(int64_t aOffset, void* aBuffer, size_t aCount,
size_t* aBytesRead) override;
virtual bool Length(int64_t* aSize) override;
bool ReadAt(int64_t aOffset, void* aBuffer, size_t aCount,
size_t* aBytesRead) override;
bool CachedReadAt(int64_t aOffset, void* aBuffer, size_t aCount,
size_t* aBytesRead) override;
bool Length(int64_t* aSize) override;
struct ReadRecord {
ReadRecord(int64_t aOffset, size_t aCount) : mOffset(aOffset), mCount(aCount) {}

View File

@ -16,56 +16,56 @@ public:
explicit FakeDecryptor(GMPDecryptorHost* aHost);
virtual void Init(GMPDecryptorCallback* aCallback) override {
void Init(GMPDecryptorCallback* aCallback) override {
mCallback = aCallback;
}
virtual void CreateSession(uint32_t aCreateSessionToken,
uint32_t aPromiseId,
const char* aInitDataType,
uint32_t aInitDataTypeSize,
const uint8_t* aInitData,
uint32_t aInitDataSize,
GMPSessionType aSessionType) override
void CreateSession(uint32_t aCreateSessionToken,
uint32_t aPromiseId,
const char* aInitDataType,
uint32_t aInitDataTypeSize,
const uint8_t* aInitData,
uint32_t aInitDataSize,
GMPSessionType aSessionType) override
{
}
virtual void LoadSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength) override
void LoadSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength) override
{
}
virtual void UpdateSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength,
const uint8_t* aResponse,
uint32_t aResponseSize) override;
void UpdateSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength,
const uint8_t* aResponse,
uint32_t aResponseSize) override;
virtual void CloseSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength) override
void CloseSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength) override
{
}
virtual void RemoveSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength) override
void RemoveSession(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdLength) override
{
}
virtual void SetServerCertificate(uint32_t aPromiseId,
const uint8_t* aServerCert,
uint32_t aServerCertSize) override
void SetServerCertificate(uint32_t aPromiseId,
const uint8_t* aServerCert,
uint32_t aServerCertSize) override
{
}
virtual void Decrypt(GMPBuffer* aBuffer,
GMPEncryptedBufferMetadata* aMetadata) override
void Decrypt(GMPBuffer* aBuffer,
GMPEncryptedBufferMetadata* aMetadata) override
{
}
virtual void DecryptingComplete() override;
void DecryptingComplete() override;
static void Message(const std::string& aMessage);
@ -89,7 +89,7 @@ public:
: mHost(aHost)
{
}
virtual void BeginShutdown() override;
void BeginShutdown() override;
private:
GMPAsyncShutdownHost* mHost;
};

View File

@ -23,7 +23,7 @@ public:
return mRecord->Open();
}
virtual void OpenComplete(GMPErr aStatus) override {
void OpenComplete(GMPErr aStatus) override {
if (GMP_SUCCEEDED(aStatus)) {
mRecord->Write(mData.size() ? &mData.front() : nullptr, mData.size());
} else {
@ -32,11 +32,11 @@ public:
}
}
virtual void ReadComplete(GMPErr aStatus,
const uint8_t* aData,
uint32_t aDataSize) override {}
void ReadComplete(GMPErr aStatus,
const uint8_t* aData,
uint32_t aDataSize) override {}
virtual void WriteComplete(GMPErr aStatus) override {
void WriteComplete(GMPErr aStatus) override {
// Note: Call Close() before running continuation, in case the
// continuation tries to open the same record; if we call Close()
// after running the continuation, the Close() call will arrive
@ -103,7 +103,7 @@ public:
return mRecord->Open();
}
virtual void OpenComplete(GMPErr aStatus) override {
void OpenComplete(GMPErr aStatus) override {
auto err = mRecord->Read();
if (GMP_FAILED(err)) {
mContinuation->ReadComplete(err, "");
@ -111,9 +111,9 @@ public:
}
}
virtual void ReadComplete(GMPErr aStatus,
const uint8_t* aData,
uint32_t aDataSize) override {
void ReadComplete(GMPErr aStatus,
const uint8_t* aData,
uint32_t aDataSize) override {
// Note: Call Close() before running continuation, in case the
// continuation tries to open the same record; if we call Close()
// after running the continuation, the Close() call will arrive
@ -125,7 +125,7 @@ public:
delete this;
}
virtual void WriteComplete(GMPErr aStatus) override {
void WriteComplete(GMPErr aStatus) override {
}
private:
@ -181,17 +181,17 @@ public:
(new OpenRecordClient(aContinuation))->Do(aRecordName);
}
virtual void OpenComplete(GMPErr aStatus) override {
void OpenComplete(GMPErr aStatus) override {
Done(aStatus);
}
virtual void ReadComplete(GMPErr aStatus,
const uint8_t* aData,
uint32_t aDataSize) override {
void ReadComplete(GMPErr aStatus,
const uint8_t* aData,
uint32_t aDataSize) override {
MOZ_CRASH("Should not reach here.");
}
virtual void WriteComplete(GMPErr aStatus) override {
void WriteComplete(GMPErr aStatus) override {
MOZ_CRASH("Should not reach here.");
}

View File

@ -26,19 +26,19 @@ public:
GMPAudioHostImpl& Host();
// GMPAudioDecoderCallback
virtual void Decoded(GMPAudioSamples* aEncodedSamples) override;
virtual void InputDataExhausted() override;
virtual void DrainComplete() override;
virtual void ResetComplete() override;
virtual void Error(GMPErr aError) override;
void Decoded(GMPAudioSamples* aEncodedSamples) override;
void InputDataExhausted() override;
void DrainComplete() override;
void ResetComplete() override;
void Error(GMPErr aError) override;
private:
// PGMPAudioDecoderChild
virtual bool RecvInitDecode(const GMPAudioCodecData& codecSettings) override;
virtual bool RecvDecode(const GMPAudioEncodedSampleData& input) override;
virtual bool RecvReset() override;
virtual bool RecvDrain() override;
virtual bool RecvDecodingComplete() override;
bool RecvInitDecode(const GMPAudioCodecData& codecSettings) override;
bool RecvDecode(const GMPAudioEncodedSampleData& input) override;
bool RecvReset() override;
bool RecvDrain() override;
bool RecvDecodingComplete() override;
GMPContentChild* mPlugin;
GMPAudioDecoder* mAudioDecoder;

View File

@ -29,29 +29,29 @@ public:
nsresult Shutdown();
// GMPAudioDecoderProxy
virtual nsresult InitDecode(GMPAudioCodecType aCodecType,
uint32_t aChannelCount,
uint32_t aBitsPerChannel,
uint32_t aSamplesPerSecond,
nsTArray<uint8_t>& aExtraData,
GMPAudioDecoderCallbackProxy* aCallback) override;
virtual nsresult Decode(GMPAudioSamplesImpl& aInput) override;
virtual nsresult Reset() override;
virtual nsresult Drain() override;
virtual nsresult Close() override;
nsresult InitDecode(GMPAudioCodecType aCodecType,
uint32_t aChannelCount,
uint32_t aBitsPerChannel,
uint32_t aSamplesPerSecond,
nsTArray<uint8_t>& aExtraData,
GMPAudioDecoderCallbackProxy* aCallback) override;
nsresult Decode(GMPAudioSamplesImpl& aInput) override;
nsresult Reset() override;
nsresult Drain() override;
nsresult Close() override;
private:
~GMPAudioDecoderParent();
// PGMPAudioDecoderParent
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual bool RecvDecoded(const GMPAudioDecodedSampleData& aDecoded) override;
virtual bool RecvInputDataExhausted() override;
virtual bool RecvDrainComplete() override;
virtual bool RecvResetComplete() override;
virtual bool RecvError(const GMPErr& aError) override;
virtual bool RecvShutdown() override;
virtual bool Recv__delete__() override;
void ActorDestroy(ActorDestroyReason aWhy) override;
bool RecvDecoded(const GMPAudioDecodedSampleData& aDecoded) override;
bool RecvInputDataExhausted() override;
bool RecvDrainComplete() override;
bool RecvResetComplete() override;
bool RecvError(const GMPErr& aError) override;
bool RecvShutdown() override;
bool Recv__delete__() override;
void UnblockResetAndDrain();

View File

@ -29,24 +29,24 @@ public:
uint32_t aRate);
virtual ~GMPAudioSamplesImpl();
virtual GMPAudioFormat GetFormat() override;
virtual void Destroy() override;
virtual GMPErr SetBufferSize(uint32_t aSize) override;
virtual uint32_t Size() override;
virtual void SetTimeStamp(uint64_t aTimeStamp) override;
virtual uint64_t TimeStamp() override;
virtual const uint8_t* Buffer() const override;
virtual uint8_t* Buffer() override;
virtual const GMPEncryptedBufferMetadata* GetDecryptionData() const override;
GMPAudioFormat GetFormat() override;
void Destroy() override;
GMPErr SetBufferSize(uint32_t aSize) override;
uint32_t Size() override;
void SetTimeStamp(uint64_t aTimeStamp) override;
uint64_t TimeStamp() override;
const uint8_t* Buffer() const override;
uint8_t* Buffer() override;
const GMPEncryptedBufferMetadata* GetDecryptionData() const override;
void InitCrypto(const CryptoSample& aCrypto);
void RelinquishData(GMPAudioEncodedSampleData& aData);
virtual uint32_t Channels() const override;
virtual void SetChannels(uint32_t aChannels) override;
virtual uint32_t Rate() const override;
virtual void SetRate(uint32_t aRate) override;
uint32_t Channels() const override;
void SetChannels(uint32_t aChannels) override;
uint32_t Rate() const override;
void SetRate(uint32_t aRate) override;
private:
GMPAudioFormat mFormat;
@ -60,8 +60,8 @@ private:
class GMPAudioHostImpl : public GMPAudioHost
{
public:
virtual GMPErr CreateSamples(GMPAudioFormat aFormat,
GMPAudioSamples** aSamples) override;
GMPErr CreateSamples(GMPAudioFormat aFormat,
GMPAudioSamples** aSamples) override;
private:
};

View File

@ -55,28 +55,28 @@ private:
bool GetUTF8LibPath(nsACString& aOutLibPath);
virtual bool RecvSetNodeId(const nsCString& aNodeId) override;
virtual bool AnswerStartPlugin() override;
bool RecvSetNodeId(const nsCString& aNodeId) override;
bool AnswerStartPlugin() override;
virtual PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) override;
virtual bool DeallocPCrashReporterChild(PCrashReporterChild*) override;
PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) override;
bool DeallocPCrashReporterChild(PCrashReporterChild*) override;
virtual PGMPTimerChild* AllocPGMPTimerChild() override;
virtual bool DeallocPGMPTimerChild(PGMPTimerChild* aActor) override;
PGMPTimerChild* AllocPGMPTimerChild() override;
bool DeallocPGMPTimerChild(PGMPTimerChild* aActor) override;
virtual PGMPStorageChild* AllocPGMPStorageChild() override;
virtual bool DeallocPGMPStorageChild(PGMPStorageChild* aActor) override;
PGMPStorageChild* AllocPGMPStorageChild() override;
bool DeallocPGMPStorageChild(PGMPStorageChild* aActor) override;
virtual PGMPContentChild* AllocPGMPContentChild(Transport* aTransport,
ProcessId aOtherPid) override;
PGMPContentChild* AllocPGMPContentChild(Transport* aTransport,
ProcessId aOtherPid) override;
void GMPContentChildActorDestroy(GMPContentChild* aGMPContentChild);
virtual bool RecvCrashPluginNow() override;
virtual bool RecvBeginAsyncShutdown() override;
virtual bool RecvCloseActive() override;
bool RecvCrashPluginNow() override;
bool RecvBeginAsyncShutdown() override;
bool RecvCloseActive() override;
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual void ProcessingError(Result aCode, const char* aReason) override;
void ActorDestroy(ActorDestroyReason aWhy) override;
void ProcessingError(Result aCode, const char* aReason) override;
GMPErr GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI);

View File

@ -23,28 +23,28 @@ public:
MessageLoop* GMPMessageLoop();
virtual bool RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor) override;
virtual bool RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) override;
virtual bool RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor) override;
virtual bool RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor) override;
bool RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor) override;
bool RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) override;
bool RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor) override;
bool RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor) override;
virtual PGMPAudioDecoderChild* AllocPGMPAudioDecoderChild() override;
virtual bool DeallocPGMPAudioDecoderChild(PGMPAudioDecoderChild* aActor) override;
PGMPAudioDecoderChild* AllocPGMPAudioDecoderChild() override;
bool DeallocPGMPAudioDecoderChild(PGMPAudioDecoderChild* aActor) override;
virtual PGMPDecryptorChild* AllocPGMPDecryptorChild() override;
virtual bool DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor) override;
PGMPDecryptorChild* AllocPGMPDecryptorChild() override;
bool DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor) override;
virtual PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild() override;
virtual bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) override;
PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild() override;
bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) override;
virtual PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() override;
virtual bool DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor) override;
PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() override;
bool DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor) override;
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual void ProcessingError(Result aCode, const char* aReason) override;
void ActorDestroy(ActorDestroyReason aWhy) override;
void ProcessingError(Result aCode, const char* aReason) override;
// GMPSharedMem
virtual void CheckThread() override;
void CheckThread() override;
void CloseActive();
bool IsUsed();

View File

@ -42,7 +42,7 @@ public:
nsIThread* GMPThread();
// GMPSharedMem
virtual void CheckThread() override;
void CheckThread() override;
void SetDisplayName(const nsCString& aDisplayName)
{
@ -64,19 +64,19 @@ public:
private:
~GMPContentParent();
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
void ActorDestroy(ActorDestroyReason aWhy) override;
virtual PGMPVideoDecoderParent* AllocPGMPVideoDecoderParent() override;
virtual bool DeallocPGMPVideoDecoderParent(PGMPVideoDecoderParent* aActor) override;
PGMPVideoDecoderParent* AllocPGMPVideoDecoderParent() override;
bool DeallocPGMPVideoDecoderParent(PGMPVideoDecoderParent* aActor) override;
virtual PGMPVideoEncoderParent* AllocPGMPVideoEncoderParent() override;
virtual bool DeallocPGMPVideoEncoderParent(PGMPVideoEncoderParent* aActor) override;
PGMPVideoEncoderParent* AllocPGMPVideoEncoderParent() override;
bool DeallocPGMPVideoEncoderParent(PGMPVideoEncoderParent* aActor) override;
virtual PGMPDecryptorParent* AllocPGMPDecryptorParent() override;
virtual bool DeallocPGMPDecryptorParent(PGMPDecryptorParent* aActor) override;
PGMPDecryptorParent* AllocPGMPDecryptorParent() override;
bool DeallocPGMPDecryptorParent(PGMPDecryptorParent* aActor) override;
virtual PGMPAudioDecoderParent* AllocPGMPAudioDecoderParent() override;
virtual bool DeallocPGMPAudioDecoderParent(PGMPAudioDecoderParent* aActor) override;
PGMPAudioDecoderParent* AllocPGMPAudioDecoderParent() override;
bool DeallocPGMPAudioDecoderParent(PGMPAudioDecoderParent* aActor) override;
void CloseIfUnused();
// Needed because NS_NewRunnableMethod tried to use the class that the method

View File

@ -31,88 +31,88 @@ public:
void Init(GMPDecryptor* aSession);
// GMPDecryptorCallback
virtual void SetSessionId(uint32_t aCreateSessionToken,
const char* aSessionId,
uint32_t aSessionIdLength) override;
virtual void ResolveLoadSessionPromise(uint32_t aPromiseId,
bool aSuccess) override;
virtual void ResolvePromise(uint32_t aPromiseId) override;
void SetSessionId(uint32_t aCreateSessionToken,
const char* aSessionId,
uint32_t aSessionIdLength) override;
void ResolveLoadSessionPromise(uint32_t aPromiseId,
bool aSuccess) override;
void ResolvePromise(uint32_t aPromiseId) override;
virtual void RejectPromise(uint32_t aPromiseId,
GMPDOMException aException,
const char* aMessage,
uint32_t aMessageLength) override;
void RejectPromise(uint32_t aPromiseId,
GMPDOMException aException,
const char* aMessage,
uint32_t aMessageLength) override;
virtual void SessionMessage(const char* aSessionId,
uint32_t aSessionIdLength,
GMPSessionMessageType aMessageType,
const uint8_t* aMessage,
uint32_t aMessageLength) override;
void SessionMessage(const char* aSessionId,
uint32_t aSessionIdLength,
GMPSessionMessageType aMessageType,
const uint8_t* aMessage,
uint32_t aMessageLength) override;
virtual void ExpirationChange(const char* aSessionId,
uint32_t aSessionIdLength,
GMPTimestamp aExpiryTime) override;
void ExpirationChange(const char* aSessionId,
uint32_t aSessionIdLength,
GMPTimestamp aExpiryTime) override;
virtual void SessionClosed(const char* aSessionId,
uint32_t aSessionIdLength) override;
void SessionClosed(const char* aSessionId,
uint32_t aSessionIdLength) override;
virtual void SessionError(const char* aSessionId,
uint32_t aSessionIdLength,
GMPDOMException aException,
uint32_t aSystemCode,
const char* aMessage,
uint32_t aMessageLength) override;
void SessionError(const char* aSessionId,
uint32_t aSessionIdLength,
GMPDOMException aException,
uint32_t aSystemCode,
const char* aMessage,
uint32_t aMessageLength) override;
virtual void KeyStatusChanged(const char* aSessionId,
uint32_t aSessionIdLength,
const uint8_t* aKeyId,
uint32_t aKeyIdLength,
GMPMediaKeyStatus aStatus) override;
void KeyStatusChanged(const char* aSessionId,
uint32_t aSessionIdLength,
const uint8_t* aKeyId,
uint32_t aKeyIdLength,
GMPMediaKeyStatus aStatus) override;
virtual void SetCapabilities(uint64_t aCaps) override;
void SetCapabilities(uint64_t aCaps) override;
virtual void Decrypted(GMPBuffer* aBuffer, GMPErr aResult) override;
void Decrypted(GMPBuffer* aBuffer, GMPErr aResult) override;
// GMPDecryptorHost
virtual void GetSandboxVoucher(const uint8_t** aVoucher,
uint32_t* aVoucherLength) override;
void GetSandboxVoucher(const uint8_t** aVoucher,
uint32_t* aVoucherLength) override;
virtual void GetPluginVoucher(const uint8_t** aVoucher,
uint32_t* aVoucherLength) override;
void GetPluginVoucher(const uint8_t** aVoucher,
uint32_t* aVoucherLength) override;
private:
~GMPDecryptorChild();
// GMPDecryptorChild
virtual bool RecvInit() override;
bool RecvInit() override;
virtual bool RecvCreateSession(const uint32_t& aCreateSessionToken,
const uint32_t& aPromiseId,
const nsCString& aInitDataType,
InfallibleTArray<uint8_t>&& aInitData,
const GMPSessionType& aSessionType) override;
bool RecvCreateSession(const uint32_t& aCreateSessionToken,
const uint32_t& aPromiseId,
const nsCString& aInitDataType,
InfallibleTArray<uint8_t>&& aInitData,
const GMPSessionType& aSessionType) override;
virtual bool RecvLoadSession(const uint32_t& aPromiseId,
const nsCString& aSessionId) override;
bool RecvLoadSession(const uint32_t& aPromiseId,
const nsCString& aSessionId) override;
virtual bool RecvUpdateSession(const uint32_t& aPromiseId,
const nsCString& aSessionId,
InfallibleTArray<uint8_t>&& aResponse) override;
bool RecvUpdateSession(const uint32_t& aPromiseId,
const nsCString& aSessionId,
InfallibleTArray<uint8_t>&& aResponse) override;
virtual bool RecvCloseSession(const uint32_t& aPromiseId,
const nsCString& aSessionId) override;
bool RecvCloseSession(const uint32_t& aPromiseId,
const nsCString& aSessionId) override;
virtual bool RecvRemoveSession(const uint32_t& aPromiseId,
const nsCString& aSessionId) override;
bool RecvRemoveSession(const uint32_t& aPromiseId,
const nsCString& aSessionId) override;
virtual bool RecvDecrypt(const uint32_t& aId,
InfallibleTArray<uint8_t>&& aBuffer,
const GMPDecryptionData& aMetadata) override;
bool RecvDecrypt(const uint32_t& aId,
InfallibleTArray<uint8_t>&& aBuffer,
const GMPDecryptionData& aMetadata) override;
// Resolve/reject promise on completion.
virtual bool RecvSetServerCertificate(const uint32_t& aPromiseId,
InfallibleTArray<uint8_t>&& aServerCert) override;
bool RecvSetServerCertificate(const uint32_t& aPromiseId,
InfallibleTArray<uint8_t>&& aServerCert) override;
virtual bool RecvDecryptingComplete() override;
bool RecvDecryptingComplete() override;
template <typename MethodType, typename... ParamType>
void CallMethod(MethodType, ParamType&&...);

View File

@ -29,37 +29,37 @@ public:
// GMPDecryptorProxy
virtual uint32_t GetPluginId() const override { return mPluginId; }
uint32_t GetPluginId() const override { return mPluginId; }
virtual nsresult Init(GMPDecryptorProxyCallback* aCallback) override;
nsresult Init(GMPDecryptorProxyCallback* aCallback) override;
virtual void CreateSession(uint32_t aCreateSessionToken,
uint32_t aPromiseId,
const nsCString& aInitDataType,
const nsTArray<uint8_t>& aInitData,
GMPSessionType aSessionType) override;
void CreateSession(uint32_t aCreateSessionToken,
uint32_t aPromiseId,
const nsCString& aInitDataType,
const nsTArray<uint8_t>& aInitData,
GMPSessionType aSessionType) override;
virtual void LoadSession(uint32_t aPromiseId,
const nsCString& aSessionId) override;
void LoadSession(uint32_t aPromiseId,
const nsCString& aSessionId) override;
virtual void UpdateSession(uint32_t aPromiseId,
const nsCString& aSessionId,
const nsTArray<uint8_t>& aResponse) override;
void UpdateSession(uint32_t aPromiseId,
const nsCString& aSessionId,
const nsTArray<uint8_t>& aResponse) override;
virtual void CloseSession(uint32_t aPromiseId,
const nsCString& aSessionId) override;
void CloseSession(uint32_t aPromiseId,
const nsCString& aSessionId) override;
virtual void RemoveSession(uint32_t aPromiseId,
const nsCString& aSessionId) override;
void RemoveSession(uint32_t aPromiseId,
const nsCString& aSessionId) override;
virtual void SetServerCertificate(uint32_t aPromiseId,
const nsTArray<uint8_t>& aServerCert) override;
void SetServerCertificate(uint32_t aPromiseId,
const nsTArray<uint8_t>& aServerCert) override;
virtual void Decrypt(uint32_t aId,
const CryptoSample& aCrypto,
const nsTArray<uint8_t>& aBuffer) override;
void Decrypt(uint32_t aId,
const CryptoSample& aCrypto,
const nsTArray<uint8_t>& aBuffer) override;
virtual void Close() override;
void Close() override;
void Shutdown();
@ -68,46 +68,46 @@ private:
// PGMPDecryptorParent
virtual bool RecvSetSessionId(const uint32_t& aCreateSessionToken,
const nsCString& aSessionId) override;
bool RecvSetSessionId(const uint32_t& aCreateSessionToken,
const nsCString& aSessionId) override;
virtual bool RecvResolveLoadSessionPromise(const uint32_t& aPromiseId,
const bool& aSuccess) override;
bool RecvResolveLoadSessionPromise(const uint32_t& aPromiseId,
const bool& aSuccess) override;
virtual bool RecvResolvePromise(const uint32_t& aPromiseId) override;
bool RecvResolvePromise(const uint32_t& aPromiseId) override;
virtual bool RecvRejectPromise(const uint32_t& aPromiseId,
const GMPDOMException& aException,
const nsCString& aMessage) override;
bool RecvRejectPromise(const uint32_t& aPromiseId,
const GMPDOMException& aException,
const nsCString& aMessage) override;
virtual bool RecvSessionMessage(const nsCString& aSessionId,
const GMPSessionMessageType& aMessageType,
nsTArray<uint8_t>&& aMessage) override;
bool RecvSessionMessage(const nsCString& aSessionId,
const GMPSessionMessageType& aMessageType,
nsTArray<uint8_t>&& aMessage) override;
virtual bool RecvExpirationChange(const nsCString& aSessionId,
const double& aExpiryTime) override;
bool RecvExpirationChange(const nsCString& aSessionId,
const double& aExpiryTime) override;
virtual bool RecvSessionClosed(const nsCString& aSessionId) override;
bool RecvSessionClosed(const nsCString& aSessionId) override;
virtual bool RecvSessionError(const nsCString& aSessionId,
const GMPDOMException& aException,
const uint32_t& aSystemCode,
const nsCString& aMessage) override;
bool RecvSessionError(const nsCString& aSessionId,
const GMPDOMException& aException,
const uint32_t& aSystemCode,
const nsCString& aMessage) override;
virtual bool RecvKeyStatusChanged(const nsCString& aSessionId,
InfallibleTArray<uint8_t>&& aKeyId,
const GMPMediaKeyStatus& aStatus) override;
bool RecvKeyStatusChanged(const nsCString& aSessionId,
InfallibleTArray<uint8_t>&& aKeyId,
const GMPMediaKeyStatus& aStatus) override;
virtual bool RecvDecrypted(const uint32_t& aId,
const GMPErr& aErr,
InfallibleTArray<uint8_t>&& aBuffer) override;
bool RecvDecrypted(const uint32_t& aId,
const GMPErr& aErr,
InfallibleTArray<uint8_t>&& aBuffer) override;
virtual bool RecvSetCaps(const uint64_t& aCaps) override;
bool RecvSetCaps(const uint64_t& aCaps) override;
virtual bool RecvShutdown() override;
bool RecvShutdown() override;
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual bool Recv__delete__() override;
void ActorDestroy(ActorDestroyReason aWhy) override;
bool Recv__delete__() override;
bool mIsOpen;
bool mShuttingDown;

View File

@ -19,9 +19,9 @@ class GMPStringListImpl : public GMPStringList
{
public:
explicit GMPStringListImpl(const nsTArray<nsCString>& aStrings);
virtual uint32_t Size() const override;
virtual void StringAt(uint32_t aIndex,
const char** aOutString, uint32_t *aOutLength) const override;
uint32_t Size() const override;
void StringAt(uint32_t aIndex,
const char** aOutString, uint32_t *aOutLength) const override;
virtual ~GMPStringListImpl() override;
void RelinquishData(nsTArray<nsCString>& aStrings);
@ -37,14 +37,14 @@ public:
void RelinquishData(GMPDecryptionData& aData);
virtual const uint8_t* KeyId() const override;
virtual uint32_t KeyIdSize() const override;
virtual const uint8_t* IV() const override;
virtual uint32_t IVSize() const override;
virtual uint32_t NumSubsamples() const override;
virtual const uint16_t* ClearBytes() const override;
virtual const uint32_t* CipherBytes() const override;
virtual const GMPStringList* SessionIds() const override;
const uint8_t* KeyId() const override;
uint32_t KeyIdSize() const override;
const uint8_t* IV() const override;
uint32_t IVSize() const override;
uint32_t NumSubsamples() const override;
const uint16_t* ClearBytes() const override;
const uint32_t* CipherBytes() const override;
const GMPStringList* SessionIds() const override;
private:
nsTArray<uint8_t> mKeyId;
@ -62,16 +62,16 @@ public:
, mData(aData)
{
}
virtual uint32_t Id() const {
uint32_t Id() const override {
return mId;
}
virtual uint8_t* Data() {
uint8_t* Data() override {
return mData.Elements();
}
virtual uint32_t Size() const {
uint32_t Size() const override {
return mData.Length();
}
virtual void Resize(uint32_t aSize) {
void Resize(uint32_t aSize) override {
mData.SetLength(aSize);
}

View File

@ -56,20 +56,20 @@ public:
{}
virtual ~GMPLoaderImpl() {}
virtual bool Load(const char* aUTF8LibPath,
uint32_t aUTF8LibPathLen,
char* aOriginSalt,
uint32_t aOriginSaltLen,
const GMPPlatformAPI* aPlatformAPI) override;
bool Load(const char* aUTF8LibPath,
uint32_t aUTF8LibPathLen,
char* aOriginSalt,
uint32_t aOriginSaltLen,
const GMPPlatformAPI* aPlatformAPI) override;
virtual GMPErr GetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI) override;
GMPErr GetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI) override;
virtual void Shutdown() override;
void Shutdown() override;
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
virtual void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override;
void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override;
#endif
private:

View File

@ -158,26 +158,26 @@ private:
void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes);
void GetCrashID(nsString& aResult);
#endif
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
void ActorDestroy(ActorDestroyReason aWhy) override;
virtual PCrashReporterParent* AllocPCrashReporterParent(const NativeThreadId& aThread) override;
virtual bool DeallocPCrashReporterParent(PCrashReporterParent* aCrashReporter) override;
PCrashReporterParent* AllocPCrashReporterParent(const NativeThreadId& aThread) override;
bool DeallocPCrashReporterParent(PCrashReporterParent* aCrashReporter) override;
virtual bool RecvPGMPStorageConstructor(PGMPStorageParent* actor) override;
virtual PGMPStorageParent* AllocPGMPStorageParent() override;
virtual bool DeallocPGMPStorageParent(PGMPStorageParent* aActor) override;
bool RecvPGMPStorageConstructor(PGMPStorageParent* actor) override;
PGMPStorageParent* AllocPGMPStorageParent() override;
bool DeallocPGMPStorageParent(PGMPStorageParent* aActor) override;
virtual PGMPContentParent* AllocPGMPContentParent(Transport* aTransport,
ProcessId aOtherPid) override;
PGMPContentParent* AllocPGMPContentParent(Transport* aTransport,
ProcessId aOtherPid) override;
virtual bool RecvPGMPTimerConstructor(PGMPTimerParent* actor) override;
virtual PGMPTimerParent* AllocPGMPTimerParent() override;
virtual bool DeallocPGMPTimerParent(PGMPTimerParent* aActor) override;
bool RecvPGMPTimerConstructor(PGMPTimerParent* actor) override;
PGMPTimerParent* AllocPGMPTimerParent() override;
bool DeallocPGMPTimerParent(PGMPTimerParent* aActor) override;
virtual bool RecvAsyncShutdownComplete() override;
virtual bool RecvAsyncShutdownRequired() override;
bool RecvAsyncShutdownComplete() override;
bool RecvAsyncShutdownRequired() override;
virtual bool RecvPGMPContentChildDestroyed() override;
bool RecvPGMPContentChildDestroyed() override;
bool IsUsed()
{
return mGMPContentChildCount > 0;

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