| // chrome/common/media/webrtc_logging.mojom.js is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2014 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| 'use strict'; |
| |
| (function() { |
| var mojomId = 'chrome/common/media/webrtc_logging.mojom'; |
| if (mojo.internal.isMojomLoaded(mojomId)) { |
| console.warn('The following mojom is loaded multiple times: ' + mojomId); |
| return; |
| } |
| mojo.internal.markMojomLoaded(mojomId); |
| var bindings = mojo; |
| var associatedBindings = mojo; |
| var codec = mojo.internal; |
| var validator = mojo.internal; |
| |
| var exports = mojo.internal.exposeNamespace('chrome.mojom'); |
| var time$ = |
| mojo.internal.exposeNamespace('mojoBase.mojom'); |
| if (mojo.config.autoLoadMojomDeps) { |
| mojo.internal.loadMojomIfNecessary( |
| 'mojo/public/mojom/base/time.mojom', '../../../mojo/public/mojom/base/time.mojom.js'); |
| } |
| |
| |
| |
| function WebRtcLoggingMessage(values) { |
| this.initDefaults_(); |
| this.initFields_(values); |
| } |
| |
| |
| WebRtcLoggingMessage.prototype.initDefaults_ = function() { |
| this.timestamp = null; |
| this.data = null; |
| }; |
| WebRtcLoggingMessage.prototype.initFields_ = function(fields) { |
| for(var field in fields) { |
| if (this.hasOwnProperty(field)) |
| this[field] = fields[field]; |
| } |
| }; |
| |
| WebRtcLoggingMessage.validate = function(messageValidator, offset) { |
| var err; |
| err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| var kVersionSizes = [ |
| {version: 0, numBytes: 24} |
| ]; |
| err = messageValidator.validateStructVersion(offset, kVersionSizes); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| |
| // validate WebRtcLoggingMessage.timestamp |
| err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, time$.Time, false); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| |
| // validate WebRtcLoggingMessage.data |
| err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false) |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| return validator.validationError.NONE; |
| }; |
| |
| WebRtcLoggingMessage.encodedSize = codec.kStructHeaderSize + 16; |
| |
| WebRtcLoggingMessage.decode = function(decoder) { |
| var packed; |
| var val = new WebRtcLoggingMessage(); |
| var numberOfBytes = decoder.readUint32(); |
| var version = decoder.readUint32(); |
| val.timestamp = |
| decoder.decodeStructPointer(time$.Time); |
| val.data = |
| decoder.decodeStruct(codec.String); |
| return val; |
| }; |
| |
| WebRtcLoggingMessage.encode = function(encoder, val) { |
| var packed; |
| encoder.writeUint32(WebRtcLoggingMessage.encodedSize); |
| encoder.writeUint32(0); |
| encoder.encodeStructPointer(time$.Time, val.timestamp); |
| encoder.encodeStruct(codec.String, val.data); |
| }; |
| function WebRtcLoggingClient_OnAddMessages_Params(values) { |
| this.initDefaults_(); |
| this.initFields_(values); |
| } |
| |
| |
| WebRtcLoggingClient_OnAddMessages_Params.prototype.initDefaults_ = function() { |
| this.messages = null; |
| }; |
| WebRtcLoggingClient_OnAddMessages_Params.prototype.initFields_ = function(fields) { |
| for(var field in fields) { |
| if (this.hasOwnProperty(field)) |
| this[field] = fields[field]; |
| } |
| }; |
| |
| WebRtcLoggingClient_OnAddMessages_Params.validate = function(messageValidator, offset) { |
| var err; |
| err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| var kVersionSizes = [ |
| {version: 0, numBytes: 16} |
| ]; |
| err = messageValidator.validateStructVersion(offset, kVersionSizes); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| |
| // validate WebRtcLoggingClient_OnAddMessages_Params.messages |
| err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(WebRtcLoggingMessage), false, [0], 0); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| return validator.validationError.NONE; |
| }; |
| |
| WebRtcLoggingClient_OnAddMessages_Params.encodedSize = codec.kStructHeaderSize + 8; |
| |
| WebRtcLoggingClient_OnAddMessages_Params.decode = function(decoder) { |
| var packed; |
| var val = new WebRtcLoggingClient_OnAddMessages_Params(); |
| var numberOfBytes = decoder.readUint32(); |
| var version = decoder.readUint32(); |
| val.messages = |
| decoder.decodeArrayPointer(new codec.PointerTo(WebRtcLoggingMessage)); |
| return val; |
| }; |
| |
| WebRtcLoggingClient_OnAddMessages_Params.encode = function(encoder, val) { |
| var packed; |
| encoder.writeUint32(WebRtcLoggingClient_OnAddMessages_Params.encodedSize); |
| encoder.writeUint32(0); |
| encoder.encodeArrayPointer(new codec.PointerTo(WebRtcLoggingMessage), val.messages); |
| }; |
| function WebRtcLoggingClient_OnStopped_Params(values) { |
| this.initDefaults_(); |
| this.initFields_(values); |
| } |
| |
| |
| WebRtcLoggingClient_OnStopped_Params.prototype.initDefaults_ = function() { |
| }; |
| WebRtcLoggingClient_OnStopped_Params.prototype.initFields_ = function(fields) { |
| for(var field in fields) { |
| if (this.hasOwnProperty(field)) |
| this[field] = fields[field]; |
| } |
| }; |
| |
| WebRtcLoggingClient_OnStopped_Params.validate = function(messageValidator, offset) { |
| var err; |
| err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| var kVersionSizes = [ |
| {version: 0, numBytes: 8} |
| ]; |
| err = messageValidator.validateStructVersion(offset, kVersionSizes); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| return validator.validationError.NONE; |
| }; |
| |
| WebRtcLoggingClient_OnStopped_Params.encodedSize = codec.kStructHeaderSize + 0; |
| |
| WebRtcLoggingClient_OnStopped_Params.decode = function(decoder) { |
| var packed; |
| var val = new WebRtcLoggingClient_OnStopped_Params(); |
| var numberOfBytes = decoder.readUint32(); |
| var version = decoder.readUint32(); |
| return val; |
| }; |
| |
| WebRtcLoggingClient_OnStopped_Params.encode = function(encoder, val) { |
| var packed; |
| encoder.writeUint32(WebRtcLoggingClient_OnStopped_Params.encodedSize); |
| encoder.writeUint32(0); |
| }; |
| function WebRtcLoggingAgent_Start_Params(values) { |
| this.initDefaults_(); |
| this.initFields_(values); |
| } |
| |
| |
| WebRtcLoggingAgent_Start_Params.prototype.initDefaults_ = function() { |
| this.client = new WebRtcLoggingClientPtr(); |
| }; |
| WebRtcLoggingAgent_Start_Params.prototype.initFields_ = function(fields) { |
| for(var field in fields) { |
| if (this.hasOwnProperty(field)) |
| this[field] = fields[field]; |
| } |
| }; |
| |
| WebRtcLoggingAgent_Start_Params.validate = function(messageValidator, offset) { |
| var err; |
| err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| var kVersionSizes = [ |
| {version: 0, numBytes: 16} |
| ]; |
| err = messageValidator.validateStructVersion(offset, kVersionSizes); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| |
| // validate WebRtcLoggingAgent_Start_Params.client |
| err = messageValidator.validateInterface(offset + codec.kStructHeaderSize + 0, false); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| return validator.validationError.NONE; |
| }; |
| |
| WebRtcLoggingAgent_Start_Params.encodedSize = codec.kStructHeaderSize + 8; |
| |
| WebRtcLoggingAgent_Start_Params.decode = function(decoder) { |
| var packed; |
| var val = new WebRtcLoggingAgent_Start_Params(); |
| var numberOfBytes = decoder.readUint32(); |
| var version = decoder.readUint32(); |
| val.client = |
| decoder.decodeStruct(new codec.Interface(WebRtcLoggingClientPtr)); |
| return val; |
| }; |
| |
| WebRtcLoggingAgent_Start_Params.encode = function(encoder, val) { |
| var packed; |
| encoder.writeUint32(WebRtcLoggingAgent_Start_Params.encodedSize); |
| encoder.writeUint32(0); |
| encoder.encodeStruct(new codec.Interface(WebRtcLoggingClientPtr), val.client); |
| }; |
| function WebRtcLoggingAgent_Stop_Params(values) { |
| this.initDefaults_(); |
| this.initFields_(values); |
| } |
| |
| |
| WebRtcLoggingAgent_Stop_Params.prototype.initDefaults_ = function() { |
| }; |
| WebRtcLoggingAgent_Stop_Params.prototype.initFields_ = function(fields) { |
| for(var field in fields) { |
| if (this.hasOwnProperty(field)) |
| this[field] = fields[field]; |
| } |
| }; |
| |
| WebRtcLoggingAgent_Stop_Params.validate = function(messageValidator, offset) { |
| var err; |
| err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| var kVersionSizes = [ |
| {version: 0, numBytes: 8} |
| ]; |
| err = messageValidator.validateStructVersion(offset, kVersionSizes); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| return validator.validationError.NONE; |
| }; |
| |
| WebRtcLoggingAgent_Stop_Params.encodedSize = codec.kStructHeaderSize + 0; |
| |
| WebRtcLoggingAgent_Stop_Params.decode = function(decoder) { |
| var packed; |
| var val = new WebRtcLoggingAgent_Stop_Params(); |
| var numberOfBytes = decoder.readUint32(); |
| var version = decoder.readUint32(); |
| return val; |
| }; |
| |
| WebRtcLoggingAgent_Stop_Params.encode = function(encoder, val) { |
| var packed; |
| encoder.writeUint32(WebRtcLoggingAgent_Stop_Params.encodedSize); |
| encoder.writeUint32(0); |
| }; |
| var kWebRtcLoggingClient_OnAddMessages_Name = 0; |
| var kWebRtcLoggingClient_OnStopped_Name = 1; |
| |
| function WebRtcLoggingClientPtr(handleOrPtrInfo) { |
| this.ptr = new bindings.InterfacePtrController(WebRtcLoggingClient, |
| handleOrPtrInfo); |
| } |
| |
| function WebRtcLoggingClientAssociatedPtr(associatedInterfacePtrInfo) { |
| this.ptr = new associatedBindings.AssociatedInterfacePtrController( |
| WebRtcLoggingClient, associatedInterfacePtrInfo); |
| } |
| |
| WebRtcLoggingClientAssociatedPtr.prototype = |
| Object.create(WebRtcLoggingClientPtr.prototype); |
| WebRtcLoggingClientAssociatedPtr.prototype.constructor = |
| WebRtcLoggingClientAssociatedPtr; |
| |
| function WebRtcLoggingClientProxy(receiver) { |
| this.receiver_ = receiver; |
| } |
| WebRtcLoggingClientPtr.prototype.onAddMessages = function() { |
| return WebRtcLoggingClientProxy.prototype.onAddMessages |
| .apply(this.ptr.getProxy(), arguments); |
| }; |
| |
| WebRtcLoggingClientProxy.prototype.onAddMessages = function(messages) { |
| var params_ = new WebRtcLoggingClient_OnAddMessages_Params(); |
| params_.messages = messages; |
| var builder = new codec.MessageV0Builder( |
| kWebRtcLoggingClient_OnAddMessages_Name, |
| codec.align(WebRtcLoggingClient_OnAddMessages_Params.encodedSize)); |
| builder.encodeStruct(WebRtcLoggingClient_OnAddMessages_Params, params_); |
| var message = builder.finish(); |
| this.receiver_.accept(message); |
| }; |
| WebRtcLoggingClientPtr.prototype.onStopped = function() { |
| return WebRtcLoggingClientProxy.prototype.onStopped |
| .apply(this.ptr.getProxy(), arguments); |
| }; |
| |
| WebRtcLoggingClientProxy.prototype.onStopped = function() { |
| var params_ = new WebRtcLoggingClient_OnStopped_Params(); |
| var builder = new codec.MessageV0Builder( |
| kWebRtcLoggingClient_OnStopped_Name, |
| codec.align(WebRtcLoggingClient_OnStopped_Params.encodedSize)); |
| builder.encodeStruct(WebRtcLoggingClient_OnStopped_Params, params_); |
| var message = builder.finish(); |
| this.receiver_.accept(message); |
| }; |
| |
| function WebRtcLoggingClientStub(delegate) { |
| this.delegate_ = delegate; |
| } |
| WebRtcLoggingClientStub.prototype.onAddMessages = function(messages) { |
| return this.delegate_ && this.delegate_.onAddMessages && this.delegate_.onAddMessages(messages); |
| } |
| WebRtcLoggingClientStub.prototype.onStopped = function() { |
| return this.delegate_ && this.delegate_.onStopped && this.delegate_.onStopped(); |
| } |
| |
| WebRtcLoggingClientStub.prototype.accept = function(message) { |
| var reader = new codec.MessageReader(message); |
| switch (reader.messageName) { |
| case kWebRtcLoggingClient_OnAddMessages_Name: |
| var params = reader.decodeStruct(WebRtcLoggingClient_OnAddMessages_Params); |
| this.onAddMessages(params.messages); |
| return true; |
| case kWebRtcLoggingClient_OnStopped_Name: |
| var params = reader.decodeStruct(WebRtcLoggingClient_OnStopped_Params); |
| this.onStopped(); |
| return true; |
| default: |
| return false; |
| } |
| }; |
| |
| WebRtcLoggingClientStub.prototype.acceptWithResponder = |
| function(message, responder) { |
| var reader = new codec.MessageReader(message); |
| switch (reader.messageName) { |
| default: |
| return false; |
| } |
| }; |
| |
| function validateWebRtcLoggingClientRequest(messageValidator) { |
| var message = messageValidator.message; |
| var paramsClass = null; |
| switch (message.getName()) { |
| case kWebRtcLoggingClient_OnAddMessages_Name: |
| if (!message.expectsResponse() && !message.isResponse()) |
| paramsClass = WebRtcLoggingClient_OnAddMessages_Params; |
| break; |
| case kWebRtcLoggingClient_OnStopped_Name: |
| if (!message.expectsResponse() && !message.isResponse()) |
| paramsClass = WebRtcLoggingClient_OnStopped_Params; |
| break; |
| } |
| if (paramsClass === null) |
| return validator.validationError.NONE; |
| return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); |
| } |
| |
| function validateWebRtcLoggingClientResponse(messageValidator) { |
| return validator.validationError.NONE; |
| } |
| |
| var WebRtcLoggingClient = { |
| name: 'chrome.mojom.WebRtcLoggingClient', |
| kVersion: 0, |
| ptrClass: WebRtcLoggingClientPtr, |
| proxyClass: WebRtcLoggingClientProxy, |
| stubClass: WebRtcLoggingClientStub, |
| validateRequest: validateWebRtcLoggingClientRequest, |
| validateResponse: null, |
| }; |
| WebRtcLoggingClientStub.prototype.validator = validateWebRtcLoggingClientRequest; |
| WebRtcLoggingClientProxy.prototype.validator = null; |
| var kWebRtcLoggingAgent_Start_Name = 0; |
| var kWebRtcLoggingAgent_Stop_Name = 1; |
| |
| function WebRtcLoggingAgentPtr(handleOrPtrInfo) { |
| this.ptr = new bindings.InterfacePtrController(WebRtcLoggingAgent, |
| handleOrPtrInfo); |
| } |
| |
| function WebRtcLoggingAgentAssociatedPtr(associatedInterfacePtrInfo) { |
| this.ptr = new associatedBindings.AssociatedInterfacePtrController( |
| WebRtcLoggingAgent, associatedInterfacePtrInfo); |
| } |
| |
| WebRtcLoggingAgentAssociatedPtr.prototype = |
| Object.create(WebRtcLoggingAgentPtr.prototype); |
| WebRtcLoggingAgentAssociatedPtr.prototype.constructor = |
| WebRtcLoggingAgentAssociatedPtr; |
| |
| function WebRtcLoggingAgentProxy(receiver) { |
| this.receiver_ = receiver; |
| } |
| WebRtcLoggingAgentPtr.prototype.start = function() { |
| return WebRtcLoggingAgentProxy.prototype.start |
| .apply(this.ptr.getProxy(), arguments); |
| }; |
| |
| WebRtcLoggingAgentProxy.prototype.start = function(client) { |
| var params_ = new WebRtcLoggingAgent_Start_Params(); |
| params_.client = client; |
| var builder = new codec.MessageV0Builder( |
| kWebRtcLoggingAgent_Start_Name, |
| codec.align(WebRtcLoggingAgent_Start_Params.encodedSize)); |
| builder.encodeStruct(WebRtcLoggingAgent_Start_Params, params_); |
| var message = builder.finish(); |
| this.receiver_.accept(message); |
| }; |
| WebRtcLoggingAgentPtr.prototype.stop = function() { |
| return WebRtcLoggingAgentProxy.prototype.stop |
| .apply(this.ptr.getProxy(), arguments); |
| }; |
| |
| WebRtcLoggingAgentProxy.prototype.stop = function() { |
| var params_ = new WebRtcLoggingAgent_Stop_Params(); |
| var builder = new codec.MessageV0Builder( |
| kWebRtcLoggingAgent_Stop_Name, |
| codec.align(WebRtcLoggingAgent_Stop_Params.encodedSize)); |
| builder.encodeStruct(WebRtcLoggingAgent_Stop_Params, params_); |
| var message = builder.finish(); |
| this.receiver_.accept(message); |
| }; |
| |
| function WebRtcLoggingAgentStub(delegate) { |
| this.delegate_ = delegate; |
| } |
| WebRtcLoggingAgentStub.prototype.start = function(client) { |
| return this.delegate_ && this.delegate_.start && this.delegate_.start(client); |
| } |
| WebRtcLoggingAgentStub.prototype.stop = function() { |
| return this.delegate_ && this.delegate_.stop && this.delegate_.stop(); |
| } |
| |
| WebRtcLoggingAgentStub.prototype.accept = function(message) { |
| var reader = new codec.MessageReader(message); |
| switch (reader.messageName) { |
| case kWebRtcLoggingAgent_Start_Name: |
| var params = reader.decodeStruct(WebRtcLoggingAgent_Start_Params); |
| this.start(params.client); |
| return true; |
| case kWebRtcLoggingAgent_Stop_Name: |
| var params = reader.decodeStruct(WebRtcLoggingAgent_Stop_Params); |
| this.stop(); |
| return true; |
| default: |
| return false; |
| } |
| }; |
| |
| WebRtcLoggingAgentStub.prototype.acceptWithResponder = |
| function(message, responder) { |
| var reader = new codec.MessageReader(message); |
| switch (reader.messageName) { |
| default: |
| return false; |
| } |
| }; |
| |
| function validateWebRtcLoggingAgentRequest(messageValidator) { |
| var message = messageValidator.message; |
| var paramsClass = null; |
| switch (message.getName()) { |
| case kWebRtcLoggingAgent_Start_Name: |
| if (!message.expectsResponse() && !message.isResponse()) |
| paramsClass = WebRtcLoggingAgent_Start_Params; |
| break; |
| case kWebRtcLoggingAgent_Stop_Name: |
| if (!message.expectsResponse() && !message.isResponse()) |
| paramsClass = WebRtcLoggingAgent_Stop_Params; |
| break; |
| } |
| if (paramsClass === null) |
| return validator.validationError.NONE; |
| return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); |
| } |
| |
| function validateWebRtcLoggingAgentResponse(messageValidator) { |
| return validator.validationError.NONE; |
| } |
| |
| var WebRtcLoggingAgent = { |
| name: 'chrome.mojom.WebRtcLoggingAgent', |
| kVersion: 0, |
| ptrClass: WebRtcLoggingAgentPtr, |
| proxyClass: WebRtcLoggingAgentProxy, |
| stubClass: WebRtcLoggingAgentStub, |
| validateRequest: validateWebRtcLoggingAgentRequest, |
| validateResponse: null, |
| }; |
| WebRtcLoggingAgentStub.prototype.validator = validateWebRtcLoggingAgentRequest; |
| WebRtcLoggingAgentProxy.prototype.validator = null; |
| exports.WebRtcLoggingMessage = WebRtcLoggingMessage; |
| exports.WebRtcLoggingClient = WebRtcLoggingClient; |
| exports.WebRtcLoggingClientPtr = WebRtcLoggingClientPtr; |
| exports.WebRtcLoggingClientAssociatedPtr = WebRtcLoggingClientAssociatedPtr; |
| exports.WebRtcLoggingAgent = WebRtcLoggingAgent; |
| exports.WebRtcLoggingAgentPtr = WebRtcLoggingAgentPtr; |
| exports.WebRtcLoggingAgentAssociatedPtr = WebRtcLoggingAgentAssociatedPtr; |
| })(); |