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

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

Issue 1110103003: Initial implementation of stashed message ports, content side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nicer dchecks Created 5 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 // 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 DCHECK(script_context_); 414 DCHECK(script_context_);
415 script_context_->SkipWaiting(callbacks); 415 script_context_->SkipWaiting(callbacks);
416 } 416 }
417 417
418 void EmbeddedWorkerContextClient::claim( 418 void EmbeddedWorkerContextClient::claim(
419 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { 419 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) {
420 DCHECK(script_context_); 420 DCHECK(script_context_);
421 script_context_->ClaimClients(callbacks); 421 script_context_->ClaimClients(callbacks);
422 } 422 }
423 423
424 void EmbeddedWorkerContextClient::stashMessagePort(
425 blink::WebMessagePortChannel* channel,
426 const blink::WebString& name) {
427 DCHECK(script_context_);
428 script_context_->StashMessagePort(channel, name);
429 }
430
424 void EmbeddedWorkerContextClient::OnMessageToWorker( 431 void EmbeddedWorkerContextClient::OnMessageToWorker(
425 int thread_id, 432 int thread_id,
426 int embedded_worker_id, 433 int embedded_worker_id,
427 const IPC::Message& message) { 434 const IPC::Message& message) {
428 if (!script_context_) 435 if (!script_context_)
429 return; 436 return;
430 DCHECK_EQ(embedded_worker_id_, embedded_worker_id); 437 DCHECK_EQ(embedded_worker_id_, embedded_worker_id);
431 script_context_->OnMessageReceived(message); 438 script_context_->OnMessageReceived(message);
432 } 439 }
433 440
(...skipping 30 matching lines...) Expand all
464 registration->SetWaiting( 471 registration->SetWaiting(
465 dispatcher->GetServiceWorker(attrs.waiting, false)); 472 dispatcher->GetServiceWorker(attrs.waiting, false));
466 registration->SetActive( 473 registration->SetActive(
467 dispatcher->GetServiceWorker(attrs.active, false)); 474 dispatcher->GetServiceWorker(attrs.active, false));
468 475
469 script_context_->SetRegistrationInServiceWorkerGlobalScope( 476 script_context_->SetRegistrationInServiceWorkerGlobalScope(
470 registration.Pass()); 477 registration.Pass());
471 } 478 }
472 479
473 } // namespace content 480 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698