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_context_client.h

Issue 205033002: Browser side of new ServiceWorker 'sync' event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ 6 #define CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // WebServiceWorkerContextClient overrides, some of them are just dispatched 53 // WebServiceWorkerContextClient overrides, some of them are just dispatched
54 // on to script_context_. 54 // on to script_context_.
55 virtual void workerContextFailedToStart(); 55 virtual void workerContextFailedToStart();
56 virtual void workerContextStarted(blink::WebServiceWorkerContextProxy* proxy); 56 virtual void workerContextStarted(blink::WebServiceWorkerContextProxy* proxy);
57 virtual void workerContextDestroyed(); 57 virtual void workerContextDestroyed();
58 virtual void didHandleInstallEvent(int request_id); 58 virtual void didHandleInstallEvent(int request_id);
59 virtual void didHandleFetchEvent(int request_id); 59 virtual void didHandleFetchEvent(int request_id);
60 virtual void didHandleFetchEvent( 60 virtual void didHandleFetchEvent(
61 int request_id, 61 int request_id,
62 const blink::WebServiceWorkerResponse& response); 62 const blink::WebServiceWorkerResponse& response);
63 virtual void didHandleSyncEvent(int request_id);
63 64
64 // TODO: Implement DevTools related method overrides. 65 // TODO: Implement DevTools related method overrides.
65 66
66 int embedded_worker_id() const { return embedded_worker_id_; } 67 int embedded_worker_id() const { return embedded_worker_id_; }
67 68
68 private: 69 private:
69 void OnSendMessageToWorker(int thread_id, 70 void OnSendMessageToWorker(int thread_id,
70 int embedded_worker_id, 71 int embedded_worker_id,
71 int request_id, 72 int request_id,
72 const IPC::Message& message); 73 const IPC::Message& message);
73 void SendWorkerStarted(); 74 void SendWorkerStarted();
74 75
75 const int embedded_worker_id_; 76 const int embedded_worker_id_;
76 const int64 service_worker_version_id_; 77 const int64 service_worker_version_id_;
77 const GURL script_url_; 78 const GURL script_url_;
78 scoped_refptr<ThreadSafeSender> sender_; 79 scoped_refptr<ThreadSafeSender> sender_;
79 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; 80 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_;
80 scoped_refptr<base::TaskRunner> worker_task_runner_; 81 scoped_refptr<base::TaskRunner> worker_task_runner_;
81 82
82 scoped_ptr<ServiceWorkerScriptContext> script_context_; 83 scoped_ptr<ServiceWorkerScriptContext> script_context_;
83 84
84 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_; 85 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_;
85 86
86 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient); 87 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient);
87 }; 88 };
88 89
89 } // namespace content 90 } // namespace content
90 91
91 #endif // CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ 92 #endif // CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698