forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmptyClients.cpp
More file actions
1254 lines (1000 loc) · 39.7 KB
/
EmptyClients.cpp
File metadata and controls
1254 lines (1000 loc) · 39.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (C) 2006 Eric Seidel <eric@webkit.org>
* Copyright (C) 2008-2019 Apple Inc. All rights reserved.
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "EmptyClients.h"
#include "AppHighlight.h"
#include "ApplicationCacheStorage.h"
#include "BackForwardClient.h"
#include "BroadcastChannelRegistry.h"
#include "CacheStorageProvider.h"
#include "ColorChooser.h"
#include "ContextMenuClient.h"
#include "CookieConsentDecisionResult.h"
#include "CookieJar.h"
#include "DOMPasteAccess.h"
#include "DataListSuggestionPicker.h"
#include "DatabaseProvider.h"
#include "DiagnosticLoggingClient.h"
#include "DisplayRefreshMonitorFactory.h"
#include "DocumentFragment.h"
#include "DocumentLoader.h"
#include "DragClient.h"
#include "DummyModelPlayerProvider.h"
#include "DummySpeechRecognitionProvider.h"
#include "DummyStorageProvider.h"
#include "EditorClient.h"
#include "EmptyAttachmentElementClient.h"
#include "EmptyFrameLoaderClient.h"
#include "FileChooser.h"
#include "FormState.h"
#include "Frame.h"
#include "FrameLoaderClient.h"
#include "FrameNetworkingContext.h"
#include "HTMLFormElement.h"
#include "HistoryItem.h"
#include "IDBConnectionToServer.h"
#include "InspectorClient.h"
#include "LibWebRTCAudioModule.h"
#include "LibWebRTCProvider.h"
#include "MediaRecorderPrivate.h"
#include "MediaRecorderProvider.h"
#include "ModalContainerTypes.h"
#include "NetworkStorageSession.h"
#include "Page.h"
#include "PageConfiguration.h"
#include "PaymentCoordinatorClient.h"
#include "PermissionController.h"
#include "PluginInfoProvider.h"
#include "ProgressTrackerClient.h"
#include "SecurityOriginData.h"
#include "SocketProvider.h"
#include "StorageArea.h"
#include "StorageNamespace.h"
#include "StorageNamespaceProvider.h"
#include "StorageType.h"
#include "TextCheckerClient.h"
#include "ThreadableWebSocketChannel.h"
#include "UserContentProvider.h"
#include "VisitedLinkStore.h"
#include <JavaScriptCore/HeapInlines.h>
#include <pal/SessionID.h>
#include <wtf/NeverDestroyed.h>
#if ENABLE(CONTENT_EXTENSIONS)
#include "CompiledContentExtension.h"
#endif
#if USE(QUICK_LOOK)
#include "LegacyPreviewLoaderClient.h"
#endif
#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
#include "DateTimeChooser.h"
#endif
namespace WebCore {
class UserMessageHandlerDescriptor;
class EmptyBackForwardClient final : public BackForwardClient {
void addItem(Ref<HistoryItem>&&) final { }
void goToItem(HistoryItem&) final { }
RefPtr<HistoryItem> itemAtIndex(int) final { return nullptr; }
unsigned backListCount() const final { return 0; }
unsigned forwardListCount() const final { return 0; }
bool containsItem(const HistoryItem&) const final { return false; }
void close() final { }
};
#if ENABLE(CONTEXT_MENUS)
class EmptyContextMenuClient final : public ContextMenuClient {
void contextMenuDestroyed() final { }
void downloadURL(const URL&) final { }
void searchWithGoogle(const Frame*) final { }
void lookUpInDictionary(Frame*) final { }
bool isSpeaking() final { return false; }
void speak(const String&) final { }
void stopSpeaking() final { }
#if PLATFORM(COCOA)
void searchWithSpotlight() final { }
#endif
#if HAVE(TRANSLATION_UI_SERVICES)
void handleTranslation(const TranslationContextMenuInfo&) final { }
#endif
#if PLATFORM(GTK)
void insertEmoji(Frame&) final { }
#endif
#if USE(ACCESSIBILITY_CONTEXT_MENUS)
void showContextMenu() final { }
#endif
#if ENABLE(IMAGE_ANALYSIS)
bool supportsLookUpInImages() final { return false; }
#endif
#if ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)
bool supportsCopySubject() final { return false; }
#endif
};
#endif // ENABLE(CONTEXT_MENUS)
class EmptyDisplayRefreshMonitor final : public DisplayRefreshMonitor {
public:
static Ref<EmptyDisplayRefreshMonitor> create(PlatformDisplayID displayID)
{
return adoptRef(*new EmptyDisplayRefreshMonitor(displayID));
}
void displayLinkFired(const DisplayUpdate&) final { }
bool requestRefreshCallback() final { return false; }
void stop() final { }
bool startNotificationMechanism() final { return true; }
void stopNotificationMechanism() final { }
private:
explicit EmptyDisplayRefreshMonitor(PlatformDisplayID displayID)
: DisplayRefreshMonitor(displayID)
{
}
};
class EmptyDisplayRefreshMonitorFactory final : public DisplayRefreshMonitorFactory {
public:
static DisplayRefreshMonitorFactory* sharedEmptyDisplayRefreshMonitorFactory()
{
static NeverDestroyed<EmptyDisplayRefreshMonitorFactory> emptyFactory;
return &emptyFactory.get();
}
private:
RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID displayID) final
{
return EmptyDisplayRefreshMonitor::create(displayID);
}
};
class EmptyDatabaseProvider final : public DatabaseProvider {
struct EmptyIDBConnectionToServerDeletegate final : public IDBClient::IDBConnectionToServerDelegate {
IDBConnectionIdentifier identifier() const final { return { }; }
void deleteDatabase(const IDBRequestData&) final { }
void openDatabase(const IDBRequestData&) final { }
void abortTransaction(const IDBResourceIdentifier&) final { }
void commitTransaction(const IDBResourceIdentifier&, uint64_t) final { }
void didFinishHandlingVersionChangeTransaction(uint64_t, const IDBResourceIdentifier&) final { }
void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) final { }
void deleteObjectStore(const IDBRequestData&, const String&) final { }
void renameObjectStore(const IDBRequestData&, uint64_t, const String&) final { }
void clearObjectStore(const IDBRequestData&, uint64_t) final { }
void createIndex(const IDBRequestData&, const IDBIndexInfo&) final { }
void deleteIndex(const IDBRequestData&, uint64_t, const String&) final { }
void renameIndex(const IDBRequestData&, uint64_t, uint64_t, const String&) final { }
void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode) final { }
void getRecord(const IDBRequestData&, const IDBGetRecordData&) final { }
void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&) final { }
void getCount(const IDBRequestData&, const IDBKeyRangeData&) final { }
void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&) final { }
void openCursor(const IDBRequestData&, const IDBCursorInfo&) final { }
void iterateCursor(const IDBRequestData&, const IDBIterateCursorData&) final { }
void establishTransaction(uint64_t, const IDBTransactionInfo&) final { }
void databaseConnectionPendingClose(uint64_t) final { }
void databaseConnectionClosed(uint64_t) final { }
void abortOpenAndUpgradeNeeded(uint64_t, const IDBResourceIdentifier&) final { }
void didFireVersionChangeEvent(uint64_t, const IDBResourceIdentifier&, const IndexedDB::ConnectionClosedOnBehalfOfServer) final { }
void openDBRequestCancelled(const IDBRequestData&) final { }
void getAllDatabaseNamesAndVersions(const IDBResourceIdentifier&, const ClientOrigin&) final { }
~EmptyIDBConnectionToServerDeletegate() { }
};
IDBClient::IDBConnectionToServer& idbConnectionToServerForSession(PAL::SessionID) final
{
static NeverDestroyed<EmptyIDBConnectionToServerDeletegate> emptyDelegate;
static auto& emptyConnection = IDBClient::IDBConnectionToServer::create(emptyDelegate.get()).leakRef();
return emptyConnection;
}
};
class EmptyDiagnosticLoggingClient final : public DiagnosticLoggingClient {
void logDiagnosticMessage(const String&, const String&, ShouldSample) final { }
void logDiagnosticMessageWithResult(const String&, const String&, DiagnosticLoggingResultType, ShouldSample) final { }
void logDiagnosticMessageWithValue(const String&, const String&, double, unsigned, ShouldSample) final { }
void logDiagnosticMessageWithEnhancedPrivacy(const String&, const String&, ShouldSample) final { }
void logDiagnosticMessageWithValueDictionary(const String&, const String&, const ValueDictionary&, ShouldSample) final { }
void logDiagnosticMessageWithDomain(const String&, DiagnosticLoggingDomain) final { };
};
#if ENABLE(DRAG_SUPPORT)
class EmptyDragClient final : public DragClient {
void willPerformDragDestinationAction(DragDestinationAction, const DragData&) final { }
void willPerformDragSourceAction(DragSourceAction, const IntPoint&, DataTransfer&) final { }
OptionSet<DragSourceAction> dragSourceActionMaskForPoint(const IntPoint&) final { return { }; }
void startDrag(DragItem, DataTransfer&, Frame&) final { }
};
#endif // ENABLE(DRAG_SUPPORT)
class EmptyEditorClient final : public EditorClient {
WTF_MAKE_FAST_ALLOCATED;
public:
EmptyEditorClient() = default;
private:
bool shouldDeleteRange(const std::optional<SimpleRange>&) final { return false; }
bool smartInsertDeleteEnabled() final { return false; }
bool isSelectTrailingWhitespaceEnabled() const final { return false; }
bool isContinuousSpellCheckingEnabled() final { return false; }
void toggleContinuousSpellChecking() final { }
bool isGrammarCheckingEnabled() final { return false; }
void toggleGrammarChecking() final { }
int spellCheckerDocumentTag() final { return -1; }
bool shouldBeginEditing(const SimpleRange&) final { return false; }
bool shouldEndEditing(const SimpleRange&) final { return false; }
bool shouldInsertNode(Node&, const std::optional<SimpleRange>&, EditorInsertAction) final { return false; }
bool shouldInsertText(const String&, const std::optional<SimpleRange>&, EditorInsertAction) final { return false; }
bool shouldChangeSelectedRange(const std::optional<SimpleRange>&, const std::optional<SimpleRange>&, Affinity, bool) final { return false; }
bool shouldApplyStyle(const StyleProperties&, const std::optional<SimpleRange>&) final { return false; }
void didApplyStyle() final { }
bool shouldMoveRangeAfterDelete(const SimpleRange&, const SimpleRange&) final { return false; }
void didBeginEditing() final { }
void respondToChangedContents() final { }
void respondToChangedSelection(Frame*) final { }
void updateEditorStateAfterLayoutIfEditabilityChanged() final { }
void discardedComposition(Frame*) final { }
void canceledComposition() final { }
void didUpdateComposition() final { }
void didEndEditing() final { }
void didEndUserTriggeredSelectionChanges() final { }
void willWriteSelectionToPasteboard(const std::optional<SimpleRange>&) final { }
void didWriteSelectionToPasteboard() final { }
void getClientPasteboardData(const std::optional<SimpleRange>&, Vector<String>&, Vector<RefPtr<SharedBuffer>>&) final { }
void requestCandidatesForSelection(const VisibleSelection&) final { }
void handleAcceptedCandidateWithSoftSpaces(TextCheckingResult) final { }
void registerUndoStep(UndoStep&) final;
void registerRedoStep(UndoStep&) final;
void clearUndoRedoOperations() final { }
DOMPasteAccessResponse requestDOMPasteAccess(DOMPasteAccessCategory, const String&) final { return DOMPasteAccessResponse::DeniedForGesture; }
bool canCopyCut(Frame*, bool defaultValue) const final { return defaultValue; }
bool canPaste(Frame*, bool defaultValue) const final { return defaultValue; }
bool canUndo() const final { return false; }
bool canRedo() const final { return false; }
void undo() final { }
void redo() final { }
void handleKeyboardEvent(KeyboardEvent&) final { }
void handleInputMethodKeydown(KeyboardEvent&) final { }
void textFieldDidBeginEditing(Element&) final { }
void textFieldDidEndEditing(Element&) final { }
void textDidChangeInTextField(Element&) final { }
bool doTextFieldCommandFromEvent(Element&, KeyboardEvent*) final { return false; }
void textWillBeDeletedInTextField(Element&) final { }
void textDidChangeInTextArea(Element&) final { }
void overflowScrollPositionChanged() final { }
void subFrameScrollPositionChanged() final { }
#if PLATFORM(IOS_FAMILY)
void startDelayingAndCoalescingContentChangeNotifications() final { }
void stopDelayingAndCoalescingContentChangeNotifications() final { }
bool hasRichlyEditableSelection() final { return false; }
int getPasteboardItemsCount() final { return 0; }
RefPtr<DocumentFragment> documentFragmentFromDelegate(int) final { return nullptr; }
bool performsTwoStepPaste(DocumentFragment*) final { return false; }
void updateStringForFind(const String&) final { }
#endif
bool performTwoStepDrop(DocumentFragment&, const SimpleRange&, bool) final { return false; }
#if PLATFORM(COCOA)
void setInsertionPasteboard(const String&) final { };
#endif
#if USE(APPKIT)
void uppercaseWord() final { }
void lowercaseWord() final { }
void capitalizeWord() final { }
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
void showSubstitutionsPanel(bool) final { }
bool substitutionsPanelIsShowing() final { return false; }
void toggleSmartInsertDelete() final { }
bool isAutomaticQuoteSubstitutionEnabled() final { return false; }
void toggleAutomaticQuoteSubstitution() final { }
bool isAutomaticLinkDetectionEnabled() final { return false; }
void toggleAutomaticLinkDetection() final { }
bool isAutomaticDashSubstitutionEnabled() final { return false; }
void toggleAutomaticDashSubstitution() final { }
bool isAutomaticTextReplacementEnabled() final { return false; }
void toggleAutomaticTextReplacement() final { }
bool isAutomaticSpellingCorrectionEnabled() final { return false; }
void toggleAutomaticSpellingCorrection() final { }
#endif
#if PLATFORM(GTK)
bool shouldShowUnicodeMenu() final { return false; }
#endif
TextCheckerClient* textChecker() final { return &m_textCheckerClient; }
void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) final { }
void updateSpellingUIWithMisspelledWord(const String&) final { }
void showSpellingUI(bool) final { }
bool spellingUIIsShowing() final { return false; }
void willSetInputMethodState() final { }
void setInputMethodState(Element*) final { }
class EmptyTextCheckerClient final : public TextCheckerClient {
bool shouldEraseMarkersAfterChangeSelection(TextCheckingType) const final { return true; }
void ignoreWordInSpellDocument(const String&) final { }
void learnWord(const String&) final { }
void checkSpellingOfString(StringView, int*, int*) final { }
void checkGrammarOfString(StringView, Vector<GrammarDetail>&, int*, int*) final { }
#if USE(UNIFIED_TEXT_CHECKING)
Vector<TextCheckingResult> checkTextOfParagraph(StringView, OptionSet<TextCheckingType>, const VisibleSelection&) final { return Vector<TextCheckingResult>(); }
#endif
void getGuessesForWord(const String&, const String&, const VisibleSelection&, Vector<String>&) final { }
void requestCheckingOfString(TextCheckingRequest&, const VisibleSelection&) final;
};
EmptyTextCheckerClient m_textCheckerClient;
};
class EmptyFrameNetworkingContext final : public FrameNetworkingContext {
public:
static Ref<EmptyFrameNetworkingContext> create() { return adoptRef(*new EmptyFrameNetworkingContext); }
private:
EmptyFrameNetworkingContext();
bool shouldClearReferrerOnHTTPSToHTTPRedirect() const { return true; }
NetworkStorageSession* storageSession() const final { return nullptr; }
#if PLATFORM(COCOA)
bool localFileContentSniffingEnabled() const { return false; }
SchedulePairHashSet* scheduledRunLoopPairs() const { return nullptr; }
RetainPtr<CFDataRef> sourceApplicationAuditData() const { return nullptr; };
#endif
#if PLATFORM(COCOA) || PLATFORM(WIN)
ResourceError blockedError(const ResourceRequest&) const final { return { }; }
#endif
};
class EmptyInspectorClient final : public InspectorClient {
void inspectedPageDestroyed() final { }
Inspector::FrontendChannel* openLocalFrontend(InspectorController*) final { return nullptr; }
void bringFrontendToFront() final { }
void highlight() final { }
void hideHighlight() final { }
};
#if ENABLE(APPLE_PAY)
class EmptyPaymentCoordinatorClient final : public PaymentCoordinatorClient {
std::optional<String> validatedPaymentNetwork(const String&) final { return std::nullopt; }
bool canMakePayments() final { return false; }
void canMakePaymentsWithActiveCard(const String&, const String&, CompletionHandler<void(bool)>&& completionHandler) final { callOnMainThread([completionHandler = WTFMove(completionHandler)]() mutable { completionHandler(false); }); }
void openPaymentSetup(const String&, const String&, CompletionHandler<void(bool)>&& completionHandler) final { callOnMainThread([completionHandler = WTFMove(completionHandler)]() mutable { completionHandler(false); }); }
bool showPaymentUI(const URL&, const Vector<URL>&, const ApplePaySessionPaymentRequest&) final { return false; }
void completeMerchantValidation(const PaymentMerchantSession&) final { }
void completeShippingMethodSelection(std::optional<ApplePayShippingMethodUpdate>&&) final { }
void completeShippingContactSelection(std::optional<ApplePayShippingContactUpdate>&&) final { }
void completePaymentMethodSelection(std::optional<ApplePayPaymentMethodUpdate>&&) final { }
#if ENABLE(APPLE_PAY_COUPON_CODE)
void completeCouponCodeChange(std::optional<ApplePayCouponCodeUpdate>&&) final { }
#endif
void completePaymentSession(ApplePayPaymentAuthorizationResult&&) final { }
void cancelPaymentSession() final { }
void abortPaymentSession() final { }
void paymentCoordinatorDestroyed() final { }
};
#endif
class EmptyPluginInfoProvider final : public PluginInfoProvider {
void refreshPlugins() final { };
Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginIdentifier>>&) final { return { }; }
Vector<PluginInfo> webVisiblePluginInfo(Page&, const URL&) final { return { }; }
};
class EmptyPopupMenu : public PopupMenu {
public:
EmptyPopupMenu() = default;
private:
void show(const IntRect&, FrameView*, int) final { }
void hide() final { }
void updateFromElement() final { }
void disconnectClient() final { }
};
class EmptyProgressTrackerClient final : public ProgressTrackerClient {
void willChangeEstimatedProgress() final { }
void didChangeEstimatedProgress() final { }
void progressStarted(Frame&) final { }
void progressEstimateChanged(Frame&) final { }
void progressFinished(Frame&) final { }
};
class EmptySearchPopupMenu : public SearchPopupMenu {
public:
EmptySearchPopupMenu()
: m_popup(adoptRef(*new EmptyPopupMenu))
{
}
private:
PopupMenu* popupMenu() final { return m_popup.ptr(); }
void saveRecentSearches(const AtomString&, const Vector<RecentSearch>&) final { }
void loadRecentSearches(const AtomString&, Vector<RecentSearch>&) final { }
bool enabled() final { return false; }
Ref<EmptyPopupMenu> m_popup;
};
class EmptyStorageNamespaceProvider final : public StorageNamespaceProvider {
struct EmptyStorageArea : public StorageArea {
unsigned length() final { return 0; }
String key(unsigned) final { return { }; }
String item(const String&) final { return { }; }
void setItem(Frame&, const String&, const String&, bool&) final { }
void removeItem(Frame&, const String&) final { }
void clear(Frame&) final { }
bool contains(const String&) final { return false; }
StorageType storageType() const final { return StorageType::Local; }
size_t memoryBytesUsedByCache() final { return 0; }
};
struct EmptyStorageNamespace final : public StorageNamespace {
explicit EmptyStorageNamespace(PAL::SessionID sessionID)
: m_sessionID(sessionID)
{
}
private:
Ref<StorageArea> storageArea(const SecurityOrigin&) final { return adoptRef(*new EmptyStorageArea); }
Ref<StorageNamespace> copy(Page&) final { return adoptRef(*new EmptyStorageNamespace { m_sessionID }); }
PAL::SessionID sessionID() const final { return m_sessionID; }
void setSessionIDForTesting(PAL::SessionID sessionID) final { m_sessionID = sessionID; };
PAL::SessionID m_sessionID;
};
Ref<StorageNamespace> createSessionStorageNamespace(Page&, unsigned) final;
Ref<StorageNamespace> createLocalStorageNamespace(unsigned, PAL::SessionID) final;
Ref<StorageNamespace> createTransientLocalStorageNamespace(SecurityOrigin&, unsigned, PAL::SessionID) final;
};
class EmptyUserContentProvider final : public UserContentProvider {
void forEachUserScript(Function<void(DOMWrapperWorld&, const UserScript&)>&&) const final { }
void forEachUserStyleSheet(Function<void(const UserStyleSheet&)>&&) const final { }
#if ENABLE(USER_MESSAGE_HANDLERS)
void forEachUserMessageHandler(Function<void(const UserMessageHandlerDescriptor&)>&&) const final { }
#endif
#if ENABLE(CONTENT_EXTENSIONS)
ContentExtensions::ContentExtensionsBackend& userContentExtensionBackend() final { static NeverDestroyed<ContentExtensions::ContentExtensionsBackend> backend; return backend.get(); };
#endif
};
class EmptyVisitedLinkStore final : public VisitedLinkStore {
bool isLinkVisited(Page&, SharedStringHash, const URL&, const AtomString&) final { return false; }
void addVisitedLink(Page&, SharedStringHash) final { }
};
RefPtr<PopupMenu> EmptyChromeClient::createPopupMenu(PopupMenuClient&) const
{
return adoptRef(*new EmptyPopupMenu);
}
RefPtr<SearchPopupMenu> EmptyChromeClient::createSearchPopupMenu(PopupMenuClient&) const
{
return adoptRef(*new EmptySearchPopupMenu);
}
#if ENABLE(INPUT_TYPE_COLOR)
std::unique_ptr<ColorChooser> EmptyChromeClient::createColorChooser(ColorChooserClient&, const Color&)
{
return nullptr;
}
#endif
#if ENABLE(DATALIST_ELEMENT)
std::unique_ptr<DataListSuggestionPicker> EmptyChromeClient::createDataListSuggestionPicker(DataListSuggestionsClient&)
{
return nullptr;
}
#endif
#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
std::unique_ptr<DateTimeChooser> EmptyChromeClient::createDateTimeChooser(DateTimeChooserClient&)
{
return nullptr;
}
#endif
#if ENABLE(APP_HIGHLIGHTS)
void EmptyChromeClient::storeAppHighlight(AppHighlight&&) const
{
}
#endif
void EmptyChromeClient::setTextIndicator(const TextIndicatorData&) const
{
}
DisplayRefreshMonitorFactory* EmptyChromeClient::displayRefreshMonitorFactory() const
{
return EmptyDisplayRefreshMonitorFactory::sharedEmptyDisplayRefreshMonitorFactory();
}
void EmptyChromeClient::runOpenPanel(Frame&, FileChooser&)
{
}
void EmptyChromeClient::showShareSheet(ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&)
{
}
void EmptyChromeClient::requestCookieConsent(CompletionHandler<void(CookieConsentDecisionResult)>&& completion)
{
completion(CookieConsentDecisionResult::NotSupported);
}
void EmptyChromeClient::classifyModalContainerControls(Vector<String>&&, CompletionHandler<void(Vector<ModalContainerControlType>&&)>&& completion)
{
completion({ });
}
void EmptyChromeClient::decidePolicyForModalContainer(OptionSet<ModalContainerControlType>, CompletionHandler<void(ModalContainerDecision)>&& completion)
{
completion(ModalContainerDecision::Show);
}
void EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(const NavigationAction&, const ResourceRequest&, FormState*, const String&, PolicyCheckIdentifier, FramePolicyFunction&&)
{
}
void EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const NavigationAction&, const ResourceRequest&, const ResourceResponse&, FormState*, PolicyDecisionMode, PolicyCheckIdentifier, FramePolicyFunction&&)
{
}
void EmptyFrameLoaderClient::dispatchWillSendSubmitEvent(Ref<FormState>&&)
{
}
void EmptyFrameLoaderClient::dispatchWillSubmitForm(FormState&, CompletionHandler<void()>&& completionHandler)
{
completionHandler();
}
Ref<DocumentLoader> EmptyFrameLoaderClient::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
{
return DocumentLoader::create(request, substituteData);
}
RefPtr<Frame> EmptyFrameLoaderClient::createFrame(const AtomString&, HTMLFrameOwnerElement&)
{
return nullptr;
}
RefPtr<Widget> EmptyFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement&, const URL&, const Vector<AtomString>&, const Vector<AtomString>&, const String&, bool)
{
return nullptr;
}
std::optional<FrameIdentifier> EmptyFrameLoaderClient::frameID() const
{
return std::nullopt;
}
std::optional<PageIdentifier> EmptyFrameLoaderClient::pageID() const
{
return std::nullopt;
}
bool EmptyFrameLoaderClient::hasWebView() const
{
return true; // mainly for assertions
}
void EmptyFrameLoaderClient::makeRepresentation(DocumentLoader*)
{
}
#if PLATFORM(IOS_FAMILY)
bool EmptyFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache()
{
return false;
}
#endif
void EmptyFrameLoaderClient::forceLayoutForNonHTML()
{
}
void EmptyFrameLoaderClient::setCopiesOnScroll()
{
}
void EmptyFrameLoaderClient::detachedFromParent2()
{
}
void EmptyFrameLoaderClient::detachedFromParent3()
{
}
void EmptyFrameLoaderClient::convertMainResourceLoadToDownload(DocumentLoader*, const ResourceRequest&, const ResourceResponse&)
{
}
void EmptyFrameLoaderClient::assignIdentifierToInitialRequest(ResourceLoaderIdentifier, DocumentLoader*, const ResourceRequest&)
{
}
bool EmptyFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader*, ResourceLoaderIdentifier)
{
return false;
}
void EmptyFrameLoaderClient::dispatchWillSendRequest(DocumentLoader*, ResourceLoaderIdentifier, ResourceRequest&, const ResourceResponse&)
{
}
void EmptyFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, ResourceLoaderIdentifier, const AuthenticationChallenge&)
{
}
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
bool EmptyFrameLoaderClient::canAuthenticateAgainstProtectionSpace(DocumentLoader*, ResourceLoaderIdentifier, const ProtectionSpace&)
{
return false;
}
#endif
#if PLATFORM(IOS_FAMILY)
RetainPtr<CFDictionaryRef> EmptyFrameLoaderClient::connectionProperties(DocumentLoader*, ResourceLoaderIdentifier)
{
return nullptr;
}
#endif
void EmptyFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader*, ResourceLoaderIdentifier, const ResourceResponse&)
{
}
void EmptyFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader*, ResourceLoaderIdentifier, int)
{
}
void EmptyFrameLoaderClient::dispatchDidFinishLoading(DocumentLoader*, ResourceLoaderIdentifier)
{
}
#if ENABLE(DATA_DETECTION)
void EmptyFrameLoaderClient::dispatchDidFinishDataDetection(NSArray *)
{
}
#endif
void EmptyFrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, ResourceLoaderIdentifier, const ResourceError&)
{
}
bool EmptyFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int)
{
return false;
}
void EmptyFrameLoaderClient::dispatchDidDispatchOnloadEvents()
{
}
void EmptyFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
{
}
void EmptyFrameLoaderClient::dispatchDidCancelClientRedirect()
{
}
void EmptyFrameLoaderClient::dispatchWillPerformClientRedirect(const URL&, double, WallTime, LockBackForwardList)
{
}
void EmptyFrameLoaderClient::dispatchDidChangeLocationWithinPage()
{
}
void EmptyFrameLoaderClient::dispatchDidPushStateWithinPage()
{
}
void EmptyFrameLoaderClient::dispatchDidReplaceStateWithinPage()
{
}
void EmptyFrameLoaderClient::dispatchDidPopStateWithinPage()
{
}
void EmptyFrameLoaderClient::dispatchWillClose()
{
}
void EmptyFrameLoaderClient::dispatchDidStartProvisionalLoad()
{
}
void EmptyFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection&)
{
}
void EmptyFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent>, std::optional<UsedLegacyTLS>)
{
}
void EmptyFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError&, WillContinueLoading)
{
}
void EmptyFrameLoaderClient::dispatchDidFailLoad(const ResourceError&)
{
}
void EmptyFrameLoaderClient::dispatchDidFinishDocumentLoad()
{
}
void EmptyFrameLoaderClient::dispatchDidFinishLoad()
{
}
void EmptyFrameLoaderClient::dispatchDidReachLayoutMilestone(OptionSet<LayoutMilestone>)
{
}
void EmptyFrameLoaderClient::dispatchDidReachVisuallyNonEmptyState()
{
}
Frame* EmptyFrameLoaderClient::dispatchCreatePage(const NavigationAction&, NewFrameOpenerPolicy)
{
return nullptr;
}
void EmptyFrameLoaderClient::dispatchShow()
{
}
void EmptyFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceResponse&, const ResourceRequest&, PolicyCheckIdentifier, const String&, FramePolicyFunction&&)
{
}
void EmptyFrameLoaderClient::cancelPolicyCheck()
{
}
void EmptyFrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&)
{
}
void EmptyFrameLoaderClient::revertToProvisionalState(DocumentLoader*)
{
}
void EmptyFrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError&)
{
}
void EmptyFrameLoaderClient::setMainFrameDocumentReady(bool)
{
}
void EmptyFrameLoaderClient::startDownload(const ResourceRequest&, const String&)
{
}
void EmptyFrameLoaderClient::willChangeTitle(DocumentLoader*)
{
}
void EmptyFrameLoaderClient::didChangeTitle(DocumentLoader*)
{
}
void EmptyFrameLoaderClient::willReplaceMultipartContent()
{
}
void EmptyFrameLoaderClient::didReplaceMultipartContent()
{
}
void EmptyFrameLoaderClient::committedLoad(DocumentLoader*, const SharedBuffer&)
{
}
void EmptyFrameLoaderClient::finishedLoading(DocumentLoader*)
{
}
ResourceError EmptyFrameLoaderClient::cancelledError(const ResourceRequest&) const
{
return { ResourceError::Type::Cancellation };
}
ResourceError EmptyFrameLoaderClient::blockedError(const ResourceRequest&) const
{
return { };
}
ResourceError EmptyFrameLoaderClient::blockedByContentBlockerError(const ResourceRequest&) const
{
return { };
}
ResourceError EmptyFrameLoaderClient::cannotShowURLError(const ResourceRequest&) const
{
return { };
}
ResourceError EmptyFrameLoaderClient::interruptedForPolicyChangeError(const ResourceRequest&) const
{
return { };
}
#if ENABLE(CONTENT_FILTERING)
ResourceError EmptyFrameLoaderClient::blockedByContentFilterError(const ResourceRequest&) const
{
return { };
}
#endif
ResourceError EmptyFrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse&) const
{
return { };
}
ResourceError EmptyFrameLoaderClient::fileDoesNotExistError(const ResourceResponse&) const
{
return { };
}
ResourceError EmptyFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse&) const
{
return { };
}
bool EmptyFrameLoaderClient::shouldFallBack(const ResourceError&) const
{
return false;
}
bool EmptyFrameLoaderClient::canHandleRequest(const ResourceRequest&) const
{
return false;
}
bool EmptyFrameLoaderClient::canShowMIMEType(const String&) const
{
return false;
}
bool EmptyFrameLoaderClient::canShowMIMETypeAsHTML(const String&) const
{
return false;
}
bool EmptyFrameLoaderClient::representationExistsForURLScheme(StringView) const
{
return false;
}
String EmptyFrameLoaderClient::generatedMIMETypeForURLScheme(StringView) const
{
return emptyString();
}
void EmptyFrameLoaderClient::frameLoadCompleted()
{
}
void EmptyFrameLoaderClient::restoreViewState()
{
}
void EmptyFrameLoaderClient::provisionalLoadStarted()
{
}
void EmptyFrameLoaderClient::didFinishLoad()
{
}
void EmptyFrameLoaderClient::prepareForDataSourceReplacement()
{
}
void EmptyFrameLoaderClient::updateCachedDocumentLoader(DocumentLoader&)
{
}
void EmptyFrameLoaderClient::setTitle(const StringWithDirection&, const URL&)
{
}
String EmptyFrameLoaderClient::userAgent(const URL&) const
{
return emptyString();
}
void EmptyFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*)
{
}
void EmptyFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*)
{
}