OLD | NEW |
---|---|
(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 on the main thread and passed to a | |
17 // worker (dedicated, shared, service worker). It contins information about the | |
kinuko
2017/04/14 14:00:27
contins -> contains
horo
2017/04/17 15:12:04
Done.
| |
18 // resource fetching context (ex: service worker provider id). | |
19 class WebWorkerFetchContextInfo { | |
kinuko
2017/04/14 14:00:26
I wonder if it's possible to only expose WebWorker
horo
2017/04/17 15:12:04
Done.
| |
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 | |
OLD | NEW |