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

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

Issue 697593002: ServiceWorker: Registering a malformed script should fail [2/3] (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 6 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback.h"
12 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
13 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
17 #include "base/observer_list.h" 18 #include "base/observer_list.h"
18 #include "base/strings/string16.h" 19 #include "base/strings/string16.h"
19 #include "content/common/content_export.h" 20 #include "content/common/content_export.h"
20 #include "content/common/service_worker/service_worker_status_code.h" 21 #include "content/common/service_worker/service_worker_status_code.h"
21 #include "url/gurl.h" 22 #include "url/gurl.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 139
139 // Called back from Registry when the worker instance has ack'ed that 140 // Called back from Registry when the worker instance has ack'ed that
140 // it finished loading the script and has started a worker thread. 141 // it finished loading the script and has started a worker thread.
141 void OnScriptLoaded(int thread_id); 142 void OnScriptLoaded(int thread_id);
142 143
143 // Called back from Registry when the worker instance has ack'ed that 144 // Called back from Registry when the worker instance has ack'ed that
144 // it failed to load the script. 145 // it failed to load the script.
145 void OnScriptLoadFailed(); 146 void OnScriptLoadFailed();
146 147
147 // Called back from Registry when the worker instance has ack'ed that 148 // Called back from Registry when the worker instance has ack'ed that
149 // it finished evaluating the script.
150 void OnScriptEvaluated(bool success);
151
152 // Called back from Registry when the worker instance has ack'ed that
148 // its WorkerGlobalScope is actually started and parsed. 153 // its WorkerGlobalScope is actually started and parsed.
149 // This will change the internal status from STARTING to RUNNING. 154 // This will change the internal status from STARTING to RUNNING.
150 void OnStarted(); 155 void OnStarted();
151 156
152 void OnPausedAfterDownload(); 157 void OnPausedAfterDownload();
153 158
154 // Called back from Registry when the worker instance has ack'ed that 159 // Called back from Registry when the worker instance has ack'ed that
155 // its WorkerGlobalScope is actually stopped in the child process. 160 // its WorkerGlobalScope is actually stopped in the child process.
156 // This will change the internal status from STARTING or RUNNING to 161 // This will change the internal status from STARTING or RUNNING to
157 // STOPPED. 162 // STOPPED.
(...skipping 20 matching lines...) Expand all
178 base::WeakPtr<ServiceWorkerContextCore> context_; 183 base::WeakPtr<ServiceWorkerContextCore> context_;
179 scoped_refptr<EmbeddedWorkerRegistry> registry_; 184 scoped_refptr<EmbeddedWorkerRegistry> registry_;
180 const int embedded_worker_id_; 185 const int embedded_worker_id_;
181 Status status_; 186 Status status_;
182 187
183 // Current running information. -1 indicates the worker is not running. 188 // Current running information. -1 indicates the worker is not running.
184 int process_id_; 189 int process_id_;
185 int thread_id_; 190 int thread_id_;
186 int worker_devtools_agent_route_id_; 191 int worker_devtools_agent_route_id_;
187 192
193 StatusCallback start_callback_;
194
188 ListenerList listener_list_; 195 ListenerList listener_list_;
189 196
190 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; 197 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_;
191 198
192 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); 199 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance);
193 }; 200 };
194 201
195 } // namespace content 202 } // namespace content
196 203
197 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ 204 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698