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

Side by Side Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1766143002: Apply AllowCrossThreadAccess() in the callers of createCrossThreadTask() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp1549143002
Patch Set: Rebase Created 4 years, 7 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 223
224 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(ConsoleMessage* console Message) 224 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(ConsoleMessage* console Message)
225 { 225 {
226 client().reportConsoleMessage(consoleMessage->source(), consoleMessage->leve l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur l()); 226 client().reportConsoleMessage(consoleMessage->source(), consoleMessage->leve l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur l());
227 } 227 }
228 228
229 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes sage) 229 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes sage)
230 { 230 {
231 DCHECK(m_embeddedWorker); 231 DCHECK(m_embeddedWorker);
232 document().postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbe ddedWorkerImpl::postMessageToPageInspector, m_embeddedWorker, message)); 232 document().postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbe ddedWorkerImpl::postMessageToPageInspector, AllowCrossThreadAccess(m_embeddedWor ker), message));
233 } 233 }
234 234
235 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) 235 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success)
236 { 236 {
237 client().didEvaluateWorkerScript(success); 237 client().didEvaluateWorkerScript(success);
238 } 238 }
239 239
240 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() 240 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext()
241 { 241 {
242 ScriptState::Scope scope(workerGlobalScope()->scriptController()->getScriptS tate()); 242 ScriptState::Scope scope(workerGlobalScope()->scriptController()->getScriptS tate());
243 client().didInitializeWorkerContext(workerGlobalScope()->scriptController()- >context()); 243 client().didInitializeWorkerContext(workerGlobalScope()->scriptController()- >context());
244 } 244 }
245 245
246 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope) 246 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope)
247 { 247 {
248 DCHECK(!m_workerGlobalScope); 248 DCHECK(!m_workerGlobalScope);
249 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe); 249 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe);
250 client().workerContextStarted(this); 250 client().workerContextStarted(this);
251 } 251 }
252 252
253 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() 253 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed()
254 { 254 {
255 DCHECK(m_embeddedWorker); 255 DCHECK(m_embeddedWorker);
256 document().postTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbeddedWorke rImpl::terminateWorkerContext, m_embeddedWorker)); 256 document().postTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbeddedWorke rImpl::terminateWorkerContext, AllowCrossThreadAccess(m_embeddedWorker)));
257 } 257 }
258 258
259 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope() 259 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope()
260 { 260 {
261 v8::HandleScope handleScope(workerGlobalScope()->thread()->isolate()); 261 v8::HandleScope handleScope(workerGlobalScope()->thread()->isolate());
262 client().willDestroyWorkerContext(workerGlobalScope()->scriptController()->c ontext()); 262 client().willDestroyWorkerContext(workerGlobalScope()->scriptController()->c ontext());
263 m_workerGlobalScope = nullptr; 263 m_workerGlobalScope = nullptr;
264 } 264 }
265 265
266 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated() 266 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated()
(...skipping 29 matching lines...) Expand all
296 return *m_document; 296 return *m_document;
297 } 297 }
298 298
299 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st 299 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st
300 { 300 {
301 DCHECK(m_workerGlobalScope); 301 DCHECK(m_workerGlobalScope);
302 return m_workerGlobalScope; 302 return m_workerGlobalScope;
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698