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

Side by Side Diff: Source/modules/push_messaging/NavigatorPushManager.cpp

Issue 213013006: Define push_messaging module with PushManager skeleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More oilpan types. Created 6 years, 8 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 2014 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/push_messaging/NavigatorPushManager.h"
7
8 #include "core/dom/Document.h"
9 #include "core/frame/Navigator.h"
10 #include "modules/push_messaging/PushManager.h"
11
12 namespace WebCore {
13
14 NavigatorPushManager::NavigatorPushManager()
15 {
16 }
17
18 NavigatorPushManager::~NavigatorPushManager()
19 {
20 }
21
22 const char* NavigatorPushManager::supplementName()
23 {
24 return "NavigatorPushManager";
25 }
26
27 NavigatorPushManager& NavigatorPushManager::from(Navigator& navigator)
28 {
29 NavigatorPushManager* supplement = static_cast<NavigatorPushManager*>(WillBe HeapSupplement<Navigator>::from(navigator, supplementName()));
30 if (!supplement) {
31 supplement = new NavigatorPushManager();
32 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
33 }
34 return *supplement;
35 }
36
37 PushManager* NavigatorPushManager::push(Navigator& navigator)
38 {
39 return NavigatorPushManager::from(navigator).pushManager();
40 }
41
42 PushManager* NavigatorPushManager::pushManager()
43 {
44 if (!m_pushManager)
45 m_pushManager = PushManager::create();
46 return m_pushManager.get();
47 }
48
49 void NavigatorPushManager::trace(Visitor* visitor)
50 {
51 visitor->trace(m_pushManager);
52 }
53
54 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/push_messaging/NavigatorPushManager.h ('k') | Source/modules/push_messaging/NavigatorPushManager.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698