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

Side by Side Diff: content/renderer/service_worker/embedded_worker_dispatcher.h

Issue 54573002: Initial child-process side plumbing for starting an embedded ServiceWorker context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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 CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_
7
8 #include "base/basictypes.h"
9 #include "base/id_map.h"
10 #include "base/memory/weak_ptr.h"
11 #include "ipc/ipc_listener.h"
12
13 struct ServiceWorkerMsg_StartWorker_Params;
14 class GURL;
15
16 namespace WebKit {
17 class WebEmbeddedWorker;
18 }
19
20 namespace content {
21
22 // A tiny dispatcher which handles embedded worker start/stop messages.
23 class EmbeddedWorkerDispatcher : public IPC::Listener {
24 public:
25 EmbeddedWorkerDispatcher();
26 virtual ~EmbeddedWorkerDispatcher();
27
28 // IPC::Listener overrides.
29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
30
31 void WorkerContextDestroyed(int embedded_worker_id);
32
33 private:
34 class WorkerWrapper;
35
36 void OnStartWorker(int embedded_worker_id,
37 int64 service_worker_version_id,
38 const GURL& script_url);
39 void OnTerminateWorker(int embedded_worker_id);
40
41 IDMap<WorkerWrapper, IDMapOwnPointer> workers_;
42 base::WeakPtrFactory<EmbeddedWorkerDispatcher> weak_factory_;
43
44 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDispatcher);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/renderer/service_worker/OWNERS ('k') | content/renderer/service_worker/embedded_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698