Chromium Code Reviews| Index: Source/modules/navigatorconnect/WorkerNavigatorServices.cpp |
| diff --git a/Source/modules/navigatorconnect/WorkerNavigatorServices.cpp b/Source/modules/navigatorconnect/WorkerNavigatorServices.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3d359a6fe0dce4467f39fd09b0399959c4abf51a |
| --- /dev/null |
| +++ b/Source/modules/navigatorconnect/WorkerNavigatorServices.cpp |
| @@ -0,0 +1,54 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "config.h" |
| +#include "modules/navigatorconnect/WorkerNavigatorServices.h" |
| + |
| +#include "core/workers/WorkerNavigator.h" |
| +#include "modules/navigatorconnect/ServicePortCollection.h" |
| + |
| +namespace blink { |
| + |
| +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
|
| +{ |
| +} |
| + |
| +WorkerNavigatorServices::~WorkerNavigatorServices() |
| +{ |
| +} |
| + |
| +const char* WorkerNavigatorServices::supplementName() |
| +{ |
| + return "WorkerNavigatorServices"; |
| +} |
| + |
| +WorkerNavigatorServices& WorkerNavigatorServices::from(WorkerNavigator& navigator) |
| +{ |
| + WorkerNavigatorServices* supplement = static_cast<WorkerNavigatorServices*>(HeapSupplement<WorkerNavigator>::from(navigator, supplementName())); |
| + if (!supplement) { |
| + supplement = new WorkerNavigatorServices(); |
| + provideTo(navigator, supplementName(), supplement); |
| + } |
| + return *supplement; |
| +} |
| + |
| +ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* context, WorkerNavigator& navigator) |
| +{ |
| + return WorkerNavigatorServices::from(navigator).services(context); |
| +} |
| + |
| +ServicePortCollection* WorkerNavigatorServices::services(ExecutionContext* context) |
| +{ |
| + if (!m_services) |
| + m_services = ServicePortCollection::create(context); |
| + return m_services.get(); |
| +} |
| + |
| +DEFINE_TRACE(WorkerNavigatorServices) |
| +{ |
| + visitor->trace(m_services); |
| + HeapSupplement<WorkerNavigator>::trace(visitor); |
| +} |
| + |
| +} // namespace blink |