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

Side by Side Diff: content/renderer/mojo/blink_service_registry_impl.cc

Issue 1995663003: Revert of Introduce the Blink NotificationService, move permission checks there (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/mojo/blink_service_registry_impl.h" 5 #include "content/renderer/mojo/blink_service_registry_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h"
11 #include "content/common/mojo/service_registry_impl.h" 9 #include "content/common/mojo/service_registry_impl.h"
12 10
13 namespace content { 11 namespace content {
14 12
15 BlinkServiceRegistryImpl::BlinkServiceRegistryImpl( 13 BlinkServiceRegistryImpl::BlinkServiceRegistryImpl(
16 base::WeakPtr<content::ServiceRegistry> service_registry) 14 base::WeakPtr<content::ServiceRegistry> service_registry)
17 : service_registry_(service_registry), 15 : service_registry_(service_registry) {}
18 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
19 weak_ptr_factory_(this) {}
20 16
21 BlinkServiceRegistryImpl::~BlinkServiceRegistryImpl() = default; 17 BlinkServiceRegistryImpl::~BlinkServiceRegistryImpl() = default;
22 18
23 void BlinkServiceRegistryImpl::connectToRemoteService( 19 void BlinkServiceRegistryImpl::connectToRemoteService(
24 const char* name, 20 const char* name,
25 mojo::ScopedMessagePipeHandle handle) { 21 mojo::ScopedMessagePipeHandle handle) {
26 if (!main_thread_task_runner_->BelongsToCurrentThread()) {
27 main_thread_task_runner_->PostTask(
28 FROM_HERE, base::Bind(&BlinkServiceRegistryImpl::connectToRemoteService,
29 weak_ptr_factory_.GetWeakPtr(), name,
30 base::Passed(&handle)));
31 return;
32 }
33
34 if (!service_registry_) 22 if (!service_registry_)
35 return; 23 return;
36 24
37 service_registry_->ConnectToRemoteService(name, std::move(handle)); 25 service_registry_->ConnectToRemoteService(name, std::move(handle));
38 } 26 }
39 27
40 } // namespace content 28 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mojo/blink_service_registry_impl.h ('k') | third_party/WebKit/Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698