// Token: 0x06001CBA RID: 7354 RVA: 0x000A541C File Offset: 0x000A361C
        private bool OnExecuteRequestDelegate(IComWorker <ITranscoder> worker, object requestParameters)
        {
            TranscodingParameters transcodingParameters = (TranscodingParameters)requestParameters;
            ITranscoder           transcoder            = null;

            try
            {
                transcoder = worker.Worker;
            }
            catch (ObjectDisposedException innerException)
            {
                throw new TranscodingFatalFaultException("Worker object has been disposed", innerException);
            }
            this.UpdatePerformanceCounterAfterLeftQueue(transcodingParameters);
            this.UpdatePerformanceCounterBeforeConversion(transcodingParameters);
            int totalPageNumber = 0;
            int num             = 0;
            TranscodeErrorCode?transcodeErrorCode = null;
            string             text  = null;
            string             text2 = null;
            bool result;

            try
            {
                try
                {
                    ExTraceGlobals.TranscodingTracer.TraceDebug <string>((long)this.GetHashCode(), "Start to cache input document {0}", transcodingParameters.DocumentId);
                    this.cache.CacheInputDocument(transcodingParameters.SessionId, transcodingParameters.DocumentId, transcodingParameters.SourceStream, out text, out text2);
                    using (FileStream fileStream = File.Open(text, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                    {
                        transcodingParameters.SourceDocSize = (int)fileStream.Length;
                    }
                    ExTraceGlobals.TranscodingTracer.TraceDebug <string>((long)this.GetHashCode(), "Start to transcode {0}", transcodingParameters.DocumentId);
                    transcodeErrorCode = new TranscodeErrorCode?(transcoder.Convert(text, text2, transcodingParameters.SourceDocType, transcodingParameters.CurrentPageNumber, out totalPageNumber, out num));
                    ExTraceGlobals.TranscodingTracer.TraceDebug <string, TranscodeErrorCode?>((long)this.GetHashCode(), "Document {0} transcoding finished with return code {1}", transcodingParameters.DocumentId, transcodeErrorCode);
                    transcodingParameters.TotalPageNumber = totalPageNumber;
                }
                finally
                {
                    this.UpdatePerformanceCounterAfterConversion(transcodingParameters);
                    transcodingParameters.ErrorCode = transcodeErrorCode;
                    if (transcodeErrorCode == TranscodeErrorCode.Succeeded)
                    {
                        OwaSingleCounters.TotalConvertingResponseRate.IncrementBy((long)(num / 1024));
                    }
                    string rewrittenHtmlFileName = null;
                    if (!string.IsNullOrEmpty(text2))
                    {
                        this.cache.NotifyTranscodingFinish(transcodingParameters.SessionId, transcodingParameters.DocumentId, Path.GetFileName(text2), out rewrittenHtmlFileName, transcodeErrorCode == TranscodeErrorCode.Succeeded);
                        transcodingParameters.RewrittenHtmlFileName = rewrittenHtmlFileName;
                    }
                }
                if (transcodeErrorCode == TranscodeErrorCode.Succeeded || transcodeErrorCode == TranscodeErrorCode.WrongFileTypeError || transcodeErrorCode == TranscodeErrorCode.InvalidPageNumberError)
                {
                    result = true;
                }
                else
                {
                    this.blockList.AddNew(transcodingParameters.DocumentId);
                    result = false;
                }
            }
            catch (IOException ex)
            {
                ExTraceGlobals.TranscodingTracer.TraceDebug <string, string>((long)this.GetHashCode(), "Document {0} can not be transcoded because of an IO error. Exception message: {1}", transcodingParameters.DocumentId, ex.Message);
                throw new TranscodingUnconvertibleFileException(string.Format("Document {0} can not be transcoded because of an IO error.", transcodingParameters.DocumentId), ex, this);
            }
            return(result);
        }