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

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

Issue 2605593002: (M56) service worker: Attempt to send WorkerStopped before ProviderDestroyed. (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « no previous file | content/renderer/service_worker/embedded_worker_instance_client_impl.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 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" 5 #include "content/renderer/service_worker/embedded_worker_dispatcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 OnResumeAfterDownload) 50 OnResumeAfterDownload)
51 IPC_MESSAGE_HANDLER(EmbeddedWorkerMsg_AddMessageToConsole, 51 IPC_MESSAGE_HANDLER(EmbeddedWorkerMsg_AddMessageToConsole,
52 OnAddMessageToConsole) 52 OnAddMessageToConsole)
53 IPC_MESSAGE_UNHANDLED(handled = false) 53 IPC_MESSAGE_UNHANDLED(handled = false)
54 IPC_END_MESSAGE_MAP() 54 IPC_END_MESSAGE_MAP()
55 return handled; 55 return handled;
56 } 56 }
57 57
58 void EmbeddedWorkerDispatcher::WorkerContextDestroyed( 58 void EmbeddedWorkerDispatcher::WorkerContextDestroyed(
59 int embedded_worker_id) { 59 int embedded_worker_id) {
60 UnregisterWorker(embedded_worker_id);
61 RenderThreadImpl::current()->thread_safe_sender()->Send( 60 RenderThreadImpl::current()->thread_safe_sender()->Send(
62 new EmbeddedWorkerHostMsg_WorkerStopped(embedded_worker_id)); 61 new EmbeddedWorkerHostMsg_WorkerStopped(embedded_worker_id));
62 UnregisterWorker(embedded_worker_id);
63 } 63 }
64 64
65 void EmbeddedWorkerDispatcher::OnStartWorker( 65 void EmbeddedWorkerDispatcher::OnStartWorker(
66 const EmbeddedWorkerStartParams& params) { 66 const EmbeddedWorkerStartParams& params) {
67 DCHECK(!workers_.Lookup(params.embedded_worker_id)); 67 DCHECK(!workers_.Lookup(params.embedded_worker_id));
68 TRACE_EVENT0("ServiceWorker", "EmbeddedWorkerDispatcher::OnStartWorker"); 68 TRACE_EVENT0("ServiceWorker", "EmbeddedWorkerDispatcher::OnStartWorker");
69 std::unique_ptr<WorkerWrapper> wrapper = StartWorkerContext( 69 std::unique_ptr<WorkerWrapper> wrapper = StartWorkerContext(
70 params, base::MakeUnique<ServiceWorkerContextClient>( 70 params, base::MakeUnique<ServiceWorkerContextClient>(
71 params.embedded_worker_id, params.service_worker_version_id, 71 params.embedded_worker_id, params.service_worker_version_id,
72 params.scope, params.script_url, 72 params.scope, params.script_url,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void EmbeddedWorkerDispatcher::RecordStopWorkerTimer(int embedded_worker_id) { 173 void EmbeddedWorkerDispatcher::RecordStopWorkerTimer(int embedded_worker_id) {
174 WorkerWrapper* wrapper = workers_.Lookup(embedded_worker_id); 174 WorkerWrapper* wrapper = workers_.Lookup(embedded_worker_id);
175 DCHECK(wrapper); 175 DCHECK(wrapper);
176 // This should eventually call WorkerContextDestroyed. (We may need to post 176 // This should eventually call WorkerContextDestroyed. (We may need to post
177 // a delayed task to forcibly abort the worker context if we find it 177 // a delayed task to forcibly abort the worker context if we find it
178 // necessary) 178 // necessary)
179 stop_worker_times_[embedded_worker_id] = base::TimeTicks::Now(); 179 stop_worker_times_[embedded_worker_id] = base::TimeTicks::Now();
180 } 180 }
181 181
182 } // namespace content 182 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/service_worker/embedded_worker_instance_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698