| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 met: | 5 * modification, are permitted provided that the following conditions are met: |
| 6 * | 6 * |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(LocalDOMWindow& window) | 35 DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(LocalDOMWindow& window) |
| 36 : DOMWindowProperty(window.frame()) | 36 : DOMWindowProperty(window.frame()) |
| 37 , m_window(&window) | 37 , m_window(&window) |
| 38 { | 38 { |
| 39 } | 39 } |
| 40 | 40 |
| 41 DEFINE_TRACE(DOMWindowIndexedDatabase) | 41 DEFINE_TRACE(DOMWindowIndexedDatabase) |
| 42 { | 42 { |
| 43 visitor->trace(m_window); | 43 visitor->trace(m_window); |
| 44 visitor->trace(m_idbFactory); | 44 visitor->trace(m_idbFactory); |
| 45 HeapSupplement<LocalDOMWindow>::trace(visitor); | 45 Supplement<LocalDOMWindow>::trace(visitor); |
| 46 DOMWindowProperty::trace(visitor); | 46 DOMWindowProperty::trace(visitor); |
| 47 } | 47 } |
| 48 | 48 |
| 49 const char* DOMWindowIndexedDatabase::supplementName() | 49 const char* DOMWindowIndexedDatabase::supplementName() |
| 50 { | 50 { |
| 51 return "DOMWindowIndexedDatabase"; | 51 return "DOMWindowIndexedDatabase"; |
| 52 } | 52 } |
| 53 | 53 |
| 54 DOMWindowIndexedDatabase& DOMWindowIndexedDatabase::from(LocalDOMWindow& window) | 54 DOMWindowIndexedDatabase& DOMWindowIndexedDatabase::from(LocalDOMWindow& window) |
| 55 { | 55 { |
| 56 DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*
>(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); | 56 DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*
>(Supplement<LocalDOMWindow>::from(window, supplementName())); |
| 57 if (!supplement) { | 57 if (!supplement) { |
| 58 supplement = new DOMWindowIndexedDatabase(window); | 58 supplement = new DOMWindowIndexedDatabase(window); |
| 59 provideTo(window, supplementName(), supplement); | 59 provideTo(window, supplementName(), supplement); |
| 60 } | 60 } |
| 61 return *supplement; | 61 return *supplement; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void DOMWindowIndexedDatabase::willDestroyGlobalObjectInFrame() | 64 void DOMWindowIndexedDatabase::willDestroyGlobalObjectInFrame() |
| 65 { | 65 { |
| 66 m_idbFactory = nullptr; | 66 m_idbFactory = nullptr; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 if (!m_window->isCurrentlyDisplayedInFrame()) | 91 if (!m_window->isCurrentlyDisplayedInFrame()) |
| 92 return nullptr; | 92 return nullptr; |
| 93 | 93 |
| 94 if (!m_idbFactory) | 94 if (!m_idbFactory) |
| 95 m_idbFactory = IDBFactory::create(IndexedDBClient::create()); | 95 m_idbFactory = IDBFactory::create(IndexedDBClient::create()); |
| 96 return m_idbFactory.get(); | 96 return m_idbFactory.get(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |