| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 24 matching lines...) Expand all Loading... |
| 35 #include "modules/quota/DeprecatedStorageInfo.h" | 35 #include "modules/quota/DeprecatedStorageInfo.h" |
| 36 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 DOMWindowQuota::DOMWindowQuota(LocalDOMWindow& window) | 40 DOMWindowQuota::DOMWindowQuota(LocalDOMWindow& window) |
| 41 : DOMWindowProperty(window.frame()) | 41 : DOMWindowProperty(window.frame()) |
| 42 { | 42 { |
| 43 } | 43 } |
| 44 | 44 |
| 45 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowQuota); | |
| 46 | |
| 47 const char* DOMWindowQuota::supplementName() | 45 const char* DOMWindowQuota::supplementName() |
| 48 { | 46 { |
| 49 return "DOMWindowQuota"; | 47 return "DOMWindowQuota"; |
| 50 } | 48 } |
| 51 | 49 |
| 52 // static | 50 // static |
| 53 DOMWindowQuota& DOMWindowQuota::from(LocalDOMWindow& window) | 51 DOMWindowQuota& DOMWindowQuota::from(LocalDOMWindow& window) |
| 54 { | 52 { |
| 55 DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(WillBeHeapSuppleme
nt<LocalDOMWindow>::from(window, supplementName())); | 53 DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(HeapSupplement<Loc
alDOMWindow>::from(window, supplementName())); |
| 56 if (!supplement) { | 54 if (!supplement) { |
| 57 supplement = new DOMWindowQuota(window); | 55 supplement = new DOMWindowQuota(window); |
| 58 provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement)); | 56 provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement)); |
| 59 } | 57 } |
| 60 return *supplement; | 58 return *supplement; |
| 61 } | 59 } |
| 62 | 60 |
| 63 // static | 61 // static |
| 64 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo(DOMWindow& window) | 62 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo(DOMWindow& window) |
| 65 { | 63 { |
| 66 return DOMWindowQuota::from(toLocalDOMWindow(window)).webkitStorageInfo(); | 64 return DOMWindowQuota::from(toLocalDOMWindow(window)).webkitStorageInfo(); |
| 67 } | 65 } |
| 68 | 66 |
| 69 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo() const | 67 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo() const |
| 70 { | 68 { |
| 71 if (!m_storageInfo && frame()) | 69 if (!m_storageInfo && frame()) |
| 72 m_storageInfo = DeprecatedStorageInfo::create(); | 70 m_storageInfo = DeprecatedStorageInfo::create(); |
| 73 return m_storageInfo.get(); | 71 return m_storageInfo.get(); |
| 74 } | 72 } |
| 75 | 73 |
| 76 DEFINE_TRACE(DOMWindowQuota) | 74 DEFINE_TRACE(DOMWindowQuota) |
| 77 { | 75 { |
| 78 visitor->trace(m_storageInfo); | 76 visitor->trace(m_storageInfo); |
| 79 WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); | 77 HeapSupplement<LocalDOMWindow>::trace(visitor); |
| 80 DOMWindowProperty::trace(visitor); | 78 DOMWindowProperty::trace(visitor); |
| 81 } | 79 } |
| 82 | 80 |
| 83 } // namespace blink | 81 } // namespace blink |
| OLD | NEW |