mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
3d36fa43e7
- Bug 1173641 - Hoist shutdown promise resolution into a helper. r=jww (1a02bd90a) - Bug 1173641 - Null out the thread pool when resolving shutdown. r=jww (ab3f723d5) - Bug 1173641 - Remove now-unnecessary null-out in MediaDecoderReader::BreakCycles. r=jww (3330778c6) - Bug 1173656 - Disallow TrackID reuse in TrackUnionStream. r=roc (7f4da1ea2) - Bug 1175768 - Implement SilentReadAt. r=jya (ece3c2ffa) - Bug 1178437 - Assert OnTaskQueue for most of the remaining MDSM methods. r=jww (da13ec549) - Bug 1178437 - Remove ReadOnWrongThread. r=jww (f9cf8946d) - Bug 1178437 - Dispatch SetFragmentEndTime. r=jww (740ce9882) - Bug 1178437 - Make mRealTime const and allow it to be accessed on any thread. r=jww (a65c22f1f) - Bug 1139964 part 1. Factor out the guts of BackstagePass::Resolve and BackstagePass::Enumerate to allow reuse for other globals that want to opt in to Exposed=System WebIDL annotations. r=smaug (d5eb8c704) - Bug 1139964 part 2. Add classinfo helpers for the various message manager stuff to install WebIDL Exposed=System things on those globals. r=smaug (47085f2a6) - Bug 1139964 part 3. Add a test. r=bzbarsky (d87e0907b) - Bug 1130028 - Custom elements, set registered prototype in compartment of caller of registerElement. r=mrbkap (5bd643614) - Bug 1130028 - Send inputmethod-contextchange to systemapp to hide keyboard when frame crash. r=yxl (1e100121f) - Bug 1156629 - OpenGL core context deprecated default VAO. r=jgilbert (5ecabb650) - Bug 1110120 - Remove use of UniquePtr for XFB and UB tracking.; r=smaug (92ebc132a) - Bug 1167504 - Part 11: Clean up buffer binding constraints. r=jgilbert (4f3005203) - Bug 1167504 - Part 13: Unbind buffers from cached state on buffer deletion. r=jgilbert (bb9e3f53d) - Bug 1180523 - Part 1: Store the audio mute/volume information on the outer window; r=baku (3b686c6b9) - line endings dos->unix (d7491a87c) - Bug 1153258 - directly instantiate nsStandardURL in nsChromeProtocolHandler.cpp; r=bsmedberg (01150c663) - Bug 1175344 - Include nsContentUtils.h explicitly to avoid compile error on unified building. r=ehsan (10a3d42ac) - Bug 959752 - Make the network predictor work under e10s. r=mcmanus (3b46a6b65) - Bug 1159747 - delete h2 static compression table in such a way to avoid crashes after network changes. r=mcmanus (ed34f8d80) - Bug 1173016 - Cache the basic waveform PeriodicWaves. r=karlt (d64c962f0) - part of Bug 1165816 - Cancel remote application reputation requests after a certain timeout. r=gcp (4cdc98d99) - Bug 1082837 - Call content policies on cached image redirects in imgLoader::ValidateSecurityInfo. Content policies check the last hop (final uri) of the cached image. For Mixed Content Blocker, we do an additional check to see if any of the intermediary hops went through an insecure redirect. r=smaug, feedback=seth (ffaf3debe) - Bug 1082837 - Use nsresult for static ShouldLoad and use NS_IMETHODIMP for nsIContentPolicy::ShouldLoad(). CLOSED TREE (acde35e25)
154 lines
5.2 KiB
C++
154 lines
5.2 KiB
C++
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "WebGLContext.h"
|
|
#include "WebGLMemoryTracker.h"
|
|
|
|
using namespace mozilla;
|
|
|
|
NS_IMPL_ISUPPORTS(WebGLObserver, nsIObserver)
|
|
|
|
NS_IMETHODIMP
|
|
WebGLMemoryTracker::CollectReports(nsIHandleReportCallback* handleReport,
|
|
nsISupports* data, bool)
|
|
{
|
|
#define REPORT(_path, _kind, _units, _amount, _desc) \
|
|
do { \
|
|
nsresult rv; \
|
|
rv = handleReport->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path), \
|
|
_kind, _units, _amount, \
|
|
NS_LITERAL_CSTRING(_desc), data); \
|
|
NS_ENSURE_SUCCESS(rv, rv); \
|
|
} while (0)
|
|
|
|
REPORT("webgl-texture-memory",
|
|
KIND_OTHER, UNITS_BYTES, GetTextureMemoryUsed(),
|
|
"Memory used by WebGL textures.The OpenGL"
|
|
" implementation is free to store these textures in either video"
|
|
" memory or main memory. This measurement is only a lower bound,"
|
|
" actual memory usage may be higher for example if the storage"
|
|
" is strided.");
|
|
|
|
REPORT("webgl-texture-count",
|
|
KIND_OTHER, UNITS_COUNT, GetTextureCount(),
|
|
"Number of WebGL textures.");
|
|
|
|
REPORT("webgl-buffer-memory",
|
|
KIND_OTHER, UNITS_BYTES, GetBufferMemoryUsed(),
|
|
"Memory used by WebGL buffers. The OpenGL"
|
|
" implementation is free to store these buffers in either video"
|
|
" memory or main memory. This measurement is only a lower bound,"
|
|
" actual memory usage may be higher for example if the storage"
|
|
" is strided.");
|
|
|
|
REPORT("explicit/webgl/buffer-cache-memory",
|
|
KIND_HEAP, UNITS_BYTES, GetBufferCacheMemoryUsed(),
|
|
"Memory used by WebGL buffer caches. The WebGL"
|
|
" implementation caches the contents of element array buffers"
|
|
" only.This adds up with the webgl-buffer-memory value, but"
|
|
" contrary to it, this one represents bytes on the heap,"
|
|
" not managed by OpenGL.");
|
|
|
|
REPORT("webgl-buffer-count",
|
|
KIND_OTHER, UNITS_COUNT, GetBufferCount(),
|
|
"Number of WebGL buffers.");
|
|
|
|
REPORT("webgl-renderbuffer-memory",
|
|
KIND_OTHER, UNITS_BYTES, GetRenderbufferMemoryUsed(),
|
|
"Memory used by WebGL renderbuffers. The OpenGL"
|
|
" implementation is free to store these renderbuffers in either"
|
|
" video memory or main memory. This measurement is only a lower"
|
|
" bound, actual memory usage may be higher for example if the"
|
|
" storage is strided.");
|
|
|
|
REPORT("webgl-renderbuffer-count",
|
|
KIND_OTHER, UNITS_COUNT, GetRenderbufferCount(),
|
|
"Number of WebGL renderbuffers.");
|
|
|
|
REPORT("explicit/webgl/shader",
|
|
KIND_HEAP, UNITS_BYTES, GetShaderSize(),
|
|
"Combined size of WebGL shader ASCII sources and translation"
|
|
" logs cached on the heap.");
|
|
|
|
REPORT("webgl-shader-count",
|
|
KIND_OTHER, UNITS_COUNT, GetShaderCount(),
|
|
"Number of WebGL shaders.");
|
|
|
|
REPORT("webgl-context-count",
|
|
KIND_OTHER, UNITS_COUNT, GetContextCount(),
|
|
"Number of WebGL contexts.");
|
|
|
|
#undef REPORT
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMPL_ISUPPORTS(WebGLMemoryTracker, nsIMemoryReporter)
|
|
|
|
StaticRefPtr<WebGLMemoryTracker> WebGLMemoryTracker::sUniqueInstance;
|
|
|
|
WebGLMemoryTracker*
|
|
WebGLMemoryTracker::UniqueInstance()
|
|
{
|
|
if (!sUniqueInstance) {
|
|
sUniqueInstance = new WebGLMemoryTracker;
|
|
sUniqueInstance->InitMemoryReporter();
|
|
}
|
|
return sUniqueInstance;
|
|
}
|
|
|
|
WebGLMemoryTracker::WebGLMemoryTracker()
|
|
{
|
|
}
|
|
|
|
void
|
|
WebGLMemoryTracker::InitMemoryReporter()
|
|
{
|
|
RegisterWeakMemoryReporter(this);
|
|
}
|
|
|
|
WebGLMemoryTracker::~WebGLMemoryTracker()
|
|
{
|
|
UnregisterWeakMemoryReporter(this);
|
|
}
|
|
|
|
MOZ_DEFINE_MALLOC_SIZE_OF(WebGLBufferMallocSizeOf)
|
|
|
|
int64_t
|
|
WebGLMemoryTracker::GetBufferCacheMemoryUsed()
|
|
{
|
|
const ContextsArrayType& contexts = Contexts();
|
|
int64_t result = 0;
|
|
for(size_t i = 0; i < contexts.Length(); ++i) {
|
|
for (const WebGLBuffer* buffer = contexts[i]->mBuffers.getFirst();
|
|
buffer;
|
|
buffer = buffer->getNext())
|
|
{
|
|
if (buffer->Content() == WebGLBuffer::Kind::ElementArray) {
|
|
result += buffer->SizeOfIncludingThis(WebGLBufferMallocSizeOf);
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
MOZ_DEFINE_MALLOC_SIZE_OF(WebGLShaderMallocSizeOf)
|
|
|
|
int64_t
|
|
WebGLMemoryTracker::GetShaderSize()
|
|
{
|
|
const ContextsArrayType& contexts = Contexts();
|
|
int64_t result = 0;
|
|
for(size_t i = 0; i < contexts.Length(); ++i) {
|
|
for (const WebGLShader* shader = contexts[i]->mShaders.getFirst();
|
|
shader;
|
|
shader = shader->getNext())
|
|
{
|
|
result += shader->SizeOfIncludingThis(WebGLShaderMallocSizeOf);
|
|
}
|
|
}
|
|
return result;
|
|
}
|