Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Source/core/loader/WorkletScriptLoader.h

Issue 2830603003: Worklet: Move WorkletScriptLoader from MainThreadWorklet to MainThreadWorkletGlobalScope (Closed)
Patch Set: const auto& Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WorkletScriptLoader_h 5 #ifndef WorkletScriptLoader_h
6 #define WorkletScriptLoader_h 6 #define WorkletScriptLoader_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/loader/resource/ScriptResource.h" 9 #include "core/loader/resource/ScriptResource.h"
10 #include "platform/loader/fetch/ResourceClient.h" 10 #include "platform/loader/fetch/ResourceClient.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void FetchScript(const String& script_url); 47 void FetchScript(const String& script_url);
48 48
49 // Cancels resource loading and synchronously calls 49 // Cancels resource loading and synchronously calls
50 // Client::notifyWorkletScriptLoadingFinished(). 50 // Client::notifyWorkletScriptLoadingFinished().
51 void Cancel(); 51 void Cancel();
52 52
53 // Returns true if a script was successfully loaded. This should be called 53 // Returns true if a script was successfully loaded. This should be called
54 // after Client::notifyWorkletScriptLoadingFinished() is called. 54 // after Client::notifyWorkletScriptLoadingFinished() is called.
55 bool WasScriptLoadSuccessful() const; 55 bool WasScriptLoadSuccessful() const;
56 56
57 void set_request_id(int32_t request_id) { request_id_ = request_id; }
58 int32_t request_id() const { return request_id_; }
59
57 DECLARE_TRACE(); 60 DECLARE_TRACE();
58 61
59 private: 62 private:
60 WorkletScriptLoader(ResourceFetcher*, Client*); 63 WorkletScriptLoader(ResourceFetcher*, Client*);
61 64
62 // ResourceClient 65 // ResourceClient
63 void NotifyFinished(Resource*) final; 66 void NotifyFinished(Resource*) final;
64 String DebugName() const final { return "WorkletLoader"; } 67 String DebugName() const final { return "WorkletLoader"; }
65 68
66 Member<ResourceFetcher> fetcher_; 69 Member<ResourceFetcher> fetcher_;
67 Member<Client> client_; 70 Member<Client> client_;
68 71
72 // The client of this loader can freely use this field to identify a fetch
73 // request.
74 int32_t request_id_ = -1;
75
69 bool was_script_load_successful_ = false; 76 bool was_script_load_successful_ = false;
70 bool was_script_load_complete_ = false; 77 bool was_script_load_complete_ = false;
71 }; 78 };
72 79
73 } // namespace blink 80 } // namespace blink
74 81
75 #endif // WorkletScriptLoader_h 82 #endif // WorkletScriptLoader_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698