| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ASSERT(m_frontend); | 93 ASSERT(m_frontend); |
| 94 if (!m_reportingChangesToFrontend) { | 94 if (!m_reportingChangesToFrontend) { |
| 95 m_frame->domWindow()->addEventListener(eventNames().storageEvent, this,
true); | 95 m_frame->domWindow()->addEventListener(eventNames().storageEvent, this,
true); |
| 96 m_reportingChangesToFrontend = true; | 96 m_reportingChangesToFrontend = true; |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 void InspectorDOMStorageResource::handleEvent(ScriptExecutionContext*, Event* ev
ent) | 100 void InspectorDOMStorageResource::handleEvent(ScriptExecutionContext*, Event* ev
ent) |
| 101 { | 101 { |
| 102 ASSERT(m_frontend); | 102 ASSERT(m_frontend); |
| 103 ASSERT(eventNames().storageEvent == event->type()); | 103 if (event->type() != eventNames().storageEvent || !event->isStorageEvent()) |
| 104 return; |
| 105 |
| 104 StorageEvent* storageEvent = static_cast<StorageEvent*>(event); | 106 StorageEvent* storageEvent = static_cast<StorageEvent*>(event); |
| 105 Storage* storage = storageEvent->storageArea(); | 107 Storage* storage = storageEvent->storageArea(); |
| 106 ExceptionCode ec = 0; | 108 ExceptionCode ec = 0; |
| 107 bool isLocalStorage = (storage->frame()->domWindow()->localStorage(ec) == st
orage && !ec); | 109 bool isLocalStorage = (storage->frame()->domWindow()->localStorage(ec) == st
orage && !ec); |
| 108 if (isSameHostAndType(storage->frame(), isLocalStorage)) | 110 if (isSameHostAndType(storage->frame(), isLocalStorage)) |
| 109 m_frontend->updateDOMStorage(m_id); | 111 m_frontend->updateDOMStorage(m_id); |
| 110 } | 112 } |
| 111 | 113 |
| 112 bool InspectorDOMStorageResource::operator==(const EventListener& listener) | 114 bool InspectorDOMStorageResource::operator==(const EventListener& listener) |
| 113 { | 115 { |
| 114 return (this == InspectorDOMStorageResource::cast(&listener)); | 116 return (this == InspectorDOMStorageResource::cast(&listener)); |
| 115 } | 117 } |
| 116 | 118 |
| 117 } // namespace WebCore | 119 } // namespace WebCore |
| 118 | 120 |
| 119 #endif // ENABLE(DOM_STORAGE) && ENABLE(INSPECTOR) | 121 #endif // ENABLE(DOM_STORAGE) && ENABLE(INSPECTOR) |
| 120 | 122 |
| OLD | NEW |