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

Side by Side Diff: third_party/WebKit/Source/platform/exported/ServiceRegistry.cpp

Issue 2643063002: Refactor Blink's ServiceConnector and add ability to mock in layout tests (Closed)
Patch Set: Fix build Created 3 years, 9 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 "public/platform/Connector.h"
5 #include "public/platform/InterfaceProvider.h" 6 #include "public/platform/InterfaceProvider.h"
6 7
7 #include "wtf/StdLibExtras.h" 8 #include "wtf/StdLibExtras.h"
8 9
9 namespace blink { 10 namespace blink {
10 namespace { 11 namespace {
11 12
13 class EmptyConnector : public Connector {
14 void bindInterface(const char* serviceName,
15 const char* interfaceName,
16 mojo::ScopedMessagePipeHandle) override {}
17 };
18
12 class EmptyInterfaceProvider : public InterfaceProvider { 19 class EmptyInterfaceProvider : public InterfaceProvider {
13 void getInterface(const char* name, mojo::ScopedMessagePipeHandle) override {} 20 void getInterface(const char* name, mojo::ScopedMessagePipeHandle) override {}
14 }; 21 };
15 } 22 }
16 23
24 Connector* Connector::getEmptyConnector() {
25 DEFINE_STATIC_LOCAL(EmptyConnector, emptyConnector, ());
26 return &emptyConnector;
27 }
28
17 InterfaceProvider* InterfaceProvider::getEmptyInterfaceProvider() { 29 InterfaceProvider* InterfaceProvider::getEmptyInterfaceProvider() {
18 DEFINE_STATIC_LOCAL(EmptyInterfaceProvider, emptyInterfaceProvider, ()); 30 DEFINE_STATIC_LOCAL(EmptyInterfaceProvider, emptyInterfaceProvider, ());
19 return &emptyInterfaceProvider; 31 return &emptyInterfaceProvider;
20 } 32 }
21 } 33 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/exported/Platform.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698