Bug 1035045 - Handle packets by the protocol buffer. r=kamidphish
authorBoris Chiou <boris.chiou@gmail.com>
Wed, 09 Jul 2014 23:16:00 -0400
changeset 193590 6808a2c6eab4d647e66afa872a831ec392d456cc
parent 193589 5048d0b0b825eb024da2464db1d283cf0188e227
child 193591 d89a7ed61c1924133e5e70633dd5ff9a25a8b4b7
push idunknown
push userunknown
push dateunknown
reviewerskamidphish
bugs1035045
milestone33.0a1
Bug 1035045 - Handle packets by the protocol buffer. r=kamidphish Use google protocol buffer to handle our package in LayerScope. Note: LayerScopePacket.pb.h and LayerScopePacket.pb.cc were generated by version 2.4.1.
gfx/layers/LayerScope.cpp
gfx/layers/moz.build
gfx/layers/protobuf/LayerScopePacket.pb.cc
gfx/layers/protobuf/LayerScopePacket.pb.h
gfx/layers/protobuf/LayerScopePacket.proto
toolkit/components/protobuf/moz.build
--- a/gfx/layers/LayerScope.cpp
+++ b/gfx/layers/LayerScope.cpp
@@ -43,29 +43,27 @@
 #include "nsIAsyncInputStream.h"
 #include "nsIEventTarget.h"
 #include "nsProxyRelease.h"
 
 // Undo the damage done by mozzconf.h
 #undef compress
 #include "mozilla/Compression.h"
 
