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

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

Issue 2839123003: Worklet: Introduce "pending tasks struct" concept defined in the Worklet spec (Closed)
Patch Set: address review comments Created 3 years, 7 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
60 DECLARE_TRACE(); 57 DECLARE_TRACE();
61 58
62 private: 59 private:
63 WorkletScriptLoader(ResourceFetcher*, Client*); 60 WorkletScriptLoader(ResourceFetcher*, Client*);
64 61
65 // ResourceClient 62 // ResourceClient
66 void NotifyFinished(Resource*) final; 63 void NotifyFinished(Resource*) final;
67 String DebugName() const final { return "WorkletLoader"; } 64 String DebugName() const final { return "WorkletLoader"; }
68 65
69 Member<ResourceFetcher> fetcher_; 66 Member<ResourceFetcher> fetcher_;
70 Member<Client> client_; 67 Member<Client> client_;
71 68
72 // The client of this loader can freely use this field to identify a fetch
73 // request.
74 int32_t request_id_ = -1;
75
76 bool was_script_load_successful_ = false; 69 bool was_script_load_successful_ = false;
77 bool was_script_load_complete_ = false; 70 bool was_script_load_complete_ = false;
78 }; 71 };
79 72
80 } // namespace blink 73 } // namespace blink
81 74
82 #endif // WorkletScriptLoader_h 75 #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