Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 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 13 matching lines...) Expand all Loading... | |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "modules/indexeddb/IDBVersionChangeEvent.h" | 27 #include "modules/indexeddb/IDBVersionChangeEvent.h" |
| 28 | 28 |
| 29 #include "core/dom/EventNames.h" | 29 #include "core/dom/EventNames.h" |
| 30 #include "modules/indexeddb/IDBAny.h" | 30 #include "modules/indexeddb/IDBAny.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 PassRefPtr<IDBVersionChangeEvent> IDBVersionChangeEvent::create(PassRefPtr<IDBAn y> oldVersion, PassRefPtr<IDBAny> newVersion, const AtomicString& eventType) | 34 PassRefPtr<IDBVersionChangeEvent> IDBVersionChangeEvent::create(PassRefPtr<IDBAn y> oldVersion, PassRefPtr<IDBAny> newVersion, const AtomicString& eventType, boo l dataLoss) |
| 35 { | 35 { |
| 36 return adoptRef(new IDBVersionChangeEvent(oldVersion, newVersion, eventType) ); | 36 return adoptRef(new IDBVersionChangeEvent(oldVersion, newVersion, eventType, dataLoss)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 IDBVersionChangeEvent::IDBVersionChangeEvent(PassRefPtr<IDBAny> oldVersion, Pass RefPtr<IDBAny> newVersion, const AtomicString& eventType) | 39 IDBVersionChangeEvent::IDBVersionChangeEvent(PassRefPtr<IDBAny> oldVersion, Pass RefPtr<IDBAny> newVersion, const AtomicString& eventType, bool dataLoss) |
| 40 : Event(eventType, false /*canBubble*/, false /*cancelable*/) | 40 : Event(eventType, false /*canBubble*/, false /*cancelable*/) |
| 41 , m_oldVersion(oldVersion) | 41 , m_oldVersion(oldVersion) |
| 42 , m_newVersion(newVersion) | 42 , m_newVersion(newVersion) |
| 43 , m_dataLoss(dataLoss) | |
| 43 { | 44 { |
| 44 ScriptWrappable::init(this); | 45 ScriptWrappable::init(this); |
| 45 } | 46 } |
| 46 | 47 |
| 47 IDBVersionChangeEvent::~IDBVersionChangeEvent() | 48 IDBVersionChangeEvent::~IDBVersionChangeEvent() |
| 48 { | 49 { |
| 49 } | 50 } |
| 50 | 51 |
| 52 String IDBVersionChangeEvent::dataLoss() | |
| 53 { | |
| 54 if (m_dataLoss) | |
| 55 return "total"; | |
|
jsbell
2013/06/14 20:44:04
Should these be atomic strings, like the IDBCursor
dgrogan
2013/06/14 22:41:14
Probably, but I'm just cargo culting. Changed.
| |
| 56 return "none"; | |
| 57 } | |
| 58 | |
| 51 const AtomicString& IDBVersionChangeEvent::interfaceName() const | 59 const AtomicString& IDBVersionChangeEvent::interfaceName() const |
| 52 { | 60 { |
| 53 return eventNames().interfaceForIDBVersionChangeEvent; | 61 return eventNames().interfaceForIDBVersionChangeEvent; |
| 54 } | 62 } |
| 55 | 63 |
| 56 } // namespace WebCore | 64 } // namespace WebCore |
| OLD | NEW |