| 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 29 matching lines...) Expand all Loading... |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 const char* DOMWindowCrypto::supplementName() | 43 const char* DOMWindowCrypto::supplementName() |
| 44 { | 44 { |
| 45 return "DOMWindowCrypto"; | 45 return "DOMWindowCrypto"; |
| 46 } | 46 } |
| 47 | 47 |
| 48 DOMWindowCrypto& DOMWindowCrypto::from(LocalDOMWindow& window) | 48 DOMWindowCrypto& DOMWindowCrypto::from(LocalDOMWindow& window) |
| 49 { | 49 { |
| 50 DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(HeapSupplement<L
ocalDOMWindow>::from(window, supplementName())); | 50 DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(Supplement<Local
DOMWindow>::from(window, supplementName())); |
| 51 if (!supplement) { | 51 if (!supplement) { |
| 52 supplement = new DOMWindowCrypto(window); | 52 supplement = new DOMWindowCrypto(window); |
| 53 provideTo(window, supplementName(), supplement); | 53 provideTo(window, supplementName(), supplement); |
| 54 } | 54 } |
| 55 return *supplement; | 55 return *supplement; |
| 56 } | 56 } |
| 57 | 57 |
| 58 Crypto* DOMWindowCrypto::crypto(DOMWindow& window) | 58 Crypto* DOMWindowCrypto::crypto(DOMWindow& window) |
| 59 { | 59 { |
| 60 return DOMWindowCrypto::from(toLocalDOMWindow(window)).crypto(); | 60 return DOMWindowCrypto::from(toLocalDOMWindow(window)).crypto(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 Crypto* DOMWindowCrypto::crypto() const | 63 Crypto* DOMWindowCrypto::crypto() const |
| 64 { | 64 { |
| 65 if (!m_crypto && frame()) | 65 if (!m_crypto && frame()) |
| 66 m_crypto = Crypto::create(); | 66 m_crypto = Crypto::create(); |
| 67 return m_crypto.get(); | 67 return m_crypto.get(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 DEFINE_TRACE(DOMWindowCrypto) | 70 DEFINE_TRACE(DOMWindowCrypto) |
| 71 { | 71 { |
| 72 visitor->trace(m_crypto); | 72 visitor->trace(m_crypto); |
| 73 HeapSupplement<LocalDOMWindow>::trace(visitor); | 73 Supplement<LocalDOMWindow>::trace(visitor); |
| 74 DOMWindowProperty::trace(visitor); | 74 DOMWindowProperty::trace(visitor); |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |