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

Side by Side Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… Created 3 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/child/service_worker/service_worker_dispatcher.h" 5 #include "content/child/service_worker/service_worker_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 870
871 ProviderClientMap::iterator found = 871 ProviderClientMap::iterator found =
872 provider_clients_.find(params.provider_id); 872 provider_clients_.find(params.provider_id);
873 if (found == provider_clients_.end()) { 873 if (found == provider_clients_.end()) {
874 // For now we do no queueing for messages sent to nonexistent / unattached 874 // For now we do no queueing for messages sent to nonexistent / unattached
875 // client. 875 // client.
876 return; 876 return;
877 } 877 }
878 878
879 blink::WebMessagePortChannelArray ports = 879 blink::WebMessagePortChannelArray ports =
880 WebMessagePortChannelImpl::CreatePorts( 880 WebMessagePortChannelImpl::CreateFromMessagePorts(params.message_ports);
881 params.message_ports, params.new_routing_ids,
882 base::ThreadTaskRunnerHandle::Get());
883 881
884 found->second->dispatchMessageEvent( 882 found->second->dispatchMessageEvent(
885 WebServiceWorkerImpl::CreateHandle(worker), 883 WebServiceWorkerImpl::CreateHandle(worker),
886 blink::WebString::fromUTF16(params.message), ports); 884 blink::WebString::fromUTF16(params.message), std::move(ports));
887 } 885 }
888 886
889 void ServiceWorkerDispatcher::OnCountFeature(int thread_id, 887 void ServiceWorkerDispatcher::OnCountFeature(int thread_id,
890 int provider_id, 888 int provider_id,
891 uint32_t feature) { 889 uint32_t feature) {
892 ProviderClientMap::iterator found = provider_clients_.find(provider_id); 890 ProviderClientMap::iterator found = provider_clients_.find(provider_id);
893 if (found != provider_clients_.end()) 891 if (found != provider_clients_.end())
894 found->second->countFeature(feature); 892 found->second->countFeature(feature);
895 } 893 }
896 894
(...skipping 27 matching lines...) Expand all
924 return ServiceWorkerRegistrationHandleReference::Adopt( 922 return ServiceWorkerRegistrationHandleReference::Adopt(
925 info, thread_safe_sender_.get()); 923 info, thread_safe_sender_.get());
926 } 924 }
927 925
928 std::unique_ptr<ServiceWorkerHandleReference> ServiceWorkerDispatcher::Adopt( 926 std::unique_ptr<ServiceWorkerHandleReference> ServiceWorkerDispatcher::Adopt(
929 const ServiceWorkerObjectInfo& info) { 927 const ServiceWorkerObjectInfo& info) {
930 return ServiceWorkerHandleReference::Adopt(info, thread_safe_sender_.get()); 928 return ServiceWorkerHandleReference::Adopt(info, thread_safe_sender_.get());
931 } 929 }
932 930
933 } // namespace content 931 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blob_storage/webblobregistry_impl.cc ('k') | content/child/service_worker/service_worker_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698