Chromium Code Reviews| OLD | NEW |
|---|---|
| (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() | |
|
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 WorkerNavigatorServices::~WorkerNavigatorServices() | |
| 18 { | |
| 19 } | |
| 20 | |
| 21 const char* WorkerNavigatorServices::supplementName() | |
| 22 { | |
| 23 return "WorkerNavigatorServices"; | |
| 24 } | |
| 25 | |
| 26 WorkerNavigatorServices& WorkerNavigatorServices::from(WorkerNavigator& navigato r) | |
| 27 { | |
| 28 WorkerNavigatorServices* supplement = static_cast<WorkerNavigatorServices*>( HeapSupplement<WorkerNavigator>::from(navigator, supplementName())); | |
| 29 if (!supplement) { | |
| 30 supplement = new WorkerNavigatorServices(); | |
| 31 provideTo(navigator, supplementName(), supplement); | |
| 32 } | |
| 33 return *supplement; | |
| 34 } | |
| 35 | |
| 36 ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* conte xt, WorkerNavigator& navigator) | |
| 37 { | |
| 38 return WorkerNavigatorServices::from(navigator).services(context); | |
| 39 } | |
| 40 | |
| 41 ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* conte xt) | |
| 42 { | |
| 43 if (!m_services) | |
| 44 m_services = ServicePortCollection::create(context); | |
| 45 return m_services.get(); | |
| 46 } | |
| 47 | |
| 48 DEFINE_TRACE(WorkerNavigatorServices) | |
| 49 { | |
| 50 visitor->trace(m_services); | |
| 51 HeapSupplement<WorkerNavigator>::trace(visitor); | |
| 52 } | |
| 53 | |
| 54 } // namespace blink | |
| OLD | NEW |