OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "modules/credentialmanager/NavigatorCredentials.h" | 6 #include "modules/credentialmanager/NavigatorCredentials.h" |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
11 #include "core/frame/Navigator.h" | 11 #include "core/frame/Navigator.h" |
12 #include "modules/credentialmanager/CredentialsContainer.h" | 12 #include "modules/credentialmanager/CredentialsContainer.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 NavigatorCredentials::NavigatorCredentials(Navigator& navigator) | 16 NavigatorCredentials::NavigatorCredentials(Navigator& navigator) |
17 : DOMWindowProperty(navigator.frame()) | 17 : DOMWindowProperty(navigator.frame()) |
18 { | 18 { |
19 } | 19 } |
20 | 20 |
21 NavigatorCredentials::~NavigatorCredentials() | 21 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NavigatorCredentials); |
22 { | |
23 } | |
24 | 22 |
25 NavigatorCredentials& NavigatorCredentials::from(Navigator& navigator) | 23 NavigatorCredentials& NavigatorCredentials::from(Navigator& navigator) |
26 { | 24 { |
27 NavigatorCredentials* supplement = static_cast<NavigatorCredentials*>(WillBe
HeapSupplement<Navigator>::from(navigator, supplementName())); | 25 NavigatorCredentials* supplement = static_cast<NavigatorCredentials*>(WillBe
HeapSupplement<Navigator>::from(navigator, supplementName())); |
28 if (!supplement) { | 26 if (!supplement) { |
29 supplement = new NavigatorCredentials(navigator); | 27 supplement = new NavigatorCredentials(navigator); |
30 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); | 28 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); |
31 } | 29 } |
32 return *supplement; | 30 return *supplement; |
33 } | 31 } |
(...skipping 12 matching lines...) Expand all Loading... |
46 { | 44 { |
47 if (!m_credentialsContainer && frame()) | 45 if (!m_credentialsContainer && frame()) |
48 m_credentialsContainer = CredentialsContainer::create(); | 46 m_credentialsContainer = CredentialsContainer::create(); |
49 return m_credentialsContainer.get(); | 47 return m_credentialsContainer.get(); |
50 } | 48 } |
51 | 49 |
52 void NavigatorCredentials::trace(Visitor* visitor) | 50 void NavigatorCredentials::trace(Visitor* visitor) |
53 { | 51 { |
54 visitor->trace(m_credentialsContainer); | 52 visitor->trace(m_credentialsContainer); |
55 WillBeHeapSupplement<Navigator>::trace(visitor); | 53 WillBeHeapSupplement<Navigator>::trace(visitor); |
| 54 DOMWindowProperty::trace(visitor); |
56 } | 55 } |
57 | 56 |
58 } // namespace blink | 57 } // namespace blink |
OLD | NEW |