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

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

Issue 2596173002: Use explicit WebString <-> string conversion methods for workers (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
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 std::unique_ptr<EmbeddedWorkerDispatcher::WorkerWrapper> 131 std::unique_ptr<EmbeddedWorkerDispatcher::WorkerWrapper>
132 EmbeddedWorkerDispatcher::StartWorkerContext( 132 EmbeddedWorkerDispatcher::StartWorkerContext(
133 const EmbeddedWorkerStartParams& params, 133 const EmbeddedWorkerStartParams& params,
134 std::unique_ptr<ServiceWorkerContextClient> context_client) { 134 std::unique_ptr<ServiceWorkerContextClient> context_client) {
135 std::unique_ptr<WorkerWrapper> wrapper(new WorkerWrapper( 135 std::unique_ptr<WorkerWrapper> wrapper(new WorkerWrapper(
136 blink::WebEmbeddedWorker::create(context_client.release(), nullptr), 136 blink::WebEmbeddedWorker::create(context_client.release(), nullptr),
137 params.worker_devtools_agent_route_id)); 137 params.worker_devtools_agent_route_id));
138 138
139 blink::WebEmbeddedWorkerStartData start_data; 139 blink::WebEmbeddedWorkerStartData start_data;
140 start_data.scriptURL = params.script_url; 140 start_data.scriptURL = params.script_url;
141 start_data.userAgent = base::UTF8ToUTF16(GetContentClient()->GetUserAgent()); 141 start_data.userAgent =
142 blink::WebString::fromUTF8(GetContentClient()->GetUserAgent());
142 start_data.waitForDebuggerMode = 143 start_data.waitForDebuggerMode =
143 params.wait_for_debugger 144 params.wait_for_debugger
144 ? blink::WebEmbeddedWorkerStartData::WaitForDebugger 145 ? blink::WebEmbeddedWorkerStartData::WaitForDebugger
145 : blink::WebEmbeddedWorkerStartData::DontWaitForDebugger; 146 : blink::WebEmbeddedWorkerStartData::DontWaitForDebugger;
146 start_data.v8CacheOptions = static_cast<blink::WebSettings::V8CacheOptions>( 147 start_data.v8CacheOptions = static_cast<blink::WebSettings::V8CacheOptions>(
147 params.settings.v8_cache_options); 148 params.settings.v8_cache_options);
148 start_data.dataSaverEnabled = params.settings.data_saver_enabled; 149 start_data.dataSaverEnabled = params.settings.data_saver_enabled;
149 start_data.pauseAfterDownloadMode = 150 start_data.pauseAfterDownloadMode =
150 params.pause_after_download 151 params.pause_after_download
151 ? blink::WebEmbeddedWorkerStartData::PauseAfterDownload 152 ? blink::WebEmbeddedWorkerStartData::PauseAfterDownload
(...skipping 22 matching lines...) Expand all
174 void EmbeddedWorkerDispatcher::RecordStopWorkerTimer(int embedded_worker_id) { 175 void EmbeddedWorkerDispatcher::RecordStopWorkerTimer(int embedded_worker_id) {
175 WorkerWrapper* wrapper = workers_.Lookup(embedded_worker_id); 176 WorkerWrapper* wrapper = workers_.Lookup(embedded_worker_id);
176 DCHECK(wrapper); 177 DCHECK(wrapper);
177 // This should eventually call WorkerContextDestroyed. (We may need to post 178 // This should eventually call WorkerContextDestroyed. (We may need to post
178 // a delayed task to forcibly abort the worker context if we find it 179 // a delayed task to forcibly abort the worker context if we find it
179 // necessary) 180 // necessary)
180 stop_worker_times_[embedded_worker_id] = base::TimeTicks::Now(); 181 stop_worker_times_[embedded_worker_id] = base::TimeTicks::Now();
181 } 182 }
182 183
183 } // namespace content 184 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698