Chromium Code Reviews| Index: Source/modules/navigatorconnect/NavigatorServices.cpp |
| diff --git a/Source/modules/navigatorconnect/NavigatorServices.cpp b/Source/modules/navigatorconnect/NavigatorServices.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..528dc6565d117fbf1efc6322f88427dcdddddb3e |
| --- /dev/null |
| +++ b/Source/modules/navigatorconnect/NavigatorServices.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/NavigatorServices.h" |
| + |
| +#include "core/frame/Navigator.h" |
| +#include "modules/navigatorconnect/ServicePortCollection.h" |
| + |
| +namespace blink { |
| + |
| +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
|
| +{ |
| +} |
| + |
| +NavigatorServices::~NavigatorServices() |
| +{ |
| +} |
| + |
| +const char* NavigatorServices::supplementName() |
| +{ |
| + return "NavigatorServices"; |
| +} |
| + |
| +NavigatorServices& NavigatorServices::from(Navigator& navigator) |
| +{ |
| + NavigatorServices* supplement = static_cast<NavigatorServices*>(HeapSupplement<Navigator>::from(navigator, supplementName())); |
| + if (!supplement) { |
| + supplement = new NavigatorServices(); |
| + provideTo(navigator, supplementName(), supplement); |
| + } |
| + return *supplement; |
| +} |
| + |
| +ServicePortCollection* NavigatorServices::services(ExecutionContext* context, Navigator& navigator) |
| +{ |
| + return NavigatorServices::from(navigator).services(context); |
| +} |
| + |
| +ServicePortCollection* NavigatorServices::services(ExecutionContext* context) |
| +{ |
| + if (!m_services) |
| + m_services = ServicePortCollection::create(context); |
| + return m_services.get(); |
| +} |
| + |
| +DEFINE_TRACE(NavigatorServices) |
| +{ |
| + visitor->trace(m_services); |
| + HeapSupplement<Navigator>::trace(visitor); |
| +} |
| + |
| +} // namespace blink |