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

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: override instead of virtual 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()
14 {
15 }
16
17 NavigatorServices& NavigatorServices::from(Navigator& navigator)
18 {
19 NavigatorServices* supplement = static_cast<NavigatorServices*>(HeapSuppleme nt<Navigator>::from(navigator, supplementName()));
20 if (!supplement) {
21 supplement = new NavigatorServices();
22 provideTo(navigator, supplementName(), supplement);
23 }
24 return *supplement;
25 }
26
27 ServicePortCollection* NavigatorServices::services(ExecutionContext* context, Na vigator& navigator)
28 {
29 return NavigatorServices::from(navigator).services(context);
30 }
31
32 ServicePortCollection* NavigatorServices::services(ExecutionContext* context)
33 {
34 if (!m_services)
35 m_services = ServicePortCollection::create(context);
36 return m_services.get();
37 }
38
39 DEFINE_TRACE(NavigatorServices)
40 {
41 visitor->trace(m_services);
42 HeapSupplement<Navigator>::trace(visitor);
43 }
44
45 NavigatorServices::NavigatorServices()
46 {
47 }
48
49 const char* NavigatorServices::supplementName()
50 {
51 return "NavigatorServices";
52 }
53
54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698