| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2009 Google Inc. All Rights Reserved. |
| 3 * (C) 2008 Apple Inc. | 3 * (C) 2008 Apple Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 | 137 |
| 138 bool StorageArea::canAccessStorage(LocalFrame* frame) | 138 bool StorageArea::canAccessStorage(LocalFrame* frame) |
| 139 { | 139 { |
| 140 if (!frame || !frame->page()) | 140 if (!frame || !frame->page()) |
| 141 return false; | 141 return false; |
| 142 | 142 |
| 143 // FrameDestructionObserver is used to safely keep the cached | 143 // FrameDestructionObserver is used to safely keep the cached |
| 144 // reference to the LocalFrame. Should the LocalFrame die before | 144 // reference to the LocalFrame. Should the LocalFrame die before |
| 145 // this StorageArea does, that cached reference will be cleared. | 145 // this StorageArea does, that cached reference will be cleared. |
| 146 if (m_frame == frame) | 146 if (this->frame() == frame) |
| 147 return m_canAccessStorageCachedResult; | 147 return m_canAccessStorageCachedResult; |
| 148 StorageNamespaceController* controller = StorageNamespaceController::from(fr
ame->page()); | 148 StorageNamespaceController* controller = StorageNamespaceController::from(fr
ame->page()); |
| 149 if (!controller) | 149 if (!controller) |
| 150 return false; | 150 return false; |
| 151 bool result = controller->storageClient()->canAccessStorage(frame, m_storage
Type); | 151 bool result = controller->storageClient()->canAccessStorage(frame, m_storage
Type); |
| 152 // Move attention to the new LocalFrame. | 152 // Move attention to the new LocalFrame. |
| 153 observeFrame(frame); | 153 observeFrame(frame); |
| 154 m_canAccessStorageCachedResult = result; | 154 m_canAccessStorageCachedResult = result; |
| 155 return result; | 155 return result; |
| 156 } | 156 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool StorageArea::isEventSource(Storage* storage, WebStorageArea* sourceAreaInst
ance) | 214 bool StorageArea::isEventSource(Storage* storage, WebStorageArea* sourceAreaInst
ance) |
| 215 { | 215 { |
| 216 ASSERT(storage); | 216 ASSERT(storage); |
| 217 StorageArea* area = storage->area(); | 217 StorageArea* area = storage->area(); |
| 218 return area->m_storageArea == sourceAreaInstance; | 218 return area->m_storageArea == sourceAreaInstance; |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace blink | 221 } // namespace blink |
| OLD | NEW |