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

Issue 1719007: Initializing an appcache host in a worker process. (Closed)

Created:
10 years, 8 months ago by michaeln
Modified:
9 years, 7 months ago
CC:
chromium-reviews, jam, ben+cc_chromium.org, Kavita Kanetkar
Visibility:
Public.

Description

Add some more IPC plumbing and scaffolding to support having appcache work in workers. Everything is still stubbed out at runtime (runtime feature is still disabled in the worker process, and the values in the IPC messages are all zero'd out). * Widen the CreateWorker IPC message sent from the browser to the worker process to contain additional data needed to initialize an appcache for that worker. * Add a new worker specific WorkerWebApplicationCacheHostImpl class and instantiate one with the initialization data received in the IPC. * Give the WorkerThread an AppCacheDispatcher. * Propagate the cmd-line argument to disable the appcache to the worker process. * Fixup DEPs to show that chrome/workers depends on webkit/appcache BUG=39368 TEST=thinking about what tests to put together for this CL Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=46765

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Total comments: 8

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -39 lines) Patch
M chrome/browser/worker_host/worker_process_host.cc View 1 2 3 4 2 chunks +15 lines, -4 lines 0 comments Download
M chrome/chrome.gyp View 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/worker_messages.h View 5 3 chunks +54 lines, -0 lines 0 comments Download
M chrome/common/worker_messages_internal.h View 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/worker/DEPS View 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/worker/websharedworker_stub.h View 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/worker/websharedworker_stub.cc View 2 3 4 5 6 2 chunks +7 lines, -4 lines 0 comments Download
M chrome/worker/webworker_stub.h View 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/worker/webworker_stub.cc View 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/worker/webworker_stub_base.h View 2 3 2 chunks +7 lines, -1 line 0 comments Download
M chrome/worker/webworker_stub_base.cc View 2 3 1 chunk +3 lines, -1 line 0 comments Download
M chrome/worker/webworkerclient_proxy.h View 2 3 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/worker/webworkerclient_proxy.cc View 2 3 3 chunks +16 lines, -2 lines 0 comments Download
M chrome/worker/worker_thread.h View 1 2 3 4 2 chunks +9 lines, -5 lines 0 comments Download
M chrome/worker/worker_thread.cc View 1 2 3 4 3 chunks +23 lines, -9 lines 0 comments Download
A chrome/worker/worker_webapplicationcachehost_impl.h View 3 4 5 6 7 1 chunk +52 lines, -0 lines 0 comments Download
A chrome/worker/worker_webapplicationcachehost_impl.cc View 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
michaeln
Please take a look
10 years, 7 months ago (2010-05-07 01:33:49 UTC) #1
Andrew T Wilson (Slow)
This looks good from a fit-in-with-workers pov, although I don't completely understand the appcache framework ...
10 years, 7 months ago (2010-05-07 22:49:17 UTC) #2
michaeln
10 years, 7 months ago (2010-05-07 23:14:31 UTC) #3
http://codereview.chromium.org/1719007/diff/48002/78014
File chrome/worker/worker_thread.cc (right):

http://codereview.chromium.org/1719007/diff/48002/78014#newcode38
chrome/worker/worker_thread.cc:38:
channel()->AddFilter(db_message_filter_.get());
On 2010/05/07 22:49:17, Andrew T Wilson wrote:
> Is it OK to move these lines up before we enable/disable the database? I think
> it' should be fine because I think the WebRuntimeFeatures stuff just hides
APIs
> from javascript, but it's something to be careful with.
> 

Should be ok. The object ctors and functions being called don't check the state
of the runtime enabled flag.

http://codereview.chromium.org/1719007/diff/48002/78015
File chrome/worker/worker_thread.h (right):

http://codereview.chromium.org/1719007/diff/48002/78015#newcode43
chrome/worker/worker_thread.h:43: scoped_ptr<AppCacheDispatcher>
appcache_dispatcher_;
On 2010/05/07 22:49:17, Andrew T Wilson wrote:
> Since this is the WorkerThread object, it seems like appcache_dispatcher_
can't
> outlive us. Is there a reason to allocate it on the heap?

This could be alloc'd inline. I have it as a separate heap alloc simply because
that is how the RenderThread, which also uses this class, is put together. It
does help us avoid an include in this .h file.

http://codereview.chromium.org/1719007/diff/48002/78016
File chrome/worker/worker_webapplicationcachehost_impl.cc (right):

http://codereview.chromium.org/1719007/diff/48002/78016#newcode26
chrome/worker/worker_webapplicationcachehost_impl.cc:26: WebKit::WebURLRequest&)
{
On 2010/05/07 22:49:17, Andrew T Wilson wrote:
> So, not certain I completely understand the future data flow - are we filling
in
> code for these callbacks in the future, or will they always remain empty
(don't
> care - just filling out the interface0/ If the latter, I'd probably biff the
> explicit return statements.

These will always be empty methods, I'll just put the empty method bodies in the
.h file instead.

http://codereview.chromium.org/1719007/diff/48002/78017
File chrome/worker/worker_webapplicationcachehost_impl.h (right):

http://codereview.chromium.org/1719007/diff/48002/78017#newcode25
chrome/worker/worker_webapplicationcachehost_impl.h:25:
parent_appcache_host_id(host_id), main_resource_appcache_id(cache_id) {
On 2010/05/07 22:49:17, Andrew T Wilson wrote:
> Is it useful to add stuff like DCHECK(is_shared || main_resource_appcache_id
==
> 0), etc here to validate that we pass valid values in for dedicated vs shared
> workers?

I think DCHECKs like that can be useful for self-documenting code purposes. I
don't have anything like here for two reasons.
1. To avoid including logging.h in this .h file.
2. The comments adjacent the data members about 10 lines up from here do that
documenting already.

Powered by Google App Engine
This is Rietveld 408576698