-#ifdef __GNUC__
-#define PACKED_STRUCT __attribute__((packed))
-#else
-#define PACKED_STRUCT
-#endif
+// Protocol buffer (generated automatically)
+#include "protobuf/LayerScopePacket.pb.h"
 
 namespace mozilla {
 namespace layers {
 
 using namespace mozilla::Compression;
 using namespace mozilla::gfx;
 using namespace mozilla::gl;
 using namespace mozilla;
+using namespace layerscope;
 
 class DebugDataSender;
 class DebugGLData;
 
 /* This class handle websocket protocol which included
  * handshake and data frame's header
  */
 class LayerScopeWebSocketHandler : public nsIInputStreamCallback {
@@ -346,243 +344,205 @@ public:
         // Destroy Web Server Socket
         if (sWebSocketManager) {
             sWebSocketManager->RemoveAllConnections();
         }
     }
 
     static LayerScopeWebSocketManager* GetSocketManager()
     {
-        return sWebSocketManager.get();
+        return sWebSocketManager;
     }
 
 private:
     static StaticAutoPtr<LayerScopeWebSocketManager> sWebSocketManager;
 };
 
 StaticAutoPtr<LayerScopeWebSocketManager> WebSocketHelper::sWebSocketManager;
 
-class DebugGLData : public LinkedListElement<DebugGLData> {
+/*
+ * DebugGLData is the base class of
+ * 1. DebugGLFrameStatusData (Frame start/end packet)
+ * 2. DebugGLColorData (Color data packet)
+ * 3. DebugGLTextureData (Texture data packet)
+ */
+class DebugGLData: public LinkedListElement<DebugGLData> {
 public:
-    typedef enum {
-        FrameStart,
-        FrameEnd,
-        TextureData,
-        ColorData
-    } DataType;
+    DebugGLData(Packet::DataType aDataType)
+        : mDataType(aDataType)
+    { }
 
     virtual ~DebugGLData() { }
 
-    DataType GetDataType() const { return mDataType; }
-    intptr_t GetContextAddress() const { return mContextAddress; }
-    int64_t GetValue() const { return mValue; }
-
-    DebugGLData(DataType dataType)
-        : mDataType(dataType),
-          mContextAddress(0),
-          mValue(0)
-    { }
-
-    DebugGLData(DataType dataType, GLContext* cx)
-        : mDataType(dataType),
-          mContextAddress(reinterpret_cast<intptr_t>(cx)),
-          mValue(0)
-    { }
+    Packet::DataType GetDataType() const { return mDataType; }
 
-    DebugGLData(DataType dataType, GLContext* cx, int64_t value)
-        : mDataType(dataType),
-          mContextAddress(reinterpret_cast<intptr_t>(cx)),
-          mValue(value)
-    { }
+    virtual bool Write() = 0;
 
-    virtual bool Write() {
-        if (mDataType != FrameStart &&
-            mDataType != FrameEnd)
-        {
-            NS_WARNING("Unimplemented data type!");
-            return false;
-        }
-
-        DebugGLData::BasicPacket packet;
-
-        packet.type = mDataType;
-        packet.ptr = static_cast<uint64_t>(mContextAddress);
-        packet.value = mValue;
-
-        return WriteToStream(&packet, sizeof(packet));
-    }
-
-    static bool WriteToStream(void *ptr, uint32_t size) {
+    static bool WriteToStream(Packet& aPacket) {
         if (!WebSocketHelper::GetSocketManager())
             return true;
-        return WebSocketHelper::GetSocketManager()->WriteAll(ptr, size);
+
+        uint32_t size = aPacket.ByteSize();
+        nsAutoArrayPtr<uint8_t> data(new uint8_t[size]);
+        aPacket.SerializeToArray(data, size);
+        return WebSocketHelper::GetSocketManager()->WriteAll(data, size);
     }
 
 protected:
-    DataType mDataType;
-    intptr_t mContextAddress;
-    int64_t mValue;
+    Packet::DataType mDataType;
+};
 
+class DebugGLFrameStatusData : public DebugGLData
+{
 public:
-  // the data packet formats; all packed
-#ifdef _MSC_VER
-#pragma pack(push, 1)
-#endif
-    typedef struct {
-        uint32_t type;
-        uint64_t ptr;
-        uint64_t value;
-    } PACKED_STRUCT BasicPacket;
+    DebugGLFrameStatusData(Packet::DataType aDataType,
+                           int64_t aValue)
+        : DebugGLData(aDataType),
+          mFrameStamp(aValue)
+    { }
+
+    DebugGLFrameStatusData(Packet::DataType aDataType)
+        : DebugGLData(aDataType),
+          mFrameStamp(0)
+    { }
 
-    typedef struct {
-        uint32_t type;
-        uint64_t ptr;
-        uint64_t layerref;
-        uint32_t color;
-        uint32_t width;
-        uint32_t height;
-    } PACKED_STRUCT ColorPacket;
+    int64_t GetFrameStamp() const { return mFrameStamp; }
+
+    virtual bool Write() MOZ_OVERRIDE {
+        Packet packet;
+        packet.set_type(mDataType);
 
-    typedef struct {
-        uint32_t type;
-        uint64_t ptr;
-        uint64_t layerref;
-        uint32_t name;
-        uint32_t width;
-        uint32_t height;
-        uint32_t stride;
-        uint32_t format;
-        uint32_t target;
-        uint32_t dataFormat;
-        uint32_t dataSize;
-    } PACKED_STRUCT TexturePacket;
-#ifdef _MSC_VER
-#pragma pack(pop)
-#endif
+        FramePacket *fp = packet.mutable_frame();
+        fp->set_value(mFrameStamp);
+
+        if (!WriteToStream(packet))
+            return false;
+        return true;
+    }
+
+protected:
+    int64_t mFrameStamp;
 };
 
 class DebugGLTextureData : public DebugGLData {
 public:
     DebugGLTextureData(GLContext* cx,
                        void* layerRef,
                        GLenum target,
                        GLuint name,
                        DataSourceSurface* img)
-        : DebugGLData(DebugGLData::TextureData, cx),
+        : DebugGLData(Packet::TEXTURE),
           mLayerRef(layerRef),
           mTarget(target),
           mName(name),
+          mContextAddress(reinterpret_cast<intptr_t>(cx)),
           mDatasize(0)
     {
         // pre-packing
         // DataSourceSurface may have locked buffer,
         // so we should compress now, and then it could
         // be unlocked outside.
         pack(img);
     }
 
-    void *GetLayerRef() const { return mLayerRef; }
+    const void* GetLayerRef() const { return mLayerRef; }
     GLuint GetName() const { return mName; }
     GLenum GetTextureTarget() const { return mTarget; }
+    intptr_t GetContextAddress() const { return mContextAddress; }
+    uint32_t GetDataSize() const { return mDatasize; }
 
-    virtual bool Write() {
-        // write the packet header data
-        if (!WriteToStream(&mPacket, sizeof(mPacket)))
-            return false;
-
-        // then the image data
-        if (mCompresseddata.get() && !WriteToStream(mCompresseddata, mDatasize))
+    virtual bool Write() MOZ_OVERRIDE {
+        if (!WriteToStream(mPacket))
             return false;
-
-        // then pad out to 4 bytes
-        if (mDatasize % 4 != 0) {
-            static char buf[] = { 0, 0, 0, 0 };
-            if (!WriteToStream(buf, 4 - (mDatasize % 4)))
-                return false;
-        }
-
         return true;
     }
 
 private:
     void pack(DataSourceSurface* aImage) {
-        mPacket.type = mDataType;
-        mPacket.ptr = static_cast<uint64_t>(mContextAddress);
-        mPacket.layerref = reinterpret_cast<uint64_t>(mLayerRef);
-        mPacket.name = mName;
-        mPacket.format = 0;
-        mPacket.target = mTarget;
-        mPacket.dataFormat = LOCAL_GL_RGBA;
+        mPacket.set_type(mDataType);
+
+        TexturePacket *tp = mPacket.mutable_texture();
+        tp->set_layerref(reinterpret_cast<uint64_t>(mLayerRef));
+        tp->set_name(mName);
+        tp->set_target(mTarget);
+        tp->set_dataformat(LOCAL_GL_RGBA);
+        tp->set_glcontext(static_cast<uint64_t>(mContextAddress));
 
         if (aImage) {
-            mPacket.width = aImage->GetSize().width;
-            mPacket.height = aImage->GetSize().height;
-            mPacket.stride = aImage->Stride();
-            mPacket.dataSize = aImage->GetSize().height * aImage->Stride();
+            tp->set_width(aImage->GetSize().width);
+            tp->set_height(aImage->GetSize().height);
+            tp->set_stride(aImage->Stride());
+
+            mDatasize = aImage->GetSize().height * aImage->Stride();
 
-            mCompresseddata =
-                new char[LZ4::maxCompressedSize(mPacket.dataSize)];
-            if (mCompresseddata.get()) {
+            nsAutoArrayPtr<char> compresseddata(
+                new char[LZ4::maxCompressedSize(mDatasize)]);
+            if (compresseddata.get()) {
                 int ndatasize = LZ4::compress((char*)aImage->GetData(),
-                                              mPacket.dataSize,
-                                              mCompresseddata);
+                                              mDatasize,
+                                              compresseddata);
                 if (ndatasize > 0) {
                     mDatasize = ndatasize;
-
-                    mPacket.dataFormat = (1 << 16) | mPacket.dataFormat;
-                    mPacket.dataSize = mDatasize;
+                    tp->set_dataformat((1 << 16 | tp->dataformat()));
+                    tp->set_data(compresseddata, mDatasize);
                 } else {
                     NS_WARNING("Compress data failed");
+                    tp->set_data(aImage->GetData(), mDatasize);
                 }
             } else {
-                NS_WARNING("Couldn't moz_malloc for compressed data.");
+                NS_WARNING("Couldn't new compressed data.");
+                tp->set_data(aImage->GetData(), mDatasize);
             }
         } else {
-            mPacket.width = 0;
-            mPacket.height = 0;
-            mPacket.stride = 0;
-            mPacket.dataSize = 0;
+            tp->set_width(0);
+            tp->set_height(0);
+            tp->set_stride(0);
         }
     }
 
 protected:
     void* mLayerRef;
     GLenum mTarget;
     GLuint mName;
+    intptr_t mContextAddress;
+    uint32_t mDatasize;
 
     // Packet data
-    DebugGLData::TexturePacket mPacket;
-    nsAutoArrayPtr<char> mCompresseddata;
-    uint32_t mDatasize;
+    Packet mPacket;
 };
 
 class DebugGLColorData : public DebugGLData {
 public:
-    DebugGLColorData(void* layerRef, const gfxRGBA& color, int width, int height)
-        : DebugGLData(DebugGLData::ColorData),
+    DebugGLColorData(void* layerRef,
+                     const gfxRGBA& color,
+                     int width,
+                     int height)
+        : DebugGLData(Packet::COLOR),
           mLayerRef(layerRef),
           mColor(color.Packed()),
           mSize(width, height)
     { }
 
-    void *GetLayerRef() const { return mLayerRef; }
+    const void* GetLayerRef() const { return mLayerRef; }
     uint32_t GetColor() const { return mColor; }
     const nsIntSize& GetSize() const { return mSize; }
 
-    virtual bool Write() {
-        DebugGLData::ColorPacket packet;
+    virtual bool Write() MOZ_OVERRIDE {
+        Packet packet;
+        packet.set_type(mDataType);
 
-        packet.type = mDataType;
-        packet.ptr = static_cast<uint64_t>(mContextAddress);
-        packet.layerref = reinterpret_cast<uintptr_t>(mLayerRef);
-        packet.color = mColor;
-        packet.width = mSize.width;
-        packet.height = mSize.height;
+        ColorPacket *cp = packet.mutable_color();
+        cp->set_layerref(reinterpret_cast<uint64_t>(mLayerRef));
+        cp->set_color(mColor);
+        cp->set_width(mSize.width);
+        cp->set_height(mSize.height);
 
-        return WriteToStream(&packet, sizeof(packet));
+        if (!WriteToStream(packet))
+            return false;
+        return true;
     }
 
 protected:
     void *mLayerRef;
     uint32_t mColor;
     nsIntSize mSize;
 };
 
@@ -1011,25 +971,25 @@ LayerScopeAutoFrame::~LayerScopeAutoFram
 void
 LayerScopeAutoFrame::BeginFrame(int64_t aFrameStamp)
 {
     if (!LayerScope::CheckSendable()) {
         return;
     }
 
     WebSocketHelper::GetSocketManager()->AppendDebugData(
-        new DebugGLData(DebugGLData::FrameStart, nullptr, aFrameStamp));
+        new DebugGLFrameStatusData(Packet::FRAMESTART, aFrameStamp));
 }
 
 void
 LayerScopeAutoFrame::EndFrame()
 {
     if (!LayerScope::CheckSendable()) {
         return;
     }
 
     WebSocketHelper::GetSocketManager()->AppendDebugData(
-        new DebugGLData(DebugGLData::FrameEnd, nullptr));
+        new DebugGLFrameStatusData(Packet::FRAMEEND));
     WebSocketHelper::GetSocketManager()->DispatchDebugData();
 }
 
 } /* layers */
 } /* mozilla */
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -300,29 +300,33 @@ UNIFIED_SOURCES += [
     'LayersLogging.cpp',
     'LayerSorter.cpp',
     'opengl/CompositingRenderTargetOGL.cpp',
     'opengl/CompositorOGL.cpp',
     'opengl/OGLShaderProgram.cpp',
     'opengl/TextureClientOGL.cpp',
     'opengl/TextureHostOGL.cpp',
     'opengl/TexturePoolOGL.cpp',
+    'protobuf/LayerScopePacket.pb.cc',
     'ReadbackProcessor.cpp',
     'RenderTrace.cpp',
     'RotatedBuffer.cpp',
     'YCbCrImageDataSerializer.cpp',
 ]
 
 SOURCES += [
     'basic/BasicImageLayer.cpp',
     'ImageContainer.cpp',
     'Layers.cpp',
     'LayerTreeInvalidation.cpp',
 ]
 
+# Disable RTTI in google protocol buffer
+DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
+
 # Workaround compiler bug (Bug 795594)
 if CONFIG['_MSC_VER'] and CONFIG['CPU_ARCH'] == 'x86_64':
     for src in [
         'Layers.cpp',
         'LayerTreeInvalidation.cpp',
     ]:
         SOURCES[src].no_pgo = True
 
new file mode 100644
--- /dev/null
+++ b/gfx/layers/protobuf/LayerScopePacket.pb.cc
@@ -0,0 +1,1231 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+
+#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
+#include "LayerScopePacket.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/wire_format_lite_inl.h>
+// @@protoc_insertion_point(includes)
+
+namespace mozilla {
+namespace layers {
+namespace layerscope {
+
+void protobuf_ShutdownFile_LayerScopePacket_2eproto() {
+  delete FramePacket::default_instance_;
+  delete ColorPacket::default_instance_;
+  delete TexturePacket::default_instance_;
+  delete Packet::default_instance_;
+}
+
+void protobuf_AddDesc_LayerScopePacket_2eproto() {
+  static bool already_here = false;
+  if (already_here) return;
+  already_here = true;
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  FramePacket::default_instance_ = new FramePacket();
+  ColorPacket::default_instance_ = new ColorPacket();
+  TexturePacket::default_instance_ = new TexturePacket();
+  Packet::default_instance_ = new Packet();
+  FramePacket::default_instance_->InitAsDefaultInstance();
+  ColorPacket::default_instance_->InitAsDefaultInstance();
+  TexturePacket::default_instance_->InitAsDefaultInstance();
+  Packet::default_instance_->InitAsDefaultInstance();
+  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_LayerScopePacket_2eproto);
+}
+
+// Force AddDescriptors() to be called at static initialization time.
+struct StaticDescriptorInitializer_LayerScopePacket_2eproto {
+  StaticDescriptorInitializer_LayerScopePacket_2eproto() {
+    protobuf_AddDesc_LayerScopePacket_2eproto();
+  }
+} static_descriptor_initializer_LayerScopePacket_2eproto_;
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int FramePacket::kValueFieldNumber;
+#endif  // !_MSC_VER
+
+FramePacket::FramePacket()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void FramePacket::InitAsDefaultInstance() {
+}
+
+FramePacket::FramePacket(const FramePacket& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void FramePacket::SharedCtor() {
+  _cached_size_ = 0;
+  value_ = GOOGLE_ULONGLONG(0);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+FramePacket::~FramePacket() {
+  SharedDtor();
+}
+
+void FramePacket::SharedDtor() {
+  if (this != default_instance_) {
+  }
+}
+
+void FramePacket::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const FramePacket& FramePacket::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_LayerScopePacket_2eproto();  return *default_instance_;
+}
+
+FramePacket* FramePacket::default_instance_ = NULL;
+
+FramePacket* FramePacket::New() const {
+  return new FramePacket;
+}
+
+void FramePacket::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    value_ = GOOGLE_ULONGLONG(0);
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool FramePacket::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional uint64 value = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, &value_)));
+          set_has_value();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void FramePacket::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // optional uint64 value = 1;
+  if (has_value()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->value(), output);
+  }
+  
+}
+
+int FramePacket::ByteSize() const {
+  int total_size = 0;
+  
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // optional uint64 value = 1;
+    if (has_value()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt64Size(
+          this->value());
+    }
+    
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void FramePacket::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const FramePacket*>(&from));
+}
+
+void FramePacket::MergeFrom(const FramePacket& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_value()) {
+      set_value(from.value());
+    }
+  }
+}
+
+void FramePacket::CopyFrom(const FramePacket& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool FramePacket::IsInitialized() const {
+  
+  return true;
+}
+
+void FramePacket::Swap(FramePacket* other) {
+  if (other != this) {
+    std::swap(value_, other->value_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string FramePacket::GetTypeName() const {
+  return "mozilla.layers.layerscope.FramePacket";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int ColorPacket::kLayerrefFieldNumber;
+const int ColorPacket::kWidthFieldNumber;
+const int ColorPacket::kHeightFieldNumber;
+const int ColorPacket::kColorFieldNumber;
+#endif  // !_MSC_VER
+
+ColorPacket::ColorPacket()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ColorPacket::InitAsDefaultInstance() {
+}
+
+ColorPacket::ColorPacket(const ColorPacket& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ColorPacket::SharedCtor() {
+  _cached_size_ = 0;
+  layerref_ = GOOGLE_ULONGLONG(0);
+  width_ = 0u;
+  height_ = 0u;
+  color_ = 0u;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ColorPacket::~ColorPacket() {
+  SharedDtor();
+}
+
+void ColorPacket::SharedDtor() {
+  if (this != default_instance_) {
+  }
+}
+
+void ColorPacket::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ColorPacket& ColorPacket::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_LayerScopePacket_2eproto();  return *default_instance_;
+}
+
+ColorPacket* ColorPacket::default_instance_ = NULL;
+
+ColorPacket* ColorPacket::New() const {
+  return new ColorPacket;
+}
+
+void ColorPacket::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    layerref_ = GOOGLE_ULONGLONG(0);
+    width_ = 0u;
+    height_ = 0u;
+    color_ = 0u;
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ColorPacket::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required uint64 layerref = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, &layerref_)));
+          set_has_layerref();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(16)) goto parse_width;
+        break;
+      }
+      
+      // optional uint32 width = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_width:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &width_)));
+          set_has_width();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(24)) goto parse_height;
+        break;
+      }
+      
+      // optional uint32 height = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_height:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &height_)));
+          set_has_height();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(32)) goto parse_color;
+        break;
+      }
+      
+      // optional uint32 color = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_color:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &color_)));
+          set_has_color();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ColorPacket::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required uint64 layerref = 1;
+  if (has_layerref()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->layerref(), output);
+  }
+  
+  // optional uint32 width = 2;
+  if (has_width()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->width(), output);
+  }
+  
+  // optional uint32 height = 3;
+  if (has_height()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->height(), output);
+  }
+  
+  // optional uint32 color = 4;
+  if (has_color()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->color(), output);
+  }
+  
+}
+
+int ColorPacket::ByteSize() const {
+  int total_size = 0;
+  
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required uint64 layerref = 1;
+    if (has_layerref()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt64Size(
+          this->layerref());
+    }
+    
+    // optional uint32 width = 2;
+    if (has_width()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->width());
+    }
+    
+    // optional uint32 height = 3;
+    if (has_height()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->height());
+    }
+    
+    // optional uint32 color = 4;
+    if (has_color()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->color());
+    }
+    
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void ColorPacket::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const ColorPacket*>(&from));
+}
+
+void ColorPacket::MergeFrom(const ColorPacket& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_layerref()) {
+      set_layerref(from.layerref());
+    }
+    if (from.has_width()) {
+      set_width(from.width());
+    }
+    if (from.has_height()) {
+      set_height(from.height());
+    }
+    if (from.has_color()) {
+      set_color(from.color());
+    }
+  }
+}
+
+void ColorPacket::CopyFrom(const ColorPacket& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool ColorPacket::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  
+  return true;
+}
+
+void ColorPacket::Swap(ColorPacket* other) {
+  if (other != this) {
+    std::swap(layerref_, other->layerref_);
+    std::swap(width_, other->width_);
+    std::swap(height_, other->height_);
+    std::swap(color_, other->color_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string ColorPacket::GetTypeName() const {
+  return "mozilla.layers.layerscope.ColorPacket";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int TexturePacket::kLayerrefFieldNumber;
+const int TexturePacket::kWidthFieldNumber;
+const int TexturePacket::kHeightFieldNumber;
+const int TexturePacket::kStrideFieldNumber;
+const int TexturePacket::kNameFieldNumber;
+const int TexturePacket::kTargetFieldNumber;
+const int TexturePacket::kDataformatFieldNumber;
+const int TexturePacket::kGlcontextFieldNumber;
+const int TexturePacket::kDataFieldNumber;
+#endif  // !_MSC_VER
+
+TexturePacket::TexturePacket()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void TexturePacket::InitAsDefaultInstance() {
+}
+
+TexturePacket::TexturePacket(const TexturePacket& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void TexturePacket::SharedCtor() {
+  _cached_size_ = 0;
+  layerref_ = GOOGLE_ULONGLONG(0);
+  width_ = 0u;
+  height_ = 0u;
+  stride_ = 0u;
+  name_ = 0u;
+  target_ = 0u;
+  dataformat_ = 0u;
+  glcontext_ = GOOGLE_ULONGLONG(0);
+  data_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+TexturePacket::~TexturePacket() {
+  SharedDtor();
+}
+
+void TexturePacket::SharedDtor() {
+  if (data_ != &::google::protobuf::internal::kEmptyString) {
+    delete data_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void TexturePacket::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const TexturePacket& TexturePacket::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_LayerScopePacket_2eproto();  return *default_instance_;
+}
+
+TexturePacket* TexturePacket::default_instance_ = NULL;
+
+TexturePacket* TexturePacket::New() const {
+  return new TexturePacket;
+}
+
+void TexturePacket::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    layerref_ = GOOGLE_ULONGLONG(0);
+    width_ = 0u;
+    height_ = 0u;
+    stride_ = 0u;
+    name_ = 0u;
+    target_ = 0u;
+    dataformat_ = 0u;
+    glcontext_ = GOOGLE_ULONGLONG(0);
+  }
+  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    if (has_data()) {
+      if (data_ != &::google::protobuf::internal::kEmptyString) {
+        data_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool TexturePacket::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required uint64 layerref = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, &layerref_)));
+          set_has_layerref();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(16)) goto parse_width;
+        break;
+      }
+      
+      // optional uint32 width = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_width:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &width_)));
+          set_has_width();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(24)) goto parse_height;
+        break;
+      }
+      
+      // optional uint32 height = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_height:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &height_)));
+          set_has_height();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(32)) goto parse_stride;
+        break;
+      }
+      
+      // optional uint32 stride = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_stride:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &stride_)));
+          set_has_stride();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(40)) goto parse_name;
+        break;
+      }
+      
+      // optional uint32 name = 5;
+      case 5: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_name:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &name_)));
+          set_has_name();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(48)) goto parse_target;
+        break;
+      }
+      
+      // optional uint32 target = 6;
+      case 6: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_target:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &target_)));
+          set_has_target();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(56)) goto parse_dataformat;
+        break;
+      }
+      
+      // optional uint32 dataformat = 7;
+      case 7: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_dataformat:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &dataformat_)));
+          set_has_dataformat();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(64)) goto parse_glcontext;
+        break;
+      }
+      
+      // optional uint64 glcontext = 8;
+      case 8: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_glcontext:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, &glcontext_)));
+          set_has_glcontext();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(74)) goto parse_data;
+        break;
+      }
+      
+      // optional bytes data = 9;
+      case 9: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_data:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_data()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void TexturePacket::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required uint64 layerref = 1;
+  if (has_layerref()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->layerref(), output);
+  }
+  
+  // optional uint32 width = 2;
+  if (has_width()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->width(), output);
+  }
+  
+  // optional uint32 height = 3;
+  if (has_height()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->height(), output);
+  }
+  
+  // optional uint32 stride = 4;
+  if (has_stride()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->stride(), output);
+  }
+  
+  // optional uint32 name = 5;
+  if (has_name()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->name(), output);
+  }
+  
+  // optional uint32 target = 6;
+  if (has_target()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->target(), output);
+  }
+  
+  // optional uint32 dataformat = 7;
+  if (has_dataformat()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->dataformat(), output);
+  }
+  
+  // optional uint64 glcontext = 8;
+  if (has_glcontext()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(8, this->glcontext(), output);
+  }
+  
+  // optional bytes data = 9;
+  if (has_data()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      9, this->data(), output);
+  }
+  
+}
+
+int TexturePacket::ByteSize() const {
+  int total_size = 0;
+  
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required uint64 layerref = 1;
+    if (has_layerref()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt64Size(
+          this->layerref());
+    }
+    
+    // optional uint32 width = 2;
+    if (has_width()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->width());
+    }
+    
+    // optional uint32 height = 3;
+    if (has_height()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->height());
+    }
+    
+    // optional uint32 stride = 4;
+    if (has_stride()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->stride());
+    }
+    
+    // optional uint32 name = 5;
+    if (has_name()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->name());
+    }
+    
+    // optional uint32 target = 6;
+    if (has_target()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->target());
+    }
+    
+    // optional uint32 dataformat = 7;
+    if (has_dataformat()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->dataformat());
+    }
+    
+    // optional uint64 glcontext = 8;
+    if (has_glcontext()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt64Size(
+          this->glcontext());
+    }
+    
+  }
+  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    // optional bytes data = 9;
+    if (has_data()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::BytesSize(
+          this->data());
+    }
+    
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void TexturePacket::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const TexturePacket*>(&from));
+}
+
+void TexturePacket::MergeFrom(const TexturePacket& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_layerref()) {
+      set_layerref(from.layerref());
+    }
+    if (from.has_width()) {
+      set_width(from.width());
+    }
+    if (from.has_height()) {
+      set_height(from.height());
+    }
+    if (from.has_stride()) {
+      set_stride(from.stride());
+    }
+    if (from.has_name()) {
+      set_name(from.name());
+    }
+    if (from.has_target()) {
+      set_target(from.target());
+    }
+    if (from.has_dataformat()) {
+      set_dataformat(from.dataformat());
+    }
+    if (from.has_glcontext()) {
+      set_glcontext(from.glcontext());
+    }
+  }
+  if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    if (from.has_data()) {
+      set_data(from.data());
+    }
+  }
+}
+
+void TexturePacket::CopyFrom(const TexturePacket& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool TexturePacket::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  
+  return true;
+}
+
+void TexturePacket::Swap(TexturePacket* other) {
+  if (other != this) {
+    std::swap(layerref_, other->layerref_);
+    std::swap(width_, other->width_);
+    std::swap(height_, other->height_);
+    std::swap(stride_, other->stride_);
+    std::swap(name_, other->name_);
+    std::swap(target_, other->target_);
+    std::swap(dataformat_, other->dataformat_);
+    std::swap(glcontext_, other->glcontext_);
+    std::swap(data_, other->data_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string TexturePacket::GetTypeName() const {
+  return "mozilla.layers.layerscope.TexturePacket";
+}
+
+
+// ===================================================================
+
+bool Packet_DataType_IsValid(int value) {
+  switch(value) {
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+      return true;
+    default:
+      return false;
+  }
+}
+
+#ifndef _MSC_VER
+const Packet_DataType Packet::FRAMESTART;
+const Packet_DataType Packet::FRAMEEND;
+const Packet_DataType Packet::COLOR;
+const Packet_DataType Packet::TEXTURE;
+const Packet_DataType Packet::DataType_MIN;
+const Packet_DataType Packet::DataType_MAX;
+const int Packet::DataType_ARRAYSIZE;
+#endif  // _MSC_VER
+#ifndef _MSC_VER
+const int Packet::kTypeFieldNumber;
+const int Packet::kFrameFieldNumber;
+const int Packet::kColorFieldNumber;
+const int Packet::kTextureFieldNumber;
+#endif  // !_MSC_VER
+
+Packet::Packet()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void Packet::InitAsDefaultInstance() {
+  frame_ = const_cast< ::mozilla::layers::layerscope::FramePacket*>(&::mozilla::layers::layerscope::FramePacket::default_instance());
+  color_ = const_cast< ::mozilla::layers::layerscope::ColorPacket*>(&::mozilla::layers::layerscope::ColorPacket::default_instance());
+  texture_ = const_cast< ::mozilla::layers::layerscope::TexturePacket*>(&::mozilla::layers::layerscope::TexturePacket::default_instance());
+}
+
+Packet::Packet(const Packet& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void Packet::SharedCtor() {
+  _cached_size_ = 0;
+  type_ = 1;
+  frame_ = NULL;
+  color_ = NULL;
+  texture_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+Packet::~Packet() {
+  SharedDtor();
+}
+
+void Packet::SharedDtor() {
+  if (this != default_instance_) {
+    delete frame_;
+    delete color_;
+    delete texture_;
+  }
+}
+
+void Packet::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const Packet& Packet::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_LayerScopePacket_2eproto();  return *default_instance_;
+}
+
+Packet* Packet::default_instance_ = NULL;
+
+Packet* Packet::New() const {
+  return new Packet;
+}
+
+void Packet::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    type_ = 1;
+    if (has_frame()) {
+      if (frame_ != NULL) frame_->::mozilla::layers::layerscope::FramePacket::Clear();
+    }
+    if (has_color()) {
+      if (color_ != NULL) color_->::mozilla::layers::layerscope::ColorPacket::Clear();
+    }
+    if (has_texture()) {
+      if (texture_ != NULL) texture_->::mozilla::layers::layerscope::TexturePacket::Clear();
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool Packet::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .mozilla.layers.layerscope.Packet.DataType type = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::mozilla::layers::layerscope::Packet_DataType_IsValid(value)) {
+            set_type(static_cast< ::mozilla::layers::layerscope::Packet_DataType >(value));
+          }
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_frame;
+        break;
+      }
+      
+      // optional .mozilla.layers.layerscope.FramePacket frame = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_frame:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_frame()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(26)) goto parse_color;
+        break;
+      }
+      
+      // optional .mozilla.layers.layerscope.ColorPacket color = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_color:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_color()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(34)) goto parse_texture;
+        break;
+      }
+      
+      // optional .mozilla.layers.layerscope.TexturePacket texture = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_texture:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_texture()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void Packet::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required .mozilla.layers.layerscope.Packet.DataType type = 1;
+  if (has_type()) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      1, this->type(), output);
+  }
+  
+  // optional .mozilla.layers.layerscope.FramePacket frame = 2;
+  if (has_frame()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      2, this->frame(), output);
+  }
+  
+  // optional .mozilla.layers.layerscope.ColorPacket color = 3;
+  if (has_color()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      3, this->color(), output);
+  }
+  
+  // optional .mozilla.layers.layerscope.TexturePacket texture = 4;
+  if (has_texture()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      4, this->texture(), output);
+  }
+  
+}
+
+int Packet::ByteSize() const {
+  int total_size = 0;
+  
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .mozilla.layers.layerscope.Packet.DataType type = 1;
+    if (has_type()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
+    }
+    
+    // optional .mozilla.layers.layerscope.FramePacket frame = 2;
+    if (has_frame()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->frame());
+    }
+    
+    // optional .mozilla.layers.layerscope.ColorPacket color = 3;
+    if (has_color()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->color());
+    }
+    
+    // optional .mozilla.layers.layerscope.TexturePacket texture = 4;
+    if (has_texture()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->texture());
+    }
+    
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void Packet::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const Packet*>(&from));
+}
+
+void Packet::MergeFrom(const Packet& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_type()) {
+      set_type(from.type());
+    }
+    if (from.has_frame()) {
+      mutable_frame()->::mozilla::layers::layerscope::FramePacket::MergeFrom(from.frame());
+    }
+    if (from.has_color()) {
+      mutable_color()->::mozilla::layers::layerscope::ColorPacket::MergeFrom(from.color());
+    }
+    if (from.has_texture()) {
+      mutable_texture()->::mozilla::layers::layerscope::TexturePacket::MergeFrom(from.texture());
+    }
+  }
+}
+
+void Packet::CopyFrom(const Packet& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Packet::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  
+  if (has_color()) {
+    if (!this->color().IsInitialized()) return false;
+  }
+  if (has_texture()) {
+    if (!this->texture().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void Packet::Swap(Packet* other) {
+  if (other != this) {
+    std::swap(type_, other->type_);
+    std::swap(frame_, other->frame_);
+    std::swap(color_, other->color_);
+    std::swap(texture_, other->texture_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string Packet::GetTypeName() const {
+  return "mozilla.layers.layerscope.Packet";
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace layerscope
+}  // namespace layers
+}  // namespace mozilla
+
+// @@protoc_insertion_point(global_scope)
new file mode 100644
--- /dev/null
+++ b/gfx/layers/protobuf/LayerScopePacket.pb.h
@@ -0,0 +1,972 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: LayerScopePacket.proto
+
+#ifndef PROTOBUF_LayerScopePacket_2eproto__INCLUDED
+#define PROTOBUF_LayerScopePacket_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 2004000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please update
+#error your headers.
+#endif
+#if 2004001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/extension_set.h>
+// @@protoc_insertion_point(includes)
+
+namespace mozilla {
+namespace layers {
+namespace layerscope {
+
+// Internal implementation detail -- do not call these.
+void  protobuf_AddDesc_LayerScopePacket_2eproto();
+void protobuf_AssignDesc_LayerScopePacket_2eproto();
+void protobuf_ShutdownFile_LayerScopePacket_2eproto();
+
+class FramePacket;
+class ColorPacket;
+class TexturePacket;
+class Packet;
+
+enum Packet_DataType {
+  Packet_DataType_FRAMESTART = 1,
+  Packet_DataType_FRAMEEND = 2,
+  Packet_DataType_COLOR = 3,
+  Packet_DataType_TEXTURE = 4
+};
+bool Packet_DataType_IsValid(int value);
+const Packet_DataType Packet_DataType_DataType_MIN = Packet_DataType_FRAMESTART;
+const Packet_DataType Packet_DataType_DataType_MAX = Packet_DataType_TEXTURE;
+const int Packet_DataType_DataType_ARRAYSIZE = Packet_DataType_DataType_MAX + 1;
+
+// ===================================================================
+
+class FramePacket : public ::google::protobuf::MessageLite {
+ public:
+  FramePacket();
+  virtual ~FramePacket();
+  
+  FramePacket(const FramePacket& from);
+  
+  inline FramePacket& operator=(const FramePacket& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  
+  static const FramePacket& default_instance();
+  
+  void Swap(FramePacket* other);
+  
+  // implements Message ----------------------------------------------
+  
+  FramePacket* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const FramePacket& from);
+  void MergeFrom(const FramePacket& from);
+  void Clear();
+  bool IsInitialized() const;
+  
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  
+  ::std::string GetTypeName() const;
+  
+  // nested types ----------------------------------------------------
+  
+  // accessors -------------------------------------------------------
+  
+  // optional uint64 value = 1;
+  inline bool has_value() const;
+  inline void clear_value();
+  static const int kValueFieldNumber = 1;
+  inline ::google::protobuf::uint64 value() const;
+  inline void set_value(::google::protobuf::uint64 value);
+  
+  // @@protoc_insertion_point(class_scope:mozilla.layers.layerscope.FramePacket)
+ private:
+  inline void set_has_value();
+  inline void clear_has_value();
+  
+  ::google::protobuf::uint64 value_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_LayerScopePacket_2eproto();
+  friend void protobuf_AssignDesc_LayerScopePacket_2eproto();
+  friend void protobuf_ShutdownFile_LayerScopePacket_2eproto();
+  
+  void InitAsDefaultInstance();
+  static FramePacket* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ColorPacket : public ::google::protobuf::MessageLite {
+ public:
+  ColorPacket();
+  virtual ~ColorPacket();
+  
+  ColorPacket(const ColorPacket& from);
+  
+  inline ColorPacket& operator=(const ColorPacket& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  
+  static const ColorPacket& default_instance();
+  
+  void Swap(ColorPacket* other);
+  
+  // implements Message ----------------------------------------------
+  
+  ColorPacket* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const ColorPacket& from);
+  void MergeFrom(const ColorPacket& from);
+  void Clear();
+  bool IsInitialized() const;
+  
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  
+  ::std::string GetTypeName() const;
+  
+  // nested types ----------------------------------------------------
+  
+  // accessors -------------------------------------------------------
+  
+  // required uint64 layerref = 1;
+  inline bool has_layerref() const;
+  inline void clear_layerref();
+  static const int kLayerrefFieldNumber = 1;
+  inline ::google::protobuf::uint64 layerref() const;
+  inline void set_layerref(::google::protobuf::uint64 value);
+  
+  // optional uint32 width = 2;
+  inline bool has_width() const;
+  inline void clear_width();
+  static const int kWidthFieldNumber = 2;
+  inline ::google::protobuf::uint32 width() const;
+  inline void set_width(::google::protobuf::uint32 value);
+  
+  // optional uint32 height = 3;
+  inline bool has_height() const;
+  inline void clear_height();
+  static const int kHeightFieldNumber = 3;
+  inline ::google::protobuf::uint32 height() const;
+  inline void set_height(::google::protobuf::uint32 value);
+  
+  // optional uint32 color = 4;
+  inline bool has_color() const;
+  inline void clear_color();
+  static const int kColorFieldNumber = 4;
+  inline ::google::protobuf::uint32 color() const;
+  inline void set_color(::google::protobuf::uint32 value);
+  
+  // @@protoc_insertion_point(class_scope:mozilla.layers.layerscope.ColorPacket)
+ private:
+  inline void set_has_layerref();
+  inline void clear_has_layerref();
+  inline void set_has_width();
+  inline void clear_has_width();
+  inline void set_has_height();
+  inline void clear_has_height();
+  inline void set_has_color();
+  inline void clear_has_color();
+  
+  ::google::protobuf::uint64 layerref_;
+  ::google::protobuf::uint32 width_;
+  ::google::protobuf::uint32 height_;
+  ::google::protobuf::uint32 color_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_LayerScopePacket_2eproto();
+  friend void protobuf_AssignDesc_LayerScopePacket_2eproto();
+  friend void protobuf_ShutdownFile_LayerScopePacket_2eproto();
+  
+  void InitAsDefaultInstance();
+  static ColorPacket* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class TexturePacket : public ::google::protobuf::MessageLite {
+ public:
+  TexturePacket();
+  virtual ~TexturePacket();
+  
+  TexturePacket(const TexturePacket& from);
+  
+  inline TexturePacket& operator=(const TexturePacket& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  
+  static const TexturePacket& default_instance();
+  
+  void Swap(TexturePacket* other);
+  
+  // implements Message ----------------------------------------------
+  
+  TexturePacket* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const TexturePacket& from);
+  void MergeFrom(const TexturePacket& from);
+  void Clear();
+  bool IsInitialized() const;
+  
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  
+  ::std::string GetTypeName() const;
+  
+  // nested types ----------------------------------------------------
+  
+  // accessors -------------------------------------------------------
+  
+  // required uint64 layerref = 1;
+  inline bool has_layerref() const;
+  inline void clear_layerref();
+  static const int kLayerrefFieldNumber = 1;
+  inline ::google::protobuf::uint64 layerref() const;
+  inline void set_layerref(::google::protobuf::uint64 value);
+  
+  // optional uint32 width = 2;
+  inline bool has_width() const;
+  inline void clear_width();
+  static const int kWidthFieldNumber = 2;
+  inline ::google::protobuf::uint32 width() const;
+  inline void set_width(::google::protobuf::uint32 value);
+  
+  // optional uint32 height = 3;
+  inline bool has_height() const;
+  inline void clear_height();
+  static const int kHeightFieldNumber = 3;
+  inline ::google::protobuf::uint32 height() const;
+  inline void set_height(::google::protobuf::uint32 value);
+  
+  // optional uint32 stride = 4;
+  inline bool has_stride() const;
+  inline void clear_stride();
+  static const int kStrideFieldNumber = 4;
+  inline ::google::protobuf::uint32 stride() const;
+  inline void set_stride(::google::protobuf::uint32 value);
+  
+  // optional uint32 name = 5;
+  inline bool has_name() const;
+  inline void clear_name();
+  static const int kNameFieldNumber = 5;
+  inline ::google::protobuf::uint32 name() const;
+  inline void set_name(::google::protobuf::uint32 value);
+  
+  // optional uint32 target = 6;
+  inline bool has_target() const;
+  inline void clear_target();
+  static const int kTargetFieldNumber = 6;
+  inline ::google::protobuf::uint32 target() const;
+  inline void set_target(::google::protobuf::uint32 value);
+  
+  // optional uint32 dataformat = 7;
+  inline bool has_dataformat() const;
+  inline void clear_dataformat();
+  static const int kDataformatFieldNumber = 7;
+  inline ::google::protobuf::uint32 dataformat() const;
+  inline void set_dataformat(::google::protobuf::uint32 value);
+  
+  // optional uint64 glcontext = 8;
+  inline bool has_glcontext() const;
+  inline void clear_glcontext();
+  static const int kGlcontextFieldNumber = 8;
+  inline ::google::protobuf::uint64 glcontext() const;
+  inline void set_glcontext(::google::protobuf::uint64 value);
+  
+  // optional bytes data = 9;
+  inline bool has_data() const;
+  inline void clear_data();
+  static const int kDataFieldNumber = 9;
+  inline const ::std::string& data() const;
+  inline void set_data(const ::std::string& value);
+  inline void set_data(const char* value);
+  inline void set_data(const void* value, size_t size);
+  inline ::std::string* mutable_data();
+  inline ::std::string* release_data();
+  
+  // @@protoc_insertion_point(class_scope:mozilla.layers.layerscope.TexturePacket)
+ private:
+  inline void set_has_layerref();
+  inline void clear_has_layerref();
+  inline void set_has_width();
+  inline void clear_has_width();
+  inline void set_has_height();
+  inline void clear_has_height();
+  inline void set_has_stride();
+  inline void clear_has_stride();
+  inline void set_has_name();
+  inline void clear_has_name();
+  inline void set_has_target();
+  inline void clear_has_target();
+  inline void set_has_dataformat();
+  inline void clear_has_dataformat();
+  inline void set_has_glcontext();
+  inline void clear_has_glcontext();
+  inline void set_has_data();
+  inline void clear_has_data();
+  
+  ::google::protobuf::uint64 layerref_;
+  ::google::protobuf::uint32 width_;
+  ::google::protobuf::uint32 height_;
+  ::google::protobuf::uint32 stride_;
+  ::google::protobuf::uint32 name_;
+  ::google::protobuf::uint32 target_;
+  ::google::protobuf::uint32 dataformat_;
+  ::google::protobuf::uint64 glcontext_;
+  ::std::string* data_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(9 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_LayerScopePacket_2eproto();
+  friend void protobuf_AssignDesc_LayerScopePacket_2eproto();
+  friend void protobuf_ShutdownFile_LayerScopePacket_2eproto();
+  
+  void InitAsDefaultInstance();
+  static TexturePacket* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class Packet : public ::google::protobuf::MessageLite {
+ public:
+  Packet();
+  virtual ~Packet();
+  
+  Packet(const Packet& from);
+  
+  inline Packet& operator=(const Packet& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  
+  static const Packet& default_instance();
+  
+  void Swap(Packet* other);
+  
+  // implements Message ----------------------------------------------
+  
+  Packet* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const Packet& from);
+  void MergeFrom(const Packet& from);
+  void Clear();
+  bool IsInitialized() const;
+  
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  
+  ::std::string GetTypeName() const;
+  
+  // nested types ----------------------------------------------------
+  
+  typedef Packet_DataType DataType;
+  static const DataType FRAMESTART = Packet_DataType_FRAMESTART;
+  static const DataType FRAMEEND = Packet_DataType_FRAMEEND;
+  static const DataType COLOR = Packet_DataType_COLOR;
+  static const DataType TEXTURE = Packet_DataType_TEXTURE;
+  static inline bool DataType_IsValid(int value) {
+    return Packet_DataType_IsValid(value);
+  }
+  static const DataType DataType_MIN =
+    Packet_DataType_DataType_MIN;
+  static const DataType DataType_MAX =
+    Packet_DataType_DataType_MAX;
+  static const int DataType_ARRAYSIZE =
+    Packet_DataType_DataType_ARRAYSIZE;
+  
+  // accessors -------------------------------------------------------
+  
+  // required .mozilla.layers.layerscope.Packet.DataType type = 1;
+  inline bool has_type() const;
+  inline void clear_type();
+  static const int kTypeFieldNumber = 1;
+  inline ::mozilla::layers::layerscope::Packet_DataType type() const;
+  inline void set_type(::mozilla::layers::layerscope::Packet_DataType value);
+  
+  // optional .mozilla.layers.layerscope.FramePacket frame = 2;
+  inline bool has_frame() const;
+  inline void clear_frame();
+  static const int kFrameFieldNumber = 2;
+  inline const ::mozilla::layers::layerscope::FramePacket& frame() const;
+  inline ::mozilla::layers::layerscope::FramePacket* mutable_frame();
+  inline ::mozilla::layers::layerscope::FramePacket* release_frame();
+  
+  // optional .mozilla.layers.layerscope.ColorPacket color = 3;
+  inline bool has_color() const;
+  inline void clear_color();
+  static const int kColorFieldNumber = 3;
+  inline const ::mozilla::layers::layerscope::ColorPacket& color() const;
+  inline ::mozilla::layers::layerscope::ColorPacket* mutable_color();
+  inline ::mozilla::layers::layerscope::ColorPacket* release_color();
+  
+  // optional .mozilla.layers.layerscope.TexturePacket texture = 4;
+  inline bool has_texture() const;
+  inline void clear_texture();
+  static const int kTextureFieldNumber = 4;
+  inline const ::mozilla::layers::layerscope::TexturePacket& texture() const;
+  inline ::mozilla::layers::layerscope::TexturePacket* mutable_texture();
+  inline ::mozilla::layers::layerscope::TexturePacket* release_texture();
+  
+  // @@protoc_insertion_point(class_scope:mozilla.layers.layerscope.Packet)
+ private:
+  inline void set_has_type();
+  inline void clear_has_type();
+  inline void set_has_frame();
+  inline void clear_has_frame();
+  inline void set_has_color();
+  inline void clear_has_color();
+  inline void set_has_texture();
+  inline void clear_has_texture();
+  
+  ::mozilla::layers::layerscope::FramePacket* frame_;
+  ::mozilla::layers::layerscope::ColorPacket* color_;
+  ::mozilla::layers::layerscope::TexturePacket* texture_;
+  int type_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_LayerScopePacket_2eproto();
+  friend void protobuf_AssignDesc_LayerScopePacket_2eproto();
+  friend void protobuf_ShutdownFile_LayerScopePacket_2eproto();
+  
+  void InitAsDefaultInstance();
+  static Packet* default_instance_;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+// FramePacket
+
+// optional uint64 value = 1;
+inline bool FramePacket::has_value() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void FramePacket::set_has_value() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void FramePacket::clear_has_value() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void FramePacket::clear_value() {
+  value_ = GOOGLE_ULONGLONG(0);
+  clear_has_value();
+}
+inline ::google::protobuf::uint64 FramePacket::value() const {
+  return value_;
+}
+inline void FramePacket::set_value(::google::protobuf::uint64 value) {
+  set_has_value();
+  value_ = value;
+}
+
+// -------------------------------------------------------------------
+
+// ColorPacket
+
+// required uint64 layerref = 1;
+inline bool ColorPacket::has_layerref() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void ColorPacket::set_has_layerref() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void ColorPacket::clear_has_layerref() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void ColorPacket::clear_layerref() {
+  layerref_ = GOOGLE_ULONGLONG(0);
+  clear_has_layerref();
+}
+inline ::google::protobuf::uint64 ColorPacket::layerref() const {
+  return layerref_;
+}
+inline void ColorPacket::set_layerref(::google::protobuf::uint64 value) {
+  set_has_layerref();
+  layerref_ = value;
+}
+
+// optional uint32 width = 2;
+inline bool ColorPacket::has_width() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void ColorPacket::set_has_width() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void ColorPacket::clear_has_width() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void ColorPacket::clear_width() {
+  width_ = 0u;
+  clear_has_width();
+}
+inline ::google::protobuf::uint32 ColorPacket::width() const {
+  return width_;
+}
+inline void ColorPacket::set_width(::google::protobuf::uint32 value) {
+  set_has_width();
+  width_ = value;
+}
+
+// optional uint32 height = 3;
+inline bool ColorPacket::has_height() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void ColorPacket::set_has_height() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void ColorPacket::clear_has_height() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void ColorPacket::clear_height() {
+  height_ = 0u;
+  clear_has_height();
+}
+inline ::google::protobuf::uint32 ColorPacket::height() const {
+  return height_;
+}
+inline void ColorPacket::set_height(::google::protobuf::uint32 value) {
+  set_has_height();
+  height_ = value;
+}
+
+// optional uint32 color = 4;
+inline bool ColorPacket::has_color() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void ColorPacket::set_has_color() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void ColorPacket::clear_has_color() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void ColorPacket::clear_color() {
+  color_ = 0u;
+  clear_has_color();
+}
+inline ::google::protobuf::uint32 ColorPacket::color() const {
+  return color_;
+}
+inline void ColorPacket::set_color(::google::protobuf::uint32 value) {
+  set_has_color();
+  color_ = value;
+}
+
+// -------------------------------------------------------------------
+
+// TexturePacket
+
+// required uint64 layerref = 1;
+inline bool TexturePacket::has_layerref() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void TexturePacket::set_has_layerref() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void TexturePacket::clear_has_layerref() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void TexturePacket::clear_layerref() {
+  layerref_ = GOOGLE_ULONGLONG(0);
+  clear_has_layerref();
+}
+inline ::google::protobuf::uint64 TexturePacket::layerref() const {
+  return layerref_;
+}
+inline void TexturePacket::set_layerref(::google::protobuf::uint64 value) {
+  set_has_layerref();
+  layerref_ = value;
+}
+
+// optional uint32 width = 2;
+inline bool TexturePacket::has_width() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void TexturePacket::set_has_width() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void TexturePacket::clear_has_width() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void TexturePacket::clear_width() {
+  width_ = 0u;
+  clear_has_width();
+}
+inline ::google::protobuf::uint32 TexturePacket::width() const {
+  return width_;
+}
+inline void TexturePacket::set_width(::google::protobuf::uint32 value) {
+  set_has_width();
+  width_ = value;
+}
+
+// optional uint32 height = 3;
+inline bool TexturePacket::has_height() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void TexturePacket::set_has_height() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void TexturePacket::clear_has_height() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void TexturePacket::clear_height() {
+  height_ = 0u;
+  clear_has_height();
+}
+inline ::google::protobuf::uint32 TexturePacket::height() const {
+  return height_;
+}
+inline void TexturePacket::set_height(::google::protobuf::uint32 value) {
+  set_has_height();
+  height_ = value;
+}
+
+// optional uint32 stride = 4;
+inline bool TexturePacket::has_stride() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void TexturePacket::set_has_stride() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void TexturePacket::clear_has_stride() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void TexturePacket::clear_stride() {
+  stride_ = 0u;
+  clear_has_stride();
+}
+inline ::google::protobuf::uint32 TexturePacket::stride() const {
+  return stride_;
+}
+inline void TexturePacket::set_stride(::google::protobuf::uint32 value) {
+  set_has_stride();
+  stride_ = value;
+}
+
+// optional uint32 name = 5;
+inline bool TexturePacket::has_name() const {
+  return (_has_bits_[0] & 0x00000010u) != 0;
+}
+inline void TexturePacket::set_has_name() {
+  _has_bits_[0] |= 0x00000010u;
+}
+inline void TexturePacket::clear_has_name() {
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline void TexturePacket::clear_name() {
+  name_ = 0u;
+  clear_has_name();
+}
+inline ::google::protobuf::uint32 TexturePacket::name() const {
+  return name_;
+}
+inline void TexturePacket::set_name(::google::protobuf::uint32 value) {
+  set_has_name();
+  name_ = value;
+}
+
+// optional uint32 target = 6;
+inline bool TexturePacket::has_target() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
+}
+inline void TexturePacket::set_has_target() {
+  _has_bits_[0] |= 0x00000020u;
+}
+inline void TexturePacket::clear_has_target() {
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline void TexturePacket::clear_target() {
+  target_ = 0u;
+  clear_has_target();
+}
+inline ::google::protobuf::uint32 TexturePacket::target() const {
+  return target_;
+}
+inline void TexturePacket::set_target(::google::protobuf::uint32 value) {
+  set_has_target();
+  target_ = value;
+}
+
+// optional uint32 dataformat = 7;
+inline bool TexturePacket::has_dataformat() const {
+  return (_has_bits_[0] & 0x00000040u) != 0;
+}
+inline void TexturePacket::set_has_dataformat() {
+  _has_bits_[0] |= 0x00000040u;
+}
+inline void TexturePacket::clear_has_dataformat() {
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline void TexturePacket::clear_dataformat() {
+  dataformat_ = 0u;
+  clear_has_dataformat();
+}
+inline ::google::protobuf::uint32 TexturePacket::dataformat() const {
+  return dataformat_;
+}
+inline void TexturePacket::set_dataformat(::google::protobuf::uint32 value) {
+  set_has_dataformat();
+  dataformat_ = value;
+}
+
+// optional uint64 glcontext = 8;
+inline bool TexturePacket::has_glcontext() const {
+  return (_has_bits_[0] & 0x00000080u) != 0;
+}
+inline void TexturePacket::set_has_glcontext() {
+  _has_bits_[0] |= 0x00000080u;
+}
+inline void TexturePacket::clear_has_glcontext() {
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline void TexturePacket::clear_glcontext() {
+  glcontext_ = GOOGLE_ULONGLONG(0);
+  clear_has_glcontext();
+}
+inline ::google::protobuf::uint64 TexturePacket::glcontext() const {
+  return glcontext_;
+}
+inline void TexturePacket::set_glcontext(::google::protobuf::uint64 value) {
+  set_has_glcontext();
+  glcontext_ = value;
+}
+
+// optional bytes data = 9;
+inline bool TexturePacket::has_data() const {
+  return (_has_bits_[0] & 0x00000100u) != 0;
+}
+inline void TexturePacket::set_has_data() {
+  _has_bits_[0] |= 0x00000100u;
+}
+inline void TexturePacket::clear_has_data() {
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline void TexturePacket::clear_data() {
+  if (data_ != &::google::protobuf::internal::kEmptyString) {
+    data_->clear();
+  }
+  clear_has_data();
+}
+inline const ::std::string& TexturePacket::data() const {
+  return *data_;
+}
+inline void TexturePacket::set_data(const ::std::string& value) {
+  set_has_data();
+  if (data_ == &::google::protobuf::internal::kEmptyString) {
+    data_ = new ::std::string;
+  }
+  data_->assign(value);
+}
+inline void TexturePacket::set_data(const char* value) {
+  set_has_data();
+  if (data_ == &::google::protobuf::internal::kEmptyString) {
+    data_ = new ::std::string;
+  }
+  data_->assign(value);
+}
+inline void TexturePacket::set_data(const void* value, size_t size) {
+  set_has_data();
+  if (data_ == &::google::protobuf::internal::kEmptyString) {
+    data_ = new ::std::string;
+  }
+  data_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* TexturePacket::mutable_data() {
+  set_has_data();
+  if (data_ == &::google::protobuf::internal::kEmptyString) {
+    data_ = new ::std::string;
+  }
+  return data_;
+}
+inline ::std::string* TexturePacket::release_data() {
+  clear_has_data();
+  if (data_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = data_;
+    data_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// Packet
+
+// required .mozilla.layers.layerscope.Packet.DataType type = 1;
+inline bool Packet::has_type() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Packet::set_has_type() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Packet::clear_has_type() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Packet::clear_type() {
+  type_ = 1;
+  clear_has_type();
+}
+inline ::mozilla::layers::layerscope::Packet_DataType Packet::type() const {
+  return static_cast< ::mozilla::layers::layerscope::Packet_DataType >(type_);
+}
+inline void Packet::set_type(::mozilla::layers::layerscope::Packet_DataType value) {
+  GOOGLE_DCHECK(::mozilla::layers::layerscope::Packet_DataType_IsValid(value));
+  set_has_type();
+  type_ = value;
+}
+
+// optional .mozilla.layers.layerscope.FramePacket frame = 2;
+inline bool Packet::has_frame() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void Packet::set_has_frame() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void Packet::clear_has_frame() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void Packet::clear_frame() {
+  if (frame_ != NULL) frame_->::mozilla::layers::layerscope::FramePacket::Clear();
+  clear_has_frame();
+}
+inline const ::mozilla::layers::layerscope::FramePacket& Packet::frame() const {
+  return frame_ != NULL ? *frame_ : *default_instance_->frame_;
+}
+inline ::mozilla::layers::layerscope::FramePacket* Packet::mutable_frame() {
+  set_has_frame();
+  if (frame_ == NULL) frame_ = new ::mozilla::layers::layerscope::FramePacket;
+  return frame_;
+}
+inline ::mozilla::layers::layerscope::FramePacket* Packet::release_frame() {
+  clear_has_frame();
+  ::mozilla::layers::layerscope::FramePacket* temp = frame_;
+  frame_ = NULL;
+  return temp;
+}
+
+// optional .mozilla.layers.layerscope.ColorPacket color = 3;
+inline bool Packet::has_color() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void Packet::set_has_color() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void Packet::clear_has_color() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void Packet::clear_color() {
+  if (color_ != NULL) color_->::mozilla::layers::layerscope::ColorPacket::Clear();
+  clear_has_color();
+}
+inline const ::mozilla::layers::layerscope::ColorPacket& Packet::color() const {
+  return color_ != NULL ? *color_ : *default_instance_->color_;
+}
+inline ::mozilla::layers::layerscope::ColorPacket* Packet::mutable_color() {
+  set_has_color();
+  if (color_ == NULL) color_ = new ::mozilla::layers::layerscope::ColorPacket;
+  return color_;
+}
+inline ::mozilla::layers::layerscope::ColorPacket* Packet::release_color() {
+  clear_has_color();
+  ::mozilla::layers::layerscope::ColorPacket* temp = color_;
+  color_ = NULL;
+  return temp;
+}
+
+// optional .mozilla.layers.layerscope.TexturePacket texture = 4;
+inline bool Packet::has_texture() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Packet::set_has_texture() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Packet::clear_has_texture() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void Packet::clear_texture() {
+  if (texture_ != NULL) texture_->::mozilla::layers::layerscope::TexturePacket::Clear();
+  clear_has_texture();
+}
+inline const ::mozilla::layers::layerscope::TexturePacket& Packet::texture() const {
+  return texture_ != NULL ? *texture_ : *default_instance_->texture_;
+}
+inline ::mozilla::layers::layerscope::TexturePacket* Packet::mutable_texture() {
+  set_has_texture();
+  if (texture_ == NULL) texture_ = new ::mozilla::layers::layerscope::TexturePacket;
+  return texture_;
+}
+inline ::mozilla::layers::layerscope::TexturePacket* Packet::release_texture() {
+  clear_has_texture();
+  ::mozilla::layers::layerscope::TexturePacket* temp = texture_;
+  texture_ = NULL;
+  return temp;
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace layerscope
+}  // namespace layers
+}  // namespace mozilla
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_LayerScopePacket_2eproto__INCLUDED
new file mode 100644
--- /dev/null
+++ b/gfx/layers/protobuf/LayerScopePacket.proto
@@ -0,0 +1,40 @@
+option optimize_for = LITE_RUNTIME;
+
+package mozilla.layers.layerscope;
+
+message FramePacket {
+  optional uint64 value = 1;
+}
+
+message ColorPacket {
+  required uint64 layerref = 1;
+  optional uint32 width = 2;
+  optional uint32 height = 3;
+  optional uint32 color = 4;
+}
+
+message TexturePacket {
+  required uint64 layerref = 1;
+  optional uint32 width = 2;
+  optional uint32 height = 3;
+  optional uint32 stride = 4;
+  optional uint32 name = 5;
+  optional uint32 target = 6;
+  optional uint32 dataformat = 7;
+  optional uint64 glcontext = 8;
+  optional bytes data = 9;
+}
+
+message Packet {
+  enum DataType {
+    FRAMESTART = 1;
+    FRAMEEND = 2;
+    COLOR = 3;
+    TEXTURE = 4;
+  }
+  required DataType type = 1;
+
+  optional FramePacket frame = 2;
+  optional ColorPacket color = 3;
+  optional TexturePacket texture = 4;
+}
--- a/toolkit/components/protobuf/moz.build
+++ b/toolkit/components/protobuf/moz.build
@@ -1,32 +1,32 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXPORTS.protobuf.google.protobuf += [
+EXPORTS.google.protobuf += [
     'google/protobuf/extension_set.h',
     'google/protobuf/generated_message_util.h',
     'google/protobuf/message_lite.h',
     'google/protobuf/repeated_field.h',
     'google/protobuf/wire_format_lite.h',
     'google/protobuf/wire_format_lite_inl.h',
 ]
 
-EXPORTS.protobuf.google.protobuf.stubs += [
+EXPORTS.google.protobuf.stubs += [
     'google/protobuf/stubs/common.h',
     'google/protobuf/stubs/hash.h',
     'google/protobuf/stubs/map-util.h',
     'google/protobuf/stubs/once.h',
     'google/protobuf/stubs/stl_util-inl.h',
 ]
 
-EXPORTS.protobuf.google.protobuf.io += [
+EXPORTS.google.protobuf.io += [
     'google/protobuf/io/coded_stream.h',
     'google/protobuf/io/coded_stream_inl.h',
     'google/protobuf/io/zero_copy_stream.h',
     'google/protobuf/io/zero_copy_stream_impl.h',
     'google/protobuf/io/zero_copy_stream_impl_lite.h',
     'google/protobuf/package_info.h',
 ]