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

Side by Side Diff: Source/modules/navigatorconnect/WorkerNavigatorServices.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/WorkerNavigatorServices.h"
7
8 #include "core/workers/WorkerNavigator.h"
9 #include "modules/navigatorconnect/ServicePortCollection.h"
10
11 namespace blink {
12
13 WorkerNavigatorServices::~WorkerNavigatorServices()
14 {
15 }
16
17 WorkerNavigatorServices& WorkerNavigatorServices::from(WorkerNavigator& navigato r)
18 {
19 WorkerNavigatorServices* supplement = static_cast<WorkerNavigatorServices*>( HeapSupplement<WorkerNavigator>::from(navigator, supplementName()));
20 if (!supplement) {
21 supplement = new WorkerNavigatorServices();
22 provideTo(navigator, supplementName(), supplement);
23 }
24 return *supplement;
25 }
26
27 ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* conte xt, WorkerNavigator& navigator)
28 {
29 return WorkerNavigatorServices::from(navigator).services(context);
30 }
31
32 ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* conte xt)
33 {
34 if (!m_services)
35 m_services = ServicePortCollection::create(context);
36 return m_services.get();
37 }
38
39 DEFINE_TRACE(WorkerNavigatorServices)
40 {
41 visitor->trace(m_services);
42 HeapSupplement<WorkerNavigator>::trace(visitor);
43 }
44
45 WorkerNavigatorServices::WorkerNavigatorServices()
46 {
47 }
48
49 const char* WorkerNavigatorServices::supplementName()
50 {
51 return "WorkerNavigatorServices";
52 }
53
54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698