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

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

Issue 1970003004: Worker: Move close() from WorkerGlobalScope to derived interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add const 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
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl ('k') | 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 /* 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope) 238 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope)
239 { 239 {
240 DCHECK(!m_workerGlobalScope); 240 DCHECK(!m_workerGlobalScope);
241 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe); 241 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe);
242 client().workerContextStarted(this); 242 client().workerContextStarted(this);
243 } 243 }
244 244
245 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() 245 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed()
246 { 246 {
247 DCHECK(m_embeddedWorker); 247 // This should never be called because close() is not defined in
248 document().postTask(BLINK_FROM_HERE, createCrossThreadTask(&WebEmbeddedWorke rImpl::terminateWorkerContext, AllowCrossThreadAccess(m_embeddedWorker))); 248 // ServiceWorkerGlobalScope.
249 NOTREACHED();
249 } 250 }
250 251
251 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope() 252 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope()
252 { 253 {
253 v8::HandleScope handleScope(workerGlobalScope()->thread()->isolate()); 254 v8::HandleScope handleScope(workerGlobalScope()->thread()->isolate());
254 client().willDestroyWorkerContext(workerGlobalScope()->scriptController()->c ontext()); 255 client().willDestroyWorkerContext(workerGlobalScope()->scriptController()->c ontext());
255 m_workerGlobalScope = nullptr; 256 m_workerGlobalScope = nullptr;
256 } 257 }
257 258
258 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated() 259 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated()
(...skipping 29 matching lines...) Expand all
288 return *m_document; 289 return *m_document;
289 } 290 }
290 291
291 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st 292 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st
292 { 293 {
293 DCHECK(m_workerGlobalScope); 294 DCHECK(m_workerGlobalScope);
294 return m_workerGlobalScope; 295 return m_workerGlobalScope;
295 } 296 }
296 297
297 } // namespace blink 298 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698