Move MessageHandler into a separate src/shared/message_handler.js file

The `MessageHandler` itself, and its assorted helper functions, are currently the single largest[1] piece of code in the `src/shared/util.js` file. By moving this code into its own file, `src/shared/util.js` thus becomes smaller and more manageable.
This commit is contained in:
Jonas Jenwald 2018-06-04 12:37:54 +02:00
parent 69f2a77543
commit 44d8afd46b
7 changed files with 458 additions and 434 deletions

View file

@ -16,10 +16,9 @@
import {
assert, createPromiseCapability, getVerbosityLevel, info, InvalidPDFException,
isArrayBuffer, isNum, isSameOrigin, MessageHandler, MissingPDFException,
NativeImageDecoding, PasswordException, setVerbosityLevel, shadow,
stringToBytes, UnexpectedResponseException, UnknownErrorException,
unreachable, Util, warn
isArrayBuffer, isNum, isSameOrigin, MissingPDFException, NativeImageDecoding,
PasswordException, setVerbosityLevel, shadow, stringToBytes,
UnexpectedResponseException, UnknownErrorException, unreachable, Util, warn
} from '../shared/util';
import {
DOMCanvasFactory, DOMCMapReaderFactory, DummyStatTimer, PageViewport,
@ -30,6 +29,7 @@ import { apiCompatibilityParams } from './api_compatibility';
import { CanvasGraphics } from './canvas';
import globalScope from '../shared/global_scope';
import { GlobalWorkerOptions } from './worker_options';
import { MessageHandler } from '../shared/message_handler';
import { Metadata } from './metadata';
import { PDFDataTransportStream } from './transport_stream';
import { WebGLContext } from './webgl';