| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 WorkerGlobalScopeCrypto::WorkerGlobalScopeCrypto() | 38 WorkerGlobalScopeCrypto::WorkerGlobalScopeCrypto() |
| 39 { | 39 { |
| 40 } | 40 } |
| 41 | 41 |
| 42 const char* WorkerGlobalScopeCrypto::supplementName() | 42 const char* WorkerGlobalScopeCrypto::supplementName() |
| 43 { | 43 { |
| 44 return "WorkerGlobalScopeCrypto"; | 44 return "WorkerGlobalScopeCrypto"; |
| 45 } | 45 } |
| 46 | 46 |
| 47 WorkerGlobalScopeCrypto& WorkerGlobalScopeCrypto::from(HeapSupplementable<Worker
GlobalScope>& context) | 47 WorkerGlobalScopeCrypto& WorkerGlobalScopeCrypto::from(Supplementable<WorkerGlob
alScope>& context) |
| 48 { | 48 { |
| 49 WorkerGlobalScopeCrypto* supplement = static_cast<WorkerGlobalScopeCrypto*>(
HeapSupplement<WorkerGlobalScope>::from(context, supplementName())); | 49 WorkerGlobalScopeCrypto* supplement = static_cast<WorkerGlobalScopeCrypto*>(
Supplement<WorkerGlobalScope>::from(context, supplementName())); |
| 50 if (!supplement) { | 50 if (!supplement) { |
| 51 supplement = new WorkerGlobalScopeCrypto(); | 51 supplement = new WorkerGlobalScopeCrypto; |
| 52 provideTo(context, supplementName(), adoptPtrWillBeNoop(supplement)); | 52 provideTo(context, supplementName(), supplement); |
| 53 } | 53 } |
| 54 return *supplement; | 54 return *supplement; |
| 55 } | 55 } |
| 56 | 56 |
| 57 Crypto* WorkerGlobalScopeCrypto::crypto(HeapSupplementable<WorkerGlobalScope>& c
ontext) | 57 Crypto* WorkerGlobalScopeCrypto::crypto(Supplementable<WorkerGlobalScope>& conte
xt) |
| 58 { | 58 { |
| 59 return WorkerGlobalScopeCrypto::from(context).crypto(); | 59 return WorkerGlobalScopeCrypto::from(context).crypto(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 Crypto* WorkerGlobalScopeCrypto::crypto() const | 62 Crypto* WorkerGlobalScopeCrypto::crypto() const |
| 63 { | 63 { |
| 64 if (!m_crypto) | 64 if (!m_crypto) |
| 65 m_crypto = Crypto::create(); | 65 m_crypto = Crypto::create(); |
| 66 return m_crypto.get(); | 66 return m_crypto.get(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 DEFINE_TRACE(WorkerGlobalScopeCrypto) | 69 DEFINE_TRACE(WorkerGlobalScopeCrypto) |
| 70 { | 70 { |
| 71 visitor->trace(m_crypto); | 71 visitor->trace(m_crypto); |
| 72 HeapSupplement<WorkerGlobalScope>::trace(visitor); | 72 Supplement<WorkerGlobalScope>::trace(visitor); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |