OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 const char* DOMWindowCrypto::supplementName() | 48 const char* DOMWindowCrypto::supplementName() |
49 { | 49 { |
50 return "DOMWindowCrypto"; | 50 return "DOMWindowCrypto"; |
51 } | 51 } |
52 | 52 |
53 DOMWindowCrypto& DOMWindowCrypto::from(DOMWindow& window) | 53 DOMWindowCrypto& DOMWindowCrypto::from(DOMWindow& window) |
54 { | 54 { |
55 DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(Supplement<DOMWi
ndow>::from(window, supplementName())); | 55 DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(WillBeHeapSupple
ment<DOMWindow>::from(window, supplementName())); |
56 if (!supplement) { | 56 if (!supplement) { |
57 supplement = new DOMWindowCrypto(window); | 57 supplement = new DOMWindowCrypto(window); |
58 provideTo(window, supplementName(), adoptPtr(supplement)); | 58 provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement)); |
59 } | 59 } |
60 return *supplement; | 60 return *supplement; |
61 } | 61 } |
62 | 62 |
63 Crypto* DOMWindowCrypto::crypto(DOMWindow& window) | 63 Crypto* DOMWindowCrypto::crypto(DOMWindow& window) |
64 { | 64 { |
65 return DOMWindowCrypto::from(window).crypto(); | 65 return DOMWindowCrypto::from(window).crypto(); |
66 } | 66 } |
67 | 67 |
68 Crypto* DOMWindowCrypto::crypto() const | 68 Crypto* DOMWindowCrypto::crypto() const |
69 { | 69 { |
70 if (!m_crypto && frame()) | 70 if (!m_crypto && frame()) |
71 m_crypto = Crypto::create(); | 71 m_crypto = Crypto::create(); |
72 return m_crypto.get(); | 72 return m_crypto.get(); |
73 } | 73 } |
74 | 74 |
| 75 void DOMWindowCrypto::trace(Visitor* visitor) |
| 76 { |
| 77 visitor->trace(m_crypto); |
| 78 } |
| 79 |
75 } // namespace WebCore | 80 } // namespace WebCore |
OLD | NEW |