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

Side by Side Diff: content/browser/service_worker/embedded_worker_instance.h

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Cleanup Created 3 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
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_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 24 matching lines...) Expand all
35 #endif 35 #endif
36 36
37 namespace IPC { 37 namespace IPC {
38 class Message; 38 class Message;
39 } 39 }
40 40
41 namespace content { 41 namespace content {
42 42
43 class EmbeddedWorkerRegistry; 43 class EmbeddedWorkerRegistry;
44 struct EmbeddedWorkerStartParams; 44 struct EmbeddedWorkerStartParams;
45 class MessagePortMessageFilter;
46 class ServiceWorkerContextCore; 45 class ServiceWorkerContextCore;
47 46
48 // This gives an interface to control one EmbeddedWorker instance, which 47 // This gives an interface to control one EmbeddedWorker instance, which
49 // may be 'in-waiting' or running in one of the child processes added by 48 // may be 'in-waiting' or running in one of the child processes added by
50 // AddProcessReference(). 49 // AddProcessReference().
51 class CONTENT_EXPORT EmbeddedWorkerInstance { 50 class CONTENT_EXPORT EmbeddedWorkerInstance {
52 public: 51 public:
53 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; 52 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback;
54 53
55 // This enum is used in UMA histograms. Append-only. 54 // This enum is used in UMA histograms. Append-only.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 StartingPhase starting_phase() const { 134 StartingPhase starting_phase() const {
136 DCHECK_EQ(EmbeddedWorkerStatus::STARTING, status()); 135 DCHECK_EQ(EmbeddedWorkerStatus::STARTING, status());
137 return starting_phase_; 136 return starting_phase_;
138 } 137 }
139 int process_id() const; 138 int process_id() const;
140 int thread_id() const { return thread_id_; } 139 int thread_id() const { return thread_id_; }
141 // This should be called only when the worker instance has a valid process, 140 // This should be called only when the worker instance has a valid process,
142 // that is, when |process_id()| returns a valid process id. 141 // that is, when |process_id()| returns a valid process id.
143 bool is_new_process() const; 142 bool is_new_process() const;
144 int worker_devtools_agent_route_id() const; 143 int worker_devtools_agent_route_id() const;
145 MessagePortMessageFilter* message_port_message_filter() const;
146 144
147 void AddListener(Listener* listener); 145 void AddListener(Listener* listener);
148 void RemoveListener(Listener* listener); 146 void RemoveListener(Listener* listener);
149 147
150 void set_devtools_attached(bool attached) { devtools_attached_ = attached; } 148 void set_devtools_attached(bool attached) { devtools_attached_ = attached; }
151 bool devtools_attached() const { return devtools_attached_; } 149 bool devtools_attached() const { return devtools_attached_; }
152 150
153 bool network_accessed_for_script() const { 151 bool network_accessed_for_script() const {
154 return network_accessed_for_script_; 152 return network_accessed_for_script_;
155 } 153 }
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 base::TimeTicks step_time_; 325 base::TimeTicks step_time_;
328 326
329 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; 327 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_;
330 328
331 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); 329 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance);
332 }; 330 };
333 331
334 } // namespace content 332 } // namespace content
335 333
336 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ 334 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698