OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 typedef RequestOrUSVString RequestInfo; | 54 typedef RequestOrUSVString RequestInfo; |
55 | 55 |
56 class MODULES_EXPORT ServiceWorkerGlobalScope final : public WorkerGlobalScope { | 56 class MODULES_EXPORT ServiceWorkerGlobalScope final : public WorkerGlobalScope { |
57 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
58 public: | 58 public: |
59 static ServiceWorkerGlobalScope* create(ServiceWorkerThread*, std::unique_pt
r<WorkerThreadStartupData>); | 59 static ServiceWorkerGlobalScope* create(ServiceWorkerThread*, std::unique_pt
r<WorkerThreadStartupData>); |
60 | 60 |
61 ~ServiceWorkerGlobalScope() override; | 61 ~ServiceWorkerGlobalScope() override; |
62 bool isServiceWorkerGlobalScope() const override { return true; } | 62 bool isServiceWorkerGlobalScope() const override { return true; } |
63 | 63 |
64 void didLoadWorkerScript(size_t scriptSize, size_t cachedMetadataSize); | 64 // Counts an evaluated script and its size. Called for each of the main |
| 65 // worker script and imported scripts. |
| 66 void countScript(size_t scriptSize, size_t cachedMetadataSize); |
| 67 |
| 68 // Called when the main worker script is evaluated. |
65 void didEvaluateWorkerScript(); | 69 void didEvaluateWorkerScript(); |
66 | 70 |
67 // ServiceWorkerGlobalScope.idl | 71 // ServiceWorkerGlobalScope.idl |
68 ServiceWorkerClients* clients(); | 72 ServiceWorkerClients* clients(); |
69 ServiceWorkerRegistration* registration(); | 73 ServiceWorkerRegistration* registration(); |
70 | 74 |
71 ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, Exc
eptionState&); | 75 ScriptPromise fetch(ScriptState*, const RequestInfo&, const Dictionary&, Exc
eptionState&); |
72 | 76 |
73 ScriptPromise skipWaiting(ScriptState*); | 77 ScriptPromise skipWaiting(ScriptState*); |
74 | 78 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 size_t m_scriptCount; | 110 size_t m_scriptCount; |
107 size_t m_scriptTotalSize; | 111 size_t m_scriptTotalSize; |
108 size_t m_scriptCachedMetadataTotalSize; | 112 size_t m_scriptCachedMetadataTotalSize; |
109 }; | 113 }; |
110 | 114 |
111 DEFINE_TYPE_CASTS(ServiceWorkerGlobalScope, ExecutionContext, context, context->
isServiceWorkerGlobalScope(), context.isServiceWorkerGlobalScope()); | 115 DEFINE_TYPE_CASTS(ServiceWorkerGlobalScope, ExecutionContext, context, context->
isServiceWorkerGlobalScope(), context.isServiceWorkerGlobalScope()); |
112 | 116 |
113 } // namespace blink | 117 } // namespace blink |
114 | 118 |
115 #endif // ServiceWorkerGlobalScope_h | 119 #endif // ServiceWorkerGlobalScope_h |
OLD | NEW |