1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_WORKER_MAIN_SCRIPT_LOADER_CLIENT_H_ 6 #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_WORKER_MAIN_SCRIPT_LOADER_CLIENT_H_ 7 8 #include "third_party/blink/renderer/platform/heap/garbage_collected.h" 9 #include "third_party/blink/renderer/platform/platform_export.h" 10 11 namespace blink { 12 13 // The interface that's provided to notify the loading result of 14 // WorkerMainScriptLoader. 15 class PLATFORM_EXPORT WorkerMainScriptLoaderClient 16 : public GarbageCollectedMixin { 17 public: 18 // Called when reading a chunk, with the chunk. DidReceiveData(base::span<const char> span)19 virtual void DidReceiveData(base::span<const char> span) {} 20 21 // Called when starting to load the body. OnStartLoadingBody(const ResourceResponse & resource_response)22 virtual void OnStartLoadingBody(const ResourceResponse& resource_response) {} 23 24 // Called when the loading completes. OnFinishedLoadingWorkerMainScript()25 virtual void OnFinishedLoadingWorkerMainScript() {} 26 27 // Called when the error happens. OnFailedLoadingWorkerMainScript()28 virtual void OnFailedLoadingWorkerMainScript() {} 29 }; 30 31 } // namespace blink 32 33 #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_WORKER_MAIN_SCRIPT_LOADER_CLIENT_H_ 34