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

Side by Side Diff: third_party/WebKit/public/platform/WebWorkerFetchContextInfo.h

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: 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
OLDNEW
(Empty)
1 // Copyright 2017 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 WebWorkerFetchContextInfo_h
6 #define WebWorkerFetchContextInfo_h
7
8 namespace base {
9 class SingleThreadTaskRunner;
10 } // namespace base
11
12 namespace blink {
13
14 class WebWorkerFetchContext;
15
16 // WebWorkerFetchContextInfo is created in a main thread and passed to worker
kinuko 2017/04/14 02:27:02 nit: in a main thread -> on the main thread passed
horo 2017/04/14 07:22:45 Done.
17 // (dedicated, shared, service worker). It contins a information about the
kinuko 2017/04/14 02:27:02 a information -> information
horo 2017/04/14 07:22:45 Done.
18 // resource fetching context (ex: service worker provider id).
19 class WebWorkerFetchContextInfo {
20 public:
21 virtual ~WebWorkerFetchContextInfo() {}
22
23 // Creates a WebWorkerFetchContext in the worker thread which will be used
24 // when the worker thread fetches resrouces.
25 virtual std::unique_ptr<WebWorkerFetchContext> CreateContext(
26 base::SingleThreadTaskRunner*) = 0;
27
28 void SetServiceWorkerProviderID(int id) { service_worker_provider_id_ = id; }
29 void SetIsControlledByServiceWorker(bool flag) {
30 is_controlled_by_service_worker_ = flag;
31 }
32
33 int GetServiceWorkerProviderID() const { return service_worker_provider_id_; }
34 bool IsControlledByServiceWorker() const {
35 return is_controlled_by_service_worker_;
36 }
37
38 private:
39 int service_worker_provider_id_ = -1;
40 bool is_controlled_by_service_worker_ = false;
41 };
42
43 } // namespace blink
44
45 #endif // WebWorkerFetchContextInfo_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698