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

Issue 929953002: CachedMetadata support for ServiceWorker script. (Closed)

Created:
5 years, 10 months ago by horo
Modified:
5 years, 10 months ago
CC:
vivekg, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, dglazkov+blink, falken, gavinp+loader_chromium.org, horo+watch_chromium.org, Nate Chapin, jsbell+serviceworker_chromium.org, kinuko+serviceworker, kinuko+worker_chromium.org, michaeln, nhiroki, serviceworker-reviews, tyoshino+watch_chromium.org, tzik, vivekg_samsung, dcheng
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

CachedMetadata support for ServiceWorker script. This cl changes the followings - Introduce CachedMetadataHandler interface. - Change V8ScriptRunner to use this interface instead of Resource class while handling the metadata. - Introduce ServiceWorkerScriptCachedMetadataHandler. - In WorkerThread::initialize(), we create CachedMetadataHandler by calling workerGlobalScope()->createWorkerScriptCachedMetadataHandler() with m_cachedMetaData in WorkerThreadStartupData. - If the workerGlobalScope is a ServiceWorkerGlobalScope createWorkerScriptCachedMetadataHandler() returns ServiceWorkerScriptCachedMetadataHandler, otherwise returns null. - We pass it to WorkerScriptController. And it will be used in V8ScriptRunner. - When ServiceWorkerScriptCachedMetadataHandler.setCachedMetadata/clearCachedMetadata is called, we call ServiceWorkerGlobalScopeClientImpl.setCachedMetadata/clearCachedMetadata. - When ServiceWorkerGlobalScopeClientImpl.setCachedMetadata/clearCachedMetadata is called we call WebServiceWorkerContextClient.setCachedMetadata/clearCachedMetadata. I will implement ServiceWorkerScriptContext.setCachedMetadata/clearCachedMetadata in chromium side. These method will send IPC message to the browser process. BUG=449895 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190399

Patch Set 1 #

Total comments: 4

Patch Set 2 : incorporated vivekg's comment / update core.gypi #

Patch Set 3 : update WorkerScriptController.h #

Total comments: 7

Patch Set 4 : incorporated vivekg's comment #

Total comments: 22

Patch Set 5 : incorporated vogelheim's comment #

Patch Set 6 : incorporated kinuko's comment #

Total comments: 6

Patch Set 7 : fix test failure #

Patch Set 8 : incorporated vogelheim's comment #

Patch Set 9 : WorkerGlobalScope::createWorkerScriptCachedMetadataHandler #

Total comments: 8

Patch Set 10 : incorporated kinuko's comment #

Total comments: 8

Patch Set 11 : incorporated marja's comment #

Total comments: 4

Patch Set 12 : incorporated marja's comment #

Total comments: 4

Patch Set 13 : incorporated nichaeln's comment #

Total comments: 6

Patch Set 14 : incorporated tkent's comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -106 lines) Patch
M Source/bindings/core/v8/PrivateScriptRunner.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/core/v8/ScriptDebugServer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/core/v8/ScriptStreamer.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/core/v8/ScriptStreamerTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M Source/bindings/core/v8/V8ScriptRunner.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -3 lines 0 comments Download
M Source/bindings/core/v8/V8ScriptRunner.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 chunks +49 lines, -43 lines 0 comments Download
M Source/bindings/core/v8/V8ScriptRunnerTest.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +24 lines, -28 lines 0 comments Download
M Source/bindings/core/v8/WorkerScriptController.h View 1 2 3 4 chunks +4 lines, -2 lines 0 comments Download
M Source/bindings/core/v8/WorkerScriptController.cpp View 1 3 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/fetch/CachedMetadataHandler.h View 1 2 3 4 5 8 9 10 11 12 13 1 chunk +38 lines, -0 lines 0 comments Download
M Source/core/fetch/Resource.h View 1 2 3 4 5 6 7 8 9 5 chunks +9 lines, -15 lines 0 comments Download
M Source/core/fetch/Resource.cpp View 1 2 3 4 5 6 7 4 chunks +55 lines, -4 lines 0 comments Download
M Source/core/fetch/ResourceTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/workers/WorkerGlobalScope.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/workers/WorkerThread.cpp View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -1 line 0 comments Download
M Source/modules/modules.gypi View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/serviceworkers/ServiceWorkerGlobalScope.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h View 1 chunk +2 lines, -0 lines 0 comments Download
A Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -0 lines 0 comments Download
A Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +55 lines, -0 lines 0 comments Download
M Source/web/ServiceWorkerGlobalScopeClientImpl.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/web/ServiceWorkerGlobalScopeClientImpl.cpp View 1 chunk +10 lines, -0 lines 0 comments Download
M public/web/WebServiceWorkerContextClient.h View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (14 generated)
horo
kinuko@ Could you please review this? Thank you!
5 years, 10 months ago (2015-02-16 08:24:46 UTC) #2
vivekg
https://codereview.chromium.org/929953002/diff/1/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp File Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp (right): https://codereview.chromium.org/929953002/diff/1/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp#newcode391 Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp:391: v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(expression, String(), TextPosition(), 0, 0, 0, ...
5 years, 10 months ago (2015-02-16 08:31:50 UTC) #4
vivekg
https://codereview.chromium.org/929953002/diff/1/Source/bindings/core/v8/V8ScriptRunner.h File Source/bindings/core/v8/V8ScriptRunner.h (right): https://codereview.chromium.org/929953002/diff/1/Source/bindings/core/v8/V8ScriptRunner.h#newcode50 Source/bindings/core/v8/V8ScriptRunner.h:50: static v8::Local<v8::Script> compileScript(v8::Handle<v8::String>, const String& fileName, const TextPosition&, ScriptResource*, ...
5 years, 10 months ago (2015-02-16 08:36:49 UTC) #5
horo
Thank you! https://codereview.chromium.org/929953002/diff/1/Source/bindings/core/v8/V8ScriptRunner.h File Source/bindings/core/v8/V8ScriptRunner.h (right): https://codereview.chromium.org/929953002/diff/1/Source/bindings/core/v8/V8ScriptRunner.h#newcode50 Source/bindings/core/v8/V8ScriptRunner.h:50: static v8::Local<v8::Script> compileScript(v8::Handle<v8::String>, const String& fileName, const ...
5 years, 10 months ago (2015-02-16 08:57:44 UTC) #6
vivekg
https://codereview.chromium.org/929953002/diff/40001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp File Source/bindings/core/v8/V8ScriptRunnerTest.cpp (right): https://codereview.chromium.org/929953002/diff/40001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp#newcode68 Source/bindings/core/v8/V8ScriptRunnerTest.cpp:68: isolate(), m_resource.get(), 0, 0, NotSharableCrossOrigin, cacheOptions) nit: 0 -> ...
5 years, 10 months ago (2015-02-16 09:02:53 UTC) #7
vivekg
bindings lgtm (non-owner) with some minor nits. https://codereview.chromium.org/929953002/diff/40001/Source/bindings/core/v8/V8ScriptRunner.h File Source/bindings/core/v8/V8ScriptRunner.h (right): https://codereview.chromium.org/929953002/diff/40001/Source/bindings/core/v8/V8ScriptRunner.h#newcode43 Source/bindings/core/v8/V8ScriptRunner.h:43: class CachedMetadataHandler; ...
5 years, 10 months ago (2015-02-16 09:20:09 UTC) #8
horo
Thank you!! https://codereview.chromium.org/929953002/diff/40001/Source/bindings/core/v8/V8ScriptRunner.h File Source/bindings/core/v8/V8ScriptRunner.h (right): https://codereview.chromium.org/929953002/diff/40001/Source/bindings/core/v8/V8ScriptRunner.h#newcode43 Source/bindings/core/v8/V8ScriptRunner.h:43: class CachedMetadataHandler; On 2015/02/16 09:20:08, vivekg_ wrote: ...
5 years, 10 months ago (2015-02-16 10:23:27 UTC) #10
horo
vogelheim@ Could you please review this?
5 years, 10 months ago (2015-02-16 10:28:31 UTC) #12
vogelheim
Generally looks good, but I'm unhappy with the CacheHandler-for-non-cacheable-resources thing. I try to explain in ...
5 years, 10 months ago (2015-02-16 13:12:05 UTC) #13
kinuko
https://codereview.chromium.org/929953002/diff/60001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/60001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode279 Source/bindings/core/v8/V8ScriptRunner.cpp:279: It looks it's possible to reach here when cacheHandler ...
5 years, 10 months ago (2015-02-16 14:18:39 UTC) #14
horo
https://codereview.chromium.org/929953002/diff/60001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/60001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode276 Source/bindings/core/v8/V8ScriptRunner.cpp:276: if ((resource && !resource->url().protocolIsInHTTPFamily()) || (!resource && !cacheHandler)) On ...
5 years, 10 months ago (2015-02-16 16:20:12 UTC) #16
vogelheim
https://codereview.chromium.org/929953002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode202 Source/bindings/core/v8/V8ScriptRunner.cpp:202: return (v8CacheDataVersion | kind) + StringHash::hash(cacheHandler->encoding()); fyi, there's a ...
5 years, 10 months ago (2015-02-16 17:29:50 UTC) #17
horo
https://codereview.chromium.org/929953002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode202 Source/bindings/core/v8/V8ScriptRunner.cpp:202: return (v8CacheDataVersion | kind) + StringHash::hash(cacheHandler->encoding()); On 2015/02/16 17:29:49, ...
5 years, 10 months ago (2015-02-16 17:54:27 UTC) #18
vogelheim
lgtm
5 years, 10 months ago (2015-02-16 18:00:07 UTC) #19
kinuko
https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h File Source/core/workers/WorkerGlobalScope.h (right): https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h#newcode103 Source/core/workers/WorkerGlobalScope.h:103: virtual void clearCachedMetadata(const KURL&) { } On 2015/02/16 16:20:12, ...
5 years, 10 months ago (2015-02-17 02:32:32 UTC) #20
horo
https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h File Source/core/workers/WorkerGlobalScope.h (right): https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h#newcode103 Source/core/workers/WorkerGlobalScope.h:103: virtual void clearCachedMetadata(const KURL&) { } On 2015/02/17 02:32:31, ...
5 years, 10 months ago (2015-02-17 03:32:18 UTC) #21
horo
https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h File Source/core/workers/WorkerGlobalScope.h (right): https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h#newcode103 Source/core/workers/WorkerGlobalScope.h:103: virtual void clearCachedMetadata(const KURL&) { } On 2015/02/17 02:32:31, ...
5 years, 10 months ago (2015-02-17 03:32:18 UTC) #22
kinuko
https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h File Source/core/workers/WorkerGlobalScope.h (right): https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h#newcode103 Source/core/workers/WorkerGlobalScope.h:103: virtual void clearCachedMetadata(const KURL&) { } On 2015/02/17 03:32:18, ...
5 years, 10 months ago (2015-02-17 05:19:24 UTC) #23
horo
On 2015/02/17 05:19:24, kinuko wrote: > https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h > File Source/core/workers/WorkerGlobalScope.h (right): > > https://codereview.chromium.org/929953002/diff/60001/Source/core/workers/WorkerGlobalScope.h#newcode103 > ...
5 years, 10 months ago (2015-02-17 07:35:02 UTC) #25
kinuko
Thanks, lgtm https://codereview.chromium.org/929953002/diff/160001/Source/core/fetch/Resource.h File Source/core/fetch/Resource.h (right): https://codereview.chromium.org/929953002/diff/160001/Source/core/fetch/Resource.h#newcode197 Source/core/fetch/Resource.h:197: // This may returns nullptr when the ...
5 years, 10 months ago (2015-02-17 07:56:46 UTC) #26
horo
https://codereview.chromium.org/929953002/diff/160001/Source/core/fetch/Resource.h File Source/core/fetch/Resource.h (right): https://codereview.chromium.org/929953002/diff/160001/Source/core/fetch/Resource.h#newcode197 Source/core/fetch/Resource.h:197: // This may returns nullptr when the resource isn't ...
5 years, 10 months ago (2015-02-17 08:20:27 UTC) #28
horo
marja@ Could you please review Source/bindings/core/v8/*? dcheng@ Could you please review Source/web/ServiceWorkerGlobalScopeClientImpl.* and public/web/WebServiceWorkerContextClient.h? Thank ...
5 years, 10 months ago (2015-02-17 08:22:00 UTC) #30
marja
lgtm modulo comments https://codereview.chromium.org/929953002/diff/180001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/180001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode235 Source/bindings/core/v8/V8ScriptRunner.cpp:235: if (!cacheHandler) I don't think this ...
5 years, 10 months ago (2015-02-17 11:31:58 UTC) #31
marja
https://codereview.chromium.org/929953002/diff/200001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/200001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode369 Source/bindings/core/v8/V8ScriptRunner.cpp:369: // When streamer is set, resource must be set. ...
5 years, 10 months ago (2015-02-17 12:45:59 UTC) #33
horo
Thank you https://codereview.chromium.org/929953002/diff/180001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/180001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode235 Source/bindings/core/v8/V8ScriptRunner.cpp:235: if (!cacheHandler) On 2015/02/17 11:31:58, marja wrote: ...
5 years, 10 months ago (2015-02-17 12:53:43 UTC) #34
michaeln
drive-by https://codereview.chromium.org/929953002/diff/220001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/220001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode166 Source/bindings/core/v8/V8ScriptRunner.cpp:166: cacheHandler->clearCachedMetadata(); Maybe pass in CachedMetadataHandler::CacheLocally explicitly here. I ...
5 years, 10 months ago (2015-02-18 03:13:18 UTC) #36
horo
https://codereview.chromium.org/929953002/diff/220001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/929953002/diff/220001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode166 Source/bindings/core/v8/V8ScriptRunner.cpp:166: cacheHandler->clearCachedMetadata(); On 2015/02/18 03:13:18, michaeln wrote: > Maybe pass ...
5 years, 10 months ago (2015-02-18 03:45:04 UTC) #37
horo
tkent@ Could you please review Source/web/ServiceWorkerGlobalScopeClientImpl.* and public/web/WebServiceWorkerContextClient.h? Thank you!
5 years, 10 months ago (2015-02-18 04:34:38 UTC) #40
tkent
lgtm https://codereview.chromium.org/929953002/diff/240001/Source/core/fetch/CachedMetadataHandler.h File Source/core/fetch/CachedMetadataHandler.h (right): https://codereview.chromium.org/929953002/diff/240001/Source/core/fetch/CachedMetadataHandler.h#newcode8 Source/core/fetch/CachedMetadataHandler.h:8: #include "wtf/text/WTFString.h" nit: probably we can use wtf/Forward.h ...
5 years, 10 months ago (2015-02-18 04:47:21 UTC) #41
horo
Thank you!! https://codereview.chromium.org/929953002/diff/240001/Source/core/fetch/CachedMetadataHandler.h File Source/core/fetch/CachedMetadataHandler.h (right): https://codereview.chromium.org/929953002/diff/240001/Source/core/fetch/CachedMetadataHandler.h#newcode8 Source/core/fetch/CachedMetadataHandler.h:8: #include "wtf/text/WTFString.h" On 2015/02/18 04:47:20, tkent wrote: ...
5 years, 10 months ago (2015-02-18 04:56:59 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/929953002/260001
5 years, 10 months ago (2015-02-18 04:57:27 UTC) #45
commit-bot: I haz the power
5 years, 10 months ago (2015-02-18 06:21:21 UTC) #46
Message was sent while issue was closed.
Committed patchset #14 (id:260001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=190399

Powered by Google App Engine
This is Rietveld 408576698