Merge inbound to mozilla-central. a=merge

This commit is contained in:
shindli 2019-04-12 18:48:02 +03:00
Родитель 385ad0d913 b068fc3d17
Коммит 266dff621d
8 изменённых файлов: 53 добавлений и 46 удалений

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

@ -39,15 +39,16 @@ class WebGL2Context : public WebGLContext {
// Buffer objects - WebGL2ContextBuffers.cpp
void CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size);
WebGLintptr readOffset, WebGLintptr writeOffset,
WebGLsizeiptr size);
private:
template <typename BufferT>
void GetBufferSubDataT(GLenum target, GLintptr offset, const BufferT& data);
void GetBufferSubDataT(GLenum target, WebGLintptr offset,
const BufferT& data);
public:
void GetBufferSubData(GLenum target, GLintptr srcByteOffset,
void GetBufferSubData(GLenum target, WebGLintptr srcByteOffset,
const dom::ArrayBufferView& dstData,
GLuint dstElemOffset, GLuint dstElemCountOverride);
@ -303,7 +304,7 @@ class WebGL2Context : public WebGLContext {
void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
GLsizei instanceCount);
void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
GLintptr offset, GLsizei instanceCount);
WebGLintptr offset, GLsizei instanceCount);
*/
void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
@ -405,7 +406,7 @@ class WebGL2Context : public WebGLContext {
/*
void BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer);
void BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer,
GLintptr offset, GLsizeiptr size);
WebGLintptr offset, WebGLsizeiptr size);
*/
virtual JS::Value GetParameter(JSContext* cx, GLenum pname,
ErrorResult& rv) override;

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

@ -15,8 +15,9 @@ namespace mozilla {
// Buffer objects
void WebGL2Context::CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size) {
WebGLintptr readOffset,
WebGLintptr writeOffset,
WebGLsizeiptr size) {
const FuncScope funcScope(*this, "copyBufferSubData");
if (IsContextLost()) return;
@ -32,9 +33,14 @@ void WebGL2Context::CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
return;
}
const auto fnValidateOffsetSize = [&](const char* info, GLintptr offset,
if (!CheckedInt<GLintptr>(readOffset).isValid() ||
!CheckedInt<GLintptr>(writeOffset).isValid() ||
!CheckedInt<GLsizeiptr>(size).isValid())
return ErrorOutOfMemory("offset or size too large for platform.");
const auto fnValidateOffsetSize = [&](const char* info, WebGLintptr offset,
const WebGLBuffer* buffer) {
const auto neededBytes = CheckedInt<size_t>(offset) + size;
const auto neededBytes = CheckedInt<uint64_t>(offset) + size;
if (!neededBytes.isValid() || neededBytes.value() > buffer->ByteLength()) {
ErrorInvalidValue("Invalid %s range.", info);
return false;
@ -48,9 +54,6 @@ void WebGL2Context::CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
}
if (readBuffer == writeBuffer) {
MOZ_ASSERT((CheckedInt<WebGLsizeiptr>(readOffset) + size).isValid());
MOZ_ASSERT((CheckedInt<WebGLsizeiptr>(writeOffset) + size).isValid());
const bool separate =
(readOffset + size <= writeOffset || writeOffset + size <= readOffset);
if (!separate) {
@ -81,7 +84,7 @@ void WebGL2Context::CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
writeBuffer->ResetLastUpdateFenceId();
}
void WebGL2Context::GetBufferSubData(GLenum target, GLintptr srcByteOffset,
void WebGL2Context::GetBufferSubData(GLenum target, WebGLintptr srcByteOffset,
const dom::ArrayBufferView& dstData,
GLuint dstElemOffset,
GLuint dstElemCountOverride) {
@ -106,8 +109,9 @@ void WebGL2Context::GetBufferSubData(GLenum target, GLintptr srcByteOffset,
////
if (!CheckedInt<GLsizeiptr>(byteLen).isValid()) {
ErrorOutOfMemory("Size too large.");
if (!CheckedInt<GLintptr>(srcByteOffset).isValid() ||
!CheckedInt<GLsizeiptr>(byteLen).isValid()) {
ErrorOutOfMemory("offset or size too large for platform.");
return;
}
const GLsizeiptr glByteLen(byteLen);

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

@ -84,7 +84,7 @@ static bool ValidateBufferUsageEnum(WebGLContext* webgl, GLenum usage) {
return false;
}
void WebGLBuffer::BufferData(GLenum target, size_t size, const void* data,
void WebGLBuffer::BufferData(GLenum target, uint64_t size, const void* data,
GLenum usage) {
// Careful: data.Length() could conceivably be any uint32_t, but GLsizeiptr
// is like intptr_t.
@ -106,7 +106,7 @@ void WebGLBuffer::BufferData(GLenum target, size_t size, const void* data,
UniqueBuffer newIndexCache;
if (target == LOCAL_GL_ELEMENT_ARRAY_BUFFER &&
mContext->mNeedsIndexValidation) {
newIndexCache = malloc(size);
newIndexCache = malloc(AssertedCast<size_t>(size));
if (!newIndexCache) {
mContext->ErrorOutOfMemory("Failed to alloc index cache.");
return;
@ -151,12 +151,13 @@ void WebGLBuffer::BufferData(GLenum target, size_t size, const void* data,
ResetLastUpdateFenceId();
}
void WebGLBuffer::BufferSubData(GLenum target, size_t dstByteOffset,
size_t dataLen, const void* data) const {
void WebGLBuffer::BufferSubData(GLenum target, uint64_t dstByteOffset,
uint64_t dataLen, const void* data) const {
if (!ValidateRange(dstByteOffset, dataLen)) return;
if (!CheckedInt<GLintptr>(dataLen).isValid())
return mContext->ErrorOutOfMemory("Size too large.");
if (!CheckedInt<GLintptr>(dstByteOffset).isValid() ||
!CheckedInt<GLsizeiptr>(dataLen).isValid())
return mContext->ErrorOutOfMemory("offset or size too large for platform.");
////

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

@ -49,8 +49,8 @@ class WebGLBuffer final : public nsWrapperCache,
JS::Handle<JSObject*> givenProto) override;
bool ValidateCanBindToTarget(GLenum target);
void BufferData(GLenum target, size_t size, const void* data, GLenum usage);
void BufferSubData(GLenum target, size_t dstByteOffset, size_t dataLen,
void BufferData(GLenum target, uint64_t size, const void* data, GLenum usage);
void BufferSubData(GLenum target, uint64_t dstByteOffset, uint64_t dataLen,
const void* data) const;
////

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

@ -958,7 +958,7 @@ class WebGLContext : public nsICanvasRenderingContextInternal,
WebGLintptr offset, WebGLsizeiptr size);
private:
void BufferDataImpl(GLenum target, size_t dataLen, const uint8_t* data,
void BufferDataImpl(GLenum target, uint64_t dataLen, const uint8_t* data,
GLenum usage);
public:
@ -972,7 +972,7 @@ class WebGLContext : public nsICanvasRenderingContextInternal,
private:
void BufferSubDataImpl(GLenum target, WebGLsizeiptr dstByteOffset,
size_t srcDataLen, const uint8_t* srcData);
uint64_t srcDataLen, const uint8_t* srcData);
public:
void BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,

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

@ -285,7 +285,7 @@ void WebGLContext::BindBufferRange(GLenum target, GLuint index,
////////////////////////////////////////
void WebGLContext::BufferDataImpl(GLenum target, size_t dataLen,
void WebGLContext::BufferDataImpl(GLenum target, uint64_t dataLen,
const uint8_t* data, GLenum usage) {
const auto& buffer = ValidateBufferSelection(target);
if (!buffer) return;
@ -310,8 +310,8 @@ void WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage) {
const UniqueBuffer zeroBuffer(calloc(checkedSize.value(), 1u));
if (!zeroBuffer) return ErrorOutOfMemory("Failed to allocate zeros.");
BufferDataImpl(target, checkedSize.value(), (const uint8_t*)zeroBuffer.get(),
usage);
BufferDataImpl(target, uint64_t{checkedSize.value()},
(const uint8_t*)zeroBuffer.get(), usage);
}
void WebGLContext::BufferData(GLenum target,
@ -346,7 +346,7 @@ void WebGLContext::BufferData(GLenum target, const dom::ArrayBufferView& src,
////////////////////////////////////////
void WebGLContext::BufferSubDataImpl(GLenum target, WebGLsizeiptr dstByteOffset,
size_t dataLen, const uint8_t* data) {
uint64_t dataLen, const uint8_t* data) {
const FuncScope funcScope(*this, "bufferSubData");
if (!ValidateNonNegative("byteOffset", dstByteOffset)) return;
@ -354,7 +354,7 @@ void WebGLContext::BufferSubDataImpl(GLenum target, WebGLsizeiptr dstByteOffset,
const auto& buffer = ValidateBufferSelection(target);
if (!buffer) return;
buffer->BufferSubData(target, size_t(dstByteOffset), dataLen, data);
buffer->BufferSubData(target, uint64_t(dstByteOffset), dataLen, data);
}
////

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

@ -763,7 +763,7 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
Cell* value) {
bool ok = true;
DebugOnly<Zone*> zone = map->zone();
Zone* zone = map->zone();
MOZ_ASSERT(CurrentThreadCanAccessZone(zone));
MOZ_ASSERT(zone->isGCMarking());

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

@ -4,18 +4,13 @@ geckodriver
Proxy for using W3C [WebDriver] compatible clients to interact with
Gecko-based browsers.
This program provides the HTTP API described by the [WebDriver protocol]
to communicate with Gecko browsers, such as Firefox. It translates calls
into the [Firefox remote protocol] by acting as a proxy between the local-
and remote ends.
geckodrivers [source code] is made available under the [Mozilla
Public License].
This program provides the HTTP API described by the [WebDriver
protocol] to communicate with Gecko browsers, such as Firefox. It
translates calls into the [Marionette remote protocol] by acting
as a proxy between the local- and remote ends.
[WebDriver protocol]: https://w3c.github.io/webdriver/#protocol
[Firefox remote protocol]: https://firefox-source-docs.mozilla.org/testing/marionette/Protocol.html
[source code]: https://hg.mozilla.org/mozilla-unified/file/tip/testing/geckodriver
[Mozilla Public License]: https://www.mozilla.org/en-US/MPL/2.0/
[Marionette remote protocol]: https://firefox-source-docs.mozilla.org/testing/marionette/
[WebDriver]: https://developer.mozilla.org/en-US/docs/Web/WebDriver
@ -52,17 +47,23 @@ Documentation
* [Analyzing crash data from Firefox](https://firefox-source-docs.mozilla.org/testing/geckodriver/CrashReports.html)
* [Contributing](https://firefox-source-docs.mozilla.org/testing/geckodriver/#for-developers)
* [Building](https://firefox-source-docs.mozilla.org/testing/geckodriver/Building.html)
* [Testing](https://firefox-source-docs.mozilla.org/testing/geckodriver/Testing.html)
* [Releasing](https://firefox-source-docs.mozilla.org/testing/geckodriver/Releasing.html)
* [Self-serving an ARM build](https://firefox-source-docs.mozilla.org/testing/geckodriver/ARM.html)
Source code
-----------
geckodrivers canonical source code can be found in [mozilla-central].
We only use this GitHub repository for issue tracking and making releases.
See our [contribution documentation] for more information.
geckodriver is made available under the [Mozilla Public License].
Its source code can be found in [mozilla-central] under testing/geckodriver.
This GitHub repository is only used for issue tracking and making releases.
[source code]: https://hg.mozilla.org/mozilla-unified/file/tip/testing/geckodriver
[Mozilla Public License]: https://www.mozilla.org/en-US/MPL/2.0/
[mozilla-central]: https://hg.mozilla.org/mozilla-central/file/tip/testing/geckodriver
[contribution documentation]: https://firefox-source-docs.mozilla.org/testing/geckodriver/#for-developers
Contact