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

Side by Side Diff: Source/modules/navigatorconnect/NavigatorServices.cpp

Issue 1192913003: Start implementing new navigator.connect API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/navigatorconnect/NavigatorServices.h"
7
8 #include "core/frame/Navigator.h"
9 #include "modules/navigatorconnect/ServicePortCollection.h"
10
11 namespace blink {
12
13 NavigatorServices::NavigatorServices()
scheib 2015/06/23 03:57:21 Method definitions in the corresponding .cc file s
Marijn Kruisselbrink 2015/06/23 04:11:05 Done
14 {
15 }
16
17 NavigatorServices::~NavigatorServices()
18 {
19 }
20
21 const char* NavigatorServices::supplementName()
22 {
23 return "NavigatorServices";
24 }
25
26 NavigatorServices& NavigatorServices::from(Navigator& navigator)
27 {
28 NavigatorServices* supplement = static_cast<NavigatorServices*>(HeapSuppleme nt<Navigator>::from(navigator, supplementName()));
29 if (!supplement) {
30 supplement = new NavigatorServices();
31 provideTo(navigator, supplementName(), supplement);
32 }
33 return *supplement;
34 }
35
36 ServicePortCollection* NavigatorServices::services(ExecutionContext* context, Na vigator& navigator)
37 {
38 return NavigatorServices::from(navigator).services(context);
39 }
40
41 ServicePortCollection* NavigatorServices::services(ExecutionContext* context)
42 {
43 if (!m_services)
44 m_services = ServicePortCollection::create(context);
45 return m_services.get();
46 }
47
48 DEFINE_TRACE(NavigatorServices)
49 {
50 visitor->trace(m_services);
51 HeapSupplement<Navigator>::trace(visitor);
52 }
53
54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698