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

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

Issue 386883008: Converted IDBVersionChangeEvent.dataLoss to an enumeration: IDBDataLossAmount (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added link to W3C's IDL spec Created 6 years, 5 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
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 25 matching lines...) Expand all
36 #include "wtf/RefPtr.h" 36 #include "wtf/RefPtr.h"
37 #include "wtf/text/WTFString.h" 37 #include "wtf/text/WTFString.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 struct IDBVersionChangeEventInit : public EventInit { 41 struct IDBVersionChangeEventInit : public EventInit {
42 IDBVersionChangeEventInit(); 42 IDBVersionChangeEventInit();
43 43
44 unsigned long long oldVersion; 44 unsigned long long oldVersion;
45 Nullable<unsigned long long> newVersion; 45 Nullable<unsigned long long> newVersion;
46 blink::WebIDBDataLoss dataLoss;
46 }; 47 };
47 48
48 class IDBVersionChangeEvent FINAL : public Event { 49 class IDBVersionChangeEvent FINAL : public Event {
49 public: 50 public:
50 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create() 51 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create()
51 { 52 {
52 return adoptRefWillBeNoop(new IDBVersionChangeEvent()); 53 return adoptRefWillBeNoop(new IDBVersionChangeEvent());
53 } 54 }
54 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicStri ng& eventType, unsigned long long oldVersion, const Nullable<unsigned long long> & newVersion, blink::WebIDBDataLoss dataLoss = blink::WebIDBDataLossNone, const String& dataLossMessage = String()) 55 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicStri ng& eventType, unsigned long long oldVersion, const Nullable<unsigned long long> & newVersion, blink::WebIDBDataLoss dataLoss = blink::WebIDBDataLossNone, const String& dataLossMessage = String())
55 { 56 {
56 return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, oldVersio n, newVersion, dataLoss, dataLossMessage)); 57 return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, oldVersio n, newVersion, dataLoss, dataLossMessage));
57 } 58 }
58 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicStri ng& eventType, const IDBVersionChangeEventInit& initializer) 59 static PassRefPtrWillBeRawPtr<IDBVersionChangeEvent> create(const AtomicStri ng& eventType, const IDBVersionChangeEventInit& initializer)
59 { 60 {
60 return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, initializ er)); 61 return adoptRefWillBeNoop(new IDBVersionChangeEvent(eventType, initializ er));
61 } 62 }
63 static bool toNativeDataLoss(v8::Handle<v8::Value>, blink::WebIDBDataLoss*);
jsbell 2014/07/11 18:42:48 We shouldn't be passing v8::XXX types in modules/
cmumford 2014/07/11 20:53:05 OK - I'll convert to String or something suitable.
62 64
63 unsigned long long oldVersion() const { return m_oldVersion; } 65 unsigned long long oldVersion() const { return m_oldVersion; }
64 unsigned long long newVersion(bool& isNull) const; 66 unsigned long long newVersion(bool& isNull) const;
65 67
66 const AtomicString& dataLoss() const; 68 const AtomicString& dataLoss() const;
67 const String& dataLossMessage() const { return m_dataLossMessage; } 69 const String& dataLossMessage() const { return m_dataLossMessage; }
68 70
69 virtual const AtomicString& interfaceName() const OVERRIDE; 71 virtual const AtomicString& interfaceName() const OVERRIDE;
70 72
71 virtual void trace(Visitor*) OVERRIDE; 73 virtual void trace(Visitor*) OVERRIDE;
72 74
73 private: 75 private:
74 IDBVersionChangeEvent(); 76 IDBVersionChangeEvent();
75 IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldV ersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss, c onst String& dataLoss); 77 IDBVersionChangeEvent(const AtomicString& eventType, unsigned long long oldV ersion, const Nullable<unsigned long long>& newVersion, blink::WebIDBDataLoss, c onst String& dataLoss);
76 IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeE ventInit&); 78 IDBVersionChangeEvent(const AtomicString& eventType, const IDBVersionChangeE ventInit&);
77 79
78 unsigned long long m_oldVersion; 80 unsigned long long m_oldVersion;
79 Nullable<unsigned long long> m_newVersion; 81 Nullable<unsigned long long> m_newVersion;
80 bool m_dataLoss; 82 bool m_dataLoss;
81 String m_dataLossMessage; 83 String m_dataLossMessage;
82 }; 84 };
83 85
84 } // namespace WebCore 86 } // namespace WebCore
85 87
86 #endif // IDBVersionChangeEvent_h 88 #endif // IDBVersionChangeEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698