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

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

Issue 140893002: Adding slightly clearer separation between SW and EmbeddedWorker (still incomplete) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added TODO to filter messages on the browser side Created 6 years, 11 months 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 2014 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_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
7
8 #include "base/basictypes.h"
9
10 namespace blink {
11 class WebServiceWorkerContextProxy;
12 }
13
14 namespace IPC {
15 class Message;
16 }
17
18 namespace content {
19
20 class EmbeddedWorkerContextClient;
21 struct ServiceWorkerFetchRequest;
22
23 // TODO(kinuko): This should implement WebServiceWorkerContextClient
24 // rather than having EmbeddedWorkerContextClient implement it.
25 // See the header comment in embedded_worker_context_client.h for the
26 // potential EW/SW layering concerns.
27 class ServiceWorkerScriptContext {
28 public:
29 ServiceWorkerScriptContext(
30 EmbeddedWorkerContextClient* embedded_context,
31 blink::WebServiceWorkerContextProxy* proxy);
32 ~ServiceWorkerScriptContext();
33
34 void OnMessageReceived(const IPC::Message& message);
35
36 private:
37 // Send message back to the browser.
38 void Send(const IPC::Message& message);
39
40 void OnFetchEvent(const ServiceWorkerFetchRequest& request);
41
42 // Not owned; embedded_context_ owns this.
43 EmbeddedWorkerContextClient* embedded_context_;
44
45 // Not owned; this object is destroyed when proxy_ becomes invalid.
46 blink::WebServiceWorkerContextProxy* proxy_;
47
48 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext);
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698