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

Issue 182253010: Register a Service Worker when an extension is enabled. (Closed)

Created:
6 years, 9 months ago by Jeffrey Yasskin
Modified:
6 years, 4 months ago
CC:
serviceworker-reviews
Visibility:
Public.

Description

Register a Service Worker when an extension is enabled. The ServiceWorkerManager handles registration and deregistration requests from the ExtensionService and hands things off to the IO thread and ServiceWorkerContext. Eventually, this manager will also proxy messages and make sure they're only sent after the SW registration has taken effect. BUG=347328

Patch Set 1 #

Patch Set 2 : Roughly wire things up and add a test #

Total comments: 4

Patch Set 3 : Start writing a public ServiceWorker API #

Patch Set 4 : Use a real renderer process; now it crashes later #

Patch Set 5 : Sync to r258328 #

Patch Set 6 : Test passes! Don't know if it's right though #

Patch Set 7 : Sync to r261176 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+666 lines, -23 lines) Patch
M apps/shell/browser/shell_extension_system.cc View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/DEPS View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 4 5 6 6 chunks +23 lines, -0 lines 0 comments Download
A chrome/browser/extensions/service_worker_browsertest.cc View 1 2 3 4 5 6 1 chunk +142 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/extensions/extension_view_views.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_register_job.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 1 2 3 4 5 6 6 chunks +10 lines, -9 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_dispatcher.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/extension_host.h View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 2 comments Download
M extensions/browser/extension_host.cc View 1 2 3 4 5 6 2 chunks +19 lines, -1 line 0 comments Download
M extensions/browser/process_manager.h View 1 2 3 4 5 6 1 chunk +4 lines, -2 lines 0 comments Download
M extensions/browser/process_manager.cc View 1 2 3 4 5 6 4 chunks +14 lines, -7 lines 0 comments Download
A extensions/browser/service_worker_manager.h View 1 2 3 4 5 6 1 chunk +135 lines, -0 lines 0 comments Download
A extensions/browser/service_worker_manager.cc View 1 2 3 4 5 6 1 chunk +294 lines, -0 lines 0 comments Download
M extensions/extensions.gyp View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M tools/gdb/gdb_chrome.py View 1 2 3 4 5 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Jeffrey Yasskin
Hey Service Worker folks, No reply needed until Monday, but I wanted to get this ...
6 years, 9 months ago (2014-03-08 04:35:37 UTC) #1
kinuko
(Haven't really looked through all the code/docs yet) > 1) What do you want the ...
6 years, 9 months ago (2014-03-10 07:03:18 UTC) #2
scheib
https://codereview.chromium.org/182253010/diff/20001/extensions/browser/service_worker_manager.cc File extensions/browser/service_worker_manager.cc (right): https://codereview.chromium.org/182253010/diff/20001/extensions/browser/service_worker_manager.cc#newcode53 extensions/browser/service_worker_manager.cc:53: DCHECK(BrowserThread::CurrentlyOn(thread)) << CurrentBrowserThreadName(); Maybe base::MessageLoop::current()->thread_name();
6 years, 9 months ago (2014-03-10 21:31:38 UTC) #3
michaeln
1) What do you want the public content API to look like roughly? I'd vote ...
6 years, 9 months ago (2014-03-10 22:15:03 UTC) #4
scheib
https://codereview.chromium.org/182253010/diff/20001/chrome/browser/extensions/service_worker_browsertest.cc File chrome/browser/extensions/service_worker_browsertest.cc (right): https://codereview.chromium.org/182253010/diff/20001/chrome/browser/extensions/service_worker_browsertest.cc#newcode97 chrome/browser/extensions/service_worker_browsertest.cc:97: ext_dir_.WriteFile("service_worker.js", ""); You will need: FILE_PATH_LITERAL("service_worker.js")
6 years, 9 months ago (2014-03-12 21:42:48 UTC) #5
alecflett
On 2014/03/10 22:15:03, michaeln wrote: > 1) What do you want the public content API ...
6 years, 9 months ago (2014-03-13 22:47:02 UTC) #6
scheib
6 years, 8 months ago (2014-04-24 22:11:39 UTC) #7
https://codereview.chromium.org/182253010/diff/140001/extensions/browser/exte...
File extensions/browser/extension_host.h (right):

https://codereview.chromium.org/182253010/diff/140001/extensions/browser/exte...
extensions/browser/extension_host.h:50: ExtensionHost(const Extension*
extension,
Planning to keep the use of ExtensionHost for service worker backed extensions,
and having ExtensionHost abstract the details of being RenderView or
ServiceWorker backed?

https://codereview.chromium.org/182253010/diff/140001/extensions/browser/exte...
extensions/browser/extension_host.h:58: content::RenderViewHost*
render_view_host() const;
Extension with a ServiceWorker won't have a RenderViewHost to return here,
right? It would be appropriate to have something like ServiceWorkerHost*?

Powered by Google App Engine
This is Rietveld 408576698