| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 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 15 matching lines...) Expand all Loading... |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "modules/storage/Storage.h" | 27 #include "modules/storage/Storage.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "wtf/PassOwnPtr.h" | 30 #include "wtf/PassOwnPtr.h" |
| 31 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
| 32 #include "wtf/text/WTFString.h" | 32 #include "wtf/text/WTFString.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 PassRefPtrWillBeRawPtr<Storage> Storage::create(LocalFrame* frame, PassOwnPtrWil
lBeRawPtr<StorageArea> storageArea) | 36 Storage* Storage::create(LocalFrame* frame, StorageArea* storageArea) |
| 37 { | 37 { |
| 38 return adoptRefWillBeNoop(new Storage(frame, storageArea)); | 38 return new Storage(frame, storageArea); |
| 39 } | 39 } |
| 40 | 40 |
| 41 Storage::Storage(LocalFrame* frame, PassOwnPtrWillBeRawPtr<StorageArea> storageA
rea) | 41 Storage::Storage(LocalFrame* frame, StorageArea* storageArea) |
| 42 : DOMWindowProperty(frame) | 42 : DOMWindowProperty(frame) |
| 43 , m_storageArea(storageArea) | 43 , m_storageArea(storageArea) |
| 44 { | 44 { |
| 45 ASSERT(m_frame); | 45 ASSERT(m_frame); |
| 46 ASSERT(m_storageArea); | 46 ASSERT(m_storageArea); |
| 47 } | 47 } |
| 48 | 48 |
| 49 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Storage); | 49 Storage::~Storage() |
| 50 { |
| 51 } |
| 50 | 52 |
| 51 String Storage::anonymousIndexedGetter(unsigned index, ExceptionState& exception
State) | 53 String Storage::anonymousIndexedGetter(unsigned index, ExceptionState& exception
State) |
| 52 { | 54 { |
| 53 return anonymousNamedGetter(AtomicString::number(index), exceptionState); | 55 return anonymousNamedGetter(AtomicString::number(index), exceptionState); |
| 54 } | 56 } |
| 55 | 57 |
| 56 String Storage::anonymousNamedGetter(const AtomicString& name, ExceptionState& e
xceptionState) | 58 String Storage::anonymousNamedGetter(const AtomicString& name, ExceptionState& e
xceptionState) |
| 57 { | 59 { |
| 58 bool found = contains(name, exceptionState); | 60 bool found = contains(name, exceptionState); |
| 59 if (exceptionState.hadException() || !found) | 61 if (exceptionState.hadException() || !found) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return false; | 123 return false; |
| 122 return true; | 124 return true; |
| 123 } | 125 } |
| 124 | 126 |
| 125 DEFINE_TRACE(Storage) | 127 DEFINE_TRACE(Storage) |
| 126 { | 128 { |
| 127 visitor->trace(m_storageArea); | 129 visitor->trace(m_storageArea); |
| 128 DOMWindowProperty::trace(visitor); | 130 DOMWindowProperty::trace(visitor); |
| 129 } | 131 } |
| 130 | 132 |
| 131 } | 133 } // namespace blink |
| OLD | NEW |