Merge inbound to mozilla-central. a=merge
authorshindli <shindli@mozilla.com>
Fri, 12 Apr 2019 18:48:02 +0300
changeset 469278 412447b6149e347e8745b1480537726b0c5b02a5
parent 469277 c261aea0226a3f60a31923b9a98e80826eb18833 (current diff)
parent 469222 6299364ca6c5c0ebc1eca183951a40b92a0be9fc (diff)
child 469279 b4501ced5619396b80cf5f55f4fbf1007afda71b
child 469305 e832f9e26c58cc15bc6aca8c37fc756acdd7829d
push id112776
push usershindli@mozilla.com
push dateFri, 12 Apr 2019 16:20:17 +0000
treeherdermozilla-inbound@b4501ced5619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
--- a/dom/canvas/WebGL2Context.h
+++ b/dom/canvas/WebGL2Context.h
@@ -34,25 +34,26 @@ class WebGL2Context : public WebGLContex
 
   virtual JSObject* WrapObject(JSContext* cx,
                                JS::Handle<JSObject*> givenProto) override;
 
   // -------------------------------------------------------------------------
   // 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);
 
   // -------------------------------------------------------------------------
   // Framebuffer objects - WebGL2ContextFramebuffers.cpp
 
   void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
                        GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
@@ -298,17 +299,17 @@ class WebGL2Context : public WebGLContex
   // -------------------------------------------------------------------------
   // Writing to the drawing buffer
 
   /* Implemented in WebGLContext
   void VertexAttribDivisor(GLuint index, GLuint divisor);
   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,
                          GLenum type, WebGLintptr byteOffset) {
     const FuncScope funcScope(*this, "drawRangeElements");
     if (IsContextLost()) return;
 
     if (end < start) {
@@ -400,17 +401,17 @@ class WebGL2Context : public WebGLContex
 
   // -------------------------------------------------------------------------
   // Uniform Buffer Objects and Transform Feedback Buffers -
   // WebGL2ContextUniforms.cpp
   // TODO(djg): Implemented in 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;
   // Make the inline version from the superclass visible here.
   using WebGLContext::GetParameter;
   void GetIndexedParameter(JSContext* cx, GLenum target, GLuint index,
                            JS::MutableHandleValue retval, ErrorResult& rv);
   void GetUniformIndices(const WebGLProgram& program,
--- a/dom/canvas/WebGL2ContextBuffers.cpp
+++ b/dom/canvas/WebGL2ContextBuffers.cpp
@@ -10,52 +10,55 @@
 #include "WebGLTransformFeedback.h"
 
 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;
 
   const auto& readBuffer = ValidateBufferSelection(readTarget);
   if (!readBuffer) return;
 
   const auto& writeBuffer = ValidateBufferSelection(writeTarget);
   if (!writeBuffer) return;
 
   if (!ValidateNonNegative("readOffset", readOffset) ||
       !ValidateNonNegative("writeOffset", writeOffset) ||
       !ValidateNonNegative("size", size)) {
     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;
     }
     return true;
   };
 
   if (!fnValidateOffsetSize("read", readOffset, readBuffer) ||
       !fnValidateOffsetSize("write", writeOffset, writeBuffer)) {
     return;
   }
 
   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) {
       ErrorInvalidValue(
           "Ranges [readOffset, readOffset + size) and"
           " [writeOffset, writeOffset + size) overlap.");
       return;
     }
@@ -76,17 +79,17 @@ void WebGL2Context::CopyBufferSubData(GL
   const ScopedLazyBind readBind(gl, readTarget, readBuffer);
   const ScopedLazyBind writeBind(gl, writeTarget, writeBuffer);
   gl->fCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset,
                          size);
 
   writeBuffer->ResetLastUpdateFenceId();
 }
 
-void WebGL2Context::GetBufferSubData(GLenum target, GLintptr srcByteOffset,
+void WebGL2Context::GetBufferSubData(GLenum target, WebGLintptr srcByteOffset,
                                      const dom::ArrayBufferView& dstData,
                                      GLuint dstElemOffset,
                                      GLuint dstElemCountOverride) {
   const FuncScope funcScope(*this, "getBufferSubData");
   if (IsContextLost()) return;
 
   if (!ValidateNonNegative("srcByteOffset", srcByteOffset)) return;
 
@@ -101,18 +104,19 @@ void WebGL2Context::GetBufferSubData(GLe
 
   const auto& buffer = ValidateBufferSelection(target);
   if (!buffer) return;
 
   if (!buffer->ValidateRange(srcByteOffset, byteLen)) return;
 
   ////
 
-  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);
 
   ////
 
   switch (buffer->mUsage) {
     case LOCAL_GL_STATIC_READ:
--- a/dom/canvas/WebGLBuffer.cpp
+++ b/dom/canvas/WebGLBuffer.cpp
@@ -79,17 +79,17 @@ static bool ValidateBufferUsageEnum(WebG
     default:
       break;
   }
 
   webgl->ErrorInvalidEnumInfo("usage", 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.
   if (!CheckedInt<GLsizeiptr>(size).isValid())
     return mContext->ErrorOutOfMemory("bad size");
 
   if (!ValidateBufferUsageEnum(mContext, usage)) return;
 
@@ -101,17 +101,17 @@ void WebGLBuffer::BufferData(GLenum targ
   }
 #endif
 
   const void* uploadData = 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;
     }
     memcpy(newIndexCache.get(), data, size);
     uploadData = newIndexCache.get();
   }
 
@@ -146,22 +146,23 @@ void WebGLBuffer::BufferData(GLenum targ
                                     uint32_t(mIndexRanges.size()));
       mIndexRanges.clear();
     }
   }
 
   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.");
 
   ////
 
   const void* uploadData = data;
   if (mIndexCache) {
     const auto cachedDataBegin = (uint8_t*)mIndexCache.get() + dstByteOffset;
     memcpy(cachedDataBegin, data, dataLen);
     uploadData = cachedDataBegin;
--- a/dom/canvas/WebGLBuffer.h
+++ b/dom/canvas/WebGLBuffer.h
@@ -44,18 +44,18 @@ class WebGLBuffer final : public nsWrapp
   bool ValidateRange(size_t byteOffset, size_t byteLen) const;
 
   WebGLContext* GetParentObject() const { return mContext; }
 
   virtual JSObject* WrapObject(JSContext* cx,
                                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;
 
   ////
 
   static void AddBindCount(GLenum target, WebGLBuffer* buffer, int8_t addVal) {
     if (!buffer) return;
 
     if (target == LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER) {
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -953,31 +953,31 @@ class WebGLContext : public nsICanvasRen
   // -----------------------------------------------------------------------------
   // Buffer Objects (WebGLContextBuffers.cpp)
   void BindBuffer(GLenum target, WebGLBuffer* buffer);
   void BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buf);
   void BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buf,
                        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:
   void BufferData(GLenum target, WebGLsizeiptr size, GLenum usage);
   void BufferData(GLenum target,
                   const dom::Nullable<dom::ArrayBuffer>& maybeSrc,
                   GLenum usage);
   void BufferData(GLenum target, const dom::ArrayBufferView& srcData,
                   GLenum usage, GLuint srcElemOffset = 0,
                   GLuint srcElemCountOverride = 0);
 
  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,
                      const dom::ArrayBufferView& src, GLuint srcElemOffset = 0,
                      GLuint srcElemCountOverride = 0);
   void BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
                      const dom::ArrayBuffer& src);
   void BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
--- a/dom/canvas/WebGLContextBuffers.cpp
+++ b/dom/canvas/WebGLContextBuffers.cpp
@@ -280,17 +280,17 @@ void WebGLContext::BindBufferRange(GLenu
 
   if (buffer) {
     buffer->SetContentAfterBind(target);
   }
 }
 
 ////////////////////////////////////////
 
-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;
 
   buffer->BufferData(target, dataLen, data, usage);
 }
 
 ////
@@ -305,18 +305,18 @@ void WebGLContext::BufferData(GLenum tar
 
   const auto checkedSize = CheckedInt<size_t>(size);
   if (!checkedSize.isValid())
     return ErrorOutOfMemory("size too large for platform.");
 
   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,
                               const dom::Nullable<dom::ArrayBuffer>& maybeSrc,
                               GLenum usage) {
   const FuncScope funcScope(*this, "bufferData");
   if (IsContextLost()) return;
 
@@ -341,25 +341,25 @@ void WebGLContext::BufferData(GLenum tar
   }
 
   BufferDataImpl(target, byteLen, bytes, usage);
 }
 
 ////////////////////////////////////////
 
 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;
 
   const auto& buffer = ValidateBufferSelection(target);
   if (!buffer) return;
 
-  buffer->BufferSubData(target, size_t(dstByteOffset), dataLen, data);
+  buffer->BufferSubData(target, uint64_t(dstByteOffset), dataLen, data);
 }
 
 ////
 
 void WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr dstByteOffset,
                                  const dom::ArrayBuffer& src) {
   const FuncScope funcScope(*this, "bufferSubData");
   if (IsContextLost()) return;
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -758,17 +758,17 @@ static JSObject* MaybeGetDelegate(Cell* 
   JSObject* object = cell->as<JSObject>();
   return js::UncheckedUnwrapWithoutExpose(object);
 }
 
 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());
 
   JSObject* object = map->memberOf;
   MOZ_ASSERT_IF(object, object->zone() == zone);
 
   // Debugger weak maps can have keys in different zones.
   Zone* keyZone = GetCellZoneFromAnyThread(key);
--- a/testing/geckodriver/README.md
+++ b/testing/geckodriver/README.md
@@ -1,26 +1,21 @@
 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.
-
-geckodriver’s [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
 
 
 Downloads
 ---------
 
 * [Releases](https://github.com/mozilla/geckodriver/releases/latest)
 * [Change log](https://searchfox.org/mozilla-central/source/testing/geckodriver/CHANGES.md)
@@ -47,27 +42,33 @@ Documentation
 * [geckodriver usage](https://firefox-source-docs.mozilla.org/testing/geckodriver/Usage.html)
   * [Supported platforms](https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html)
   * [Firefox capabilities](https://firefox-source-docs.mozilla.org/testing/geckodriver/Capabilities.html)
   * [Capabilities example](https://firefox-source-docs.mozilla.org/testing/geckodriver/Capabilities.html#capabilities-example)
   * [Enabling trace logs](https://firefox-source-docs.mozilla.org/testing/geckodriver/TraceLogs.html)
   * [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
 -----------
 
-geckodriver’s 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
 -------
 
 The mailing list for geckodriver discussion is
 tools-marionette@lists.mozilla.org ([subscribe], [archive]).