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

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

Issue 136763011: Initialize WebEmbeddedWorkerStartData before using it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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 "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/child/child_process.h" 10 #include "content/child/child_process.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 new EmbeddedWorkerContextClient( 68 new EmbeddedWorkerContextClient(
69 embedded_worker_id, 69 embedded_worker_id,
70 service_worker_version_id, 70 service_worker_version_id,
71 script_url), 71 script_url),
72 NULL))); 72 NULL)));
73 73
74 blink::WebEmbeddedWorkerStartData start_data; 74 blink::WebEmbeddedWorkerStartData start_data;
75 start_data.scriptURL = script_url; 75 start_data.scriptURL = script_url;
76 start_data.userAgent = 76 start_data.userAgent =
77 base::UTF8ToUTF16(webkit_glue::GetUserAgent(script_url)); 77 base::UTF8ToUTF16(webkit_glue::GetUserAgent(script_url));
78 start_data.startMode = blink::WebEmbeddedWorkerStartModeDontPauseOnStart;
78 79
79 wrapper->worker()->startWorkerContext(start_data); 80 wrapper->worker()->startWorkerContext(start_data);
80 workers_.AddWithID(wrapper.release(), embedded_worker_id); 81 workers_.AddWithID(wrapper.release(), embedded_worker_id);
81 } 82 }
82 83
83 void EmbeddedWorkerDispatcher::OnStopWorker(int embedded_worker_id) { 84 void EmbeddedWorkerDispatcher::OnStopWorker(int embedded_worker_id) {
84 WorkerWrapper* wrapper = workers_.Lookup(embedded_worker_id); 85 WorkerWrapper* wrapper = workers_.Lookup(embedded_worker_id);
85 if (!wrapper) { 86 if (!wrapper) {
86 LOG(WARNING) << "Got OnStopWorker for nonexistent worker"; 87 LOG(WARNING) << "Got OnStopWorker for nonexistent worker";
87 return; 88 return;
88 } 89 }
89 90
90 // This should eventually call WorkerContextDestroyed. (We may need to post 91 // This should eventually call WorkerContextDestroyed. (We may need to post
91 // a delayed task to forcibly abort the worker context if we find it 92 // a delayed task to forcibly abort the worker context if we find it
92 // necessary) 93 // necessary)
93 wrapper->worker()->terminateWorkerContext(); 94 wrapper->worker()->terminateWorkerContext();
94 } 95 }
95 96
96 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698