Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: Source/modules/indexeddb/IDBVersionChangeEvent.cpp

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/indexeddb/IDBTransaction.cpp ('k') | Source/modules/mediasource/MediaSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 namespace blink { 31 namespace blink {
32 32
33 IDBVersionChangeEventInit::IDBVersionChangeEventInit() 33 IDBVersionChangeEventInit::IDBVersionChangeEventInit()
34 : oldVersion(0) 34 : oldVersion(0)
35 { 35 {
36 } 36 }
37 37
38 IDBVersionChangeEvent::IDBVersionChangeEvent() 38 IDBVersionChangeEvent::IDBVersionChangeEvent()
39 : m_dataLoss(WebIDBDataLossNone) 39 : m_dataLoss(WebIDBDataLossNone)
40 { 40 {
41 ScriptWrappable::init(this);
42 } 41 }
43 42
44 IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& eventType, unsi gned long long oldVersion, const Nullable<unsigned long long>& newVersion, WebID BDataLoss dataLoss, const String& dataLossMessage) 43 IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& eventType, unsi gned long long oldVersion, const Nullable<unsigned long long>& newVersion, WebID BDataLoss dataLoss, const String& dataLossMessage)
45 : Event(eventType, false /*canBubble*/, false /*cancelable*/) 44 : Event(eventType, false /*canBubble*/, false /*cancelable*/)
46 , m_oldVersion(oldVersion) 45 , m_oldVersion(oldVersion)
47 , m_newVersion(newVersion) 46 , m_newVersion(newVersion)
48 , m_dataLoss(dataLoss) 47 , m_dataLoss(dataLoss)
49 , m_dataLossMessage(dataLossMessage) 48 , m_dataLossMessage(dataLossMessage)
50 { 49 {
51 ScriptWrappable::init(this);
52 } 50 }
53 51
54 IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& eventType, cons t IDBVersionChangeEventInit& initializer) 52 IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& eventType, cons t IDBVersionChangeEventInit& initializer)
55 : Event(eventType, false /*canBubble*/, false /*cancelable*/) 53 : Event(eventType, false /*canBubble*/, false /*cancelable*/)
56 , m_oldVersion(initializer.oldVersion) 54 , m_oldVersion(initializer.oldVersion)
57 , m_newVersion(initializer.newVersion) 55 , m_newVersion(initializer.newVersion)
58 , m_dataLoss(WebIDBDataLossNone) 56 , m_dataLoss(WebIDBDataLossNone)
59 { 57 {
60 if (initializer.dataLoss.isEmpty() || initializer.dataLoss == "none") 58 if (initializer.dataLoss.isEmpty() || initializer.dataLoss == "none")
61 m_dataLoss = WebIDBDataLossNone; 59 m_dataLoss = WebIDBDataLossNone;
62 else if (initializer.dataLoss == "total") 60 else if (initializer.dataLoss == "total")
63 m_dataLoss = WebIDBDataLossTotal; 61 m_dataLoss = WebIDBDataLossTotal;
64 ScriptWrappable::init(this);
65 } 62 }
66 63
67 unsigned long long IDBVersionChangeEvent::newVersion(bool& isNull) const 64 unsigned long long IDBVersionChangeEvent::newVersion(bool& isNull) const
68 { 65 {
69 isNull = m_newVersion.isNull(); 66 isNull = m_newVersion.isNull();
70 return isNull ? 0 : m_newVersion.get(); 67 return isNull ? 0 : m_newVersion.get();
71 } 68 }
72 69
73 const AtomicString& IDBVersionChangeEvent::dataLoss() const 70 const AtomicString& IDBVersionChangeEvent::dataLoss() const
74 { 71 {
75 if (m_dataLoss == WebIDBDataLossTotal) 72 if (m_dataLoss == WebIDBDataLossTotal)
76 return IndexedDBNames::total; 73 return IndexedDBNames::total;
77 return IndexedDBNames::none; 74 return IndexedDBNames::none;
78 } 75 }
79 76
80 const AtomicString& IDBVersionChangeEvent::interfaceName() const 77 const AtomicString& IDBVersionChangeEvent::interfaceName() const
81 { 78 {
82 return EventNames::IDBVersionChangeEvent; 79 return EventNames::IDBVersionChangeEvent;
83 } 80 }
84 81
85 void IDBVersionChangeEvent::trace(Visitor* visitor) 82 void IDBVersionChangeEvent::trace(Visitor* visitor)
86 { 83 {
87 Event::trace(visitor); 84 Event::trace(visitor);
88 } 85 }
89 86
90 } // namespace blink 87 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBTransaction.cpp ('k') | Source/modules/mediasource/MediaSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698