refactor: create IPC_MESSAGES enum for IPC message channels (#25694)

This commit is contained in:
Milan Burda 2020-10-13 23:11:06 +02:00 committed by GitHub
parent 8dfb1cf78f
commit 2c68bad631
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 225 additions and 126 deletions

View file

@ -1,6 +1,7 @@
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
import { WebViewImpl } from '@electron/internal/renderer/web-view/web-view-impl';
import { WEB_VIEW_CONSTANTS } from '@electron/internal/renderer/web-view/web-view-constants';
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
// Helper function to resolve url set in attribute.
const a = document.createElement('a');
@ -196,7 +197,7 @@ class SrcAttribute extends WebViewAttribute {
const method = 'loadURL';
const args = [this.getValue(), opts];
ipcRendererInternal.invoke('ELECTRON_GUEST_VIEW_MANAGER_CALL', guestInstanceId, method, args);
ipcRendererInternal.invoke(IPC_MESSAGES.GUEST_VIEW_MANAGER_CALL, guestInstanceId, method, args);
}
}