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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 const char* DOMWindowQuota::supplementName() | 45 const char* DOMWindowQuota::supplementName() |
46 { | 46 { |
47 return "DOMWindowQuota"; | 47 return "DOMWindowQuota"; |
48 } | 48 } |
49 | 49 |
50 // static | 50 // static |
51 DOMWindowQuota& DOMWindowQuota::from(LocalDOMWindow& window) | 51 DOMWindowQuota& DOMWindowQuota::from(LocalDOMWindow& window) |
52 { | 52 { |
53 DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(HeapSupplement<Loc
alDOMWindow>::from(window, supplementName())); | 53 DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(Supplement<LocalDO
MWindow>::from(window, supplementName())); |
54 if (!supplement) { | 54 if (!supplement) { |
55 supplement = new DOMWindowQuota(window); | 55 supplement = new DOMWindowQuota(window); |
56 provideTo(window, supplementName(), supplement); | 56 provideTo(window, supplementName(), supplement); |
57 } | 57 } |
58 return *supplement; | 58 return *supplement; |
59 } | 59 } |
60 | 60 |
61 // static | 61 // static |
62 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo(DOMWindow& window) | 62 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo(DOMWindow& window) |
63 { | 63 { |
64 return DOMWindowQuota::from(toLocalDOMWindow(window)).webkitStorageInfo(); | 64 return DOMWindowQuota::from(toLocalDOMWindow(window)).webkitStorageInfo(); |
65 } | 65 } |
66 | 66 |
67 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo() const | 67 DeprecatedStorageInfo* DOMWindowQuota::webkitStorageInfo() const |
68 { | 68 { |
69 if (!m_storageInfo && frame()) | 69 if (!m_storageInfo && frame()) |
70 m_storageInfo = DeprecatedStorageInfo::create(); | 70 m_storageInfo = DeprecatedStorageInfo::create(); |
71 return m_storageInfo.get(); | 71 return m_storageInfo.get(); |
72 } | 72 } |
73 | 73 |
74 DEFINE_TRACE(DOMWindowQuota) | 74 DEFINE_TRACE(DOMWindowQuota) |
75 { | 75 { |
76 visitor->trace(m_storageInfo); | 76 visitor->trace(m_storageInfo); |
77 HeapSupplement<LocalDOMWindow>::trace(visitor); | 77 Supplement<LocalDOMWindow>::trace(visitor); |
78 DOMWindowProperty::trace(visitor); | 78 DOMWindowProperty::trace(visitor); |
79 } | 79 } |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
OLD | NEW |