blob: 83c4dc98d5f5f6cb9b4c6c328b52e237ec08af03 [file] [log] [blame]
// content/common/dom_automation_controller.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 = 'content/common/dom_automation_controller.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('content.mojom');
function DomAutomationControllerHost_DomOperationResponse_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
DomAutomationControllerHost_DomOperationResponse_Params.prototype.initDefaults_ = function() {
this.jsonString = null;
};
DomAutomationControllerHost_DomOperationResponse_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
DomAutomationControllerHost_DomOperationResponse_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 DomAutomationControllerHost_DomOperationResponse_Params.jsonString
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
DomAutomationControllerHost_DomOperationResponse_Params.encodedSize = codec.kStructHeaderSize + 8;
DomAutomationControllerHost_DomOperationResponse_Params.decode = function(decoder) {
var packed;
var val = new DomAutomationControllerHost_DomOperationResponse_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.jsonString =
decoder.decodeStruct(codec.String);
return val;
};
DomAutomationControllerHost_DomOperationResponse_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(DomAutomationControllerHost_DomOperationResponse_Params.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.String, val.jsonString);
};
var kDomAutomationControllerHost_DomOperationResponse_Name = 0;
function DomAutomationControllerHostPtr(handleOrPtrInfo) {
this.ptr = new bindings.InterfacePtrController(DomAutomationControllerHost,
handleOrPtrInfo);
}
function DomAutomationControllerHostAssociatedPtr(associatedInterfacePtrInfo) {
this.ptr = new associatedBindings.AssociatedInterfacePtrController(
DomAutomationControllerHost, associatedInterfacePtrInfo);
}
DomAutomationControllerHostAssociatedPtr.prototype =
Object.create(DomAutomationControllerHostPtr.prototype);
DomAutomationControllerHostAssociatedPtr.prototype.constructor =
DomAutomationControllerHostAssociatedPtr;
function DomAutomationControllerHostProxy(receiver) {
this.receiver_ = receiver;
}
DomAutomationControllerHostPtr.prototype.domOperationResponse = function() {
return DomAutomationControllerHostProxy.prototype.domOperationResponse
.apply(this.ptr.getProxy(), arguments);
};
DomAutomationControllerHostProxy.prototype.domOperationResponse = function(jsonString) {
var params_ = new DomAutomationControllerHost_DomOperationResponse_Params();
params_.jsonString = jsonString;
var builder = new codec.MessageV0Builder(
kDomAutomationControllerHost_DomOperationResponse_Name,
codec.align(DomAutomationControllerHost_DomOperationResponse_Params.encodedSize));
builder.encodeStruct(DomAutomationControllerHost_DomOperationResponse_Params, params_);
var message = builder.finish();
this.receiver_.accept(message);
};
function DomAutomationControllerHostStub(delegate) {
this.delegate_ = delegate;
}
DomAutomationControllerHostStub.prototype.domOperationResponse = function(jsonString) {
return this.delegate_ && this.delegate_.domOperationResponse && this.delegate_.domOperationResponse(jsonString);
}
DomAutomationControllerHostStub.prototype.accept = function(message) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
case kDomAutomationControllerHost_DomOperationResponse_Name:
var params = reader.decodeStruct(DomAutomationControllerHost_DomOperationResponse_Params);
this.domOperationResponse(params.jsonString);
return true;
default:
return false;
}
};
DomAutomationControllerHostStub.prototype.acceptWithResponder =
function(message, responder) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
default:
return false;
}
};
function validateDomAutomationControllerHostRequest(messageValidator) {
var message = messageValidator.message;
var paramsClass = null;
switch (message.getName()) {
case kDomAutomationControllerHost_DomOperationResponse_Name:
if (!message.expectsResponse() && !message.isResponse())
paramsClass = DomAutomationControllerHost_DomOperationResponse_Params;
break;
}
if (paramsClass === null)
return validator.validationError.NONE;
return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
}
function validateDomAutomationControllerHostResponse(messageValidator) {
return validator.validationError.NONE;
}
var DomAutomationControllerHost = {
name: 'content.mojom.DomAutomationControllerHost',
kVersion: 0,
ptrClass: DomAutomationControllerHostPtr,
proxyClass: DomAutomationControllerHostProxy,
stubClass: DomAutomationControllerHostStub,
validateRequest: validateDomAutomationControllerHostRequest,
validateResponse: null,
};
DomAutomationControllerHostStub.prototype.validator = validateDomAutomationControllerHostRequest;
DomAutomationControllerHostProxy.prototype.validator = null;
exports.DomAutomationControllerHost = DomAutomationControllerHost;
exports.DomAutomationControllerHostPtr = DomAutomationControllerHostPtr;
exports.DomAutomationControllerHostAssociatedPtr = DomAutomationControllerHostAssociatedPtr;
})();