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

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

Issue 871853002: ServiceWorker: add ServiceWorkerClients.claim() support (2/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove assignment within conditional expression Created 5 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
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_context_client.h" 5 #include "content/renderer/service_worker/embedded_worker_context_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 DCHECK(script_context_); 385 DCHECK(script_context_);
386 script_context_->FocusClient(client_id, callback); 386 script_context_->FocusClient(client_id, callback);
387 } 387 }
388 388
389 void EmbeddedWorkerContextClient::skipWaiting( 389 void EmbeddedWorkerContextClient::skipWaiting(
390 blink::WebServiceWorkerSkipWaitingCallbacks* callbacks) { 390 blink::WebServiceWorkerSkipWaitingCallbacks* callbacks) {
391 DCHECK(script_context_); 391 DCHECK(script_context_);
392 script_context_->SkipWaiting(callbacks); 392 script_context_->SkipWaiting(callbacks);
393 } 393 }
394 394
395 void EmbeddedWorkerContextClient::claim(
396 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) {
397 DCHECK(script_context_);
398 script_context_->ClaimClients(callbacks);
399 }
400
395 void EmbeddedWorkerContextClient::OnMessageToWorker( 401 void EmbeddedWorkerContextClient::OnMessageToWorker(
396 int thread_id, 402 int thread_id,
397 int embedded_worker_id, 403 int embedded_worker_id,
398 const IPC::Message& message) { 404 const IPC::Message& message) {
399 if (!script_context_) 405 if (!script_context_)
400 return; 406 return;
401 DCHECK_EQ(embedded_worker_id_, embedded_worker_id); 407 DCHECK_EQ(embedded_worker_id_, embedded_worker_id);
402 script_context_->OnMessageReceived(message); 408 script_context_->OnMessageReceived(message);
403 } 409 }
404 410
(...skipping 30 matching lines...) Expand all
435 registration->SetWaiting( 441 registration->SetWaiting(
436 dispatcher->GetServiceWorker(attrs.waiting, false)); 442 dispatcher->GetServiceWorker(attrs.waiting, false));
437 registration->SetActive( 443 registration->SetActive(
438 dispatcher->GetServiceWorker(attrs.active, false)); 444 dispatcher->GetServiceWorker(attrs.active, false));
439 445
440 script_context_->SetRegistrationInServiceWorkerGlobalScope( 446 script_context_->SetRegistrationInServiceWorkerGlobalScope(
441 registration.Pass()); 447 registration.Pass());
442 } 448 }
443 449
444 } // namespace content 450 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698