Chromium Code Reviews| Index: third_party/WebKit/Source/modules/indexeddb/IDBObserver.h |
| diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5a0acfbd247a04db083dd2b05258c8a090faffa6 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IDBObserver_h |
| +#define IDBObserver_h |
| + |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "bindings/core/v8/SerializedScriptValue.h" |
|
Marijn Kruisselbrink
2016/06/02 23:51:24
I don't see where this include is used in this fil
palakj1
2016/06/03 01:21:53
Removed.
|
| +#include "modules/indexeddb/IDBDatabase.h" |
| +#include "modules/indexeddb/IDBTransaction.h" |
| +#include "platform/Length.h" |
| +#include "platform/heap/Handle.h" |
| +#include "wtf/PassRefPtr.h" |
| +#include "wtf/RefPtr.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class IDBObserverCallback; |
| +class IDBObserverInit; |
| + |
| +class IDBObserver final : public GarbageCollectedFinalized<IDBObserver>, public ScriptWrappable { |
| + DEFINE_WRAPPERTYPEINFO(); |
| + |
| +public: |
| + static IDBObserver* create(IDBObserverCallback&, const IDBObserverInit&); |
| + long long id; |
|
dmurph
2016/06/02 23:48:38
Don't worry about an ID for now.
Marijn Kruisselbrink
2016/06/02 23:51:24
Not sure what this |id| is?
palakj1
2016/06/03 01:21:53
id removed.
|
| + WebIDBDatabase* backendDB() const; |
|
dmurph
2016/06/02 23:48:37
Remove this too.
palakj1
2016/06/03 01:21:53
Oops! forgot to remove this. Done
|
| + // API methods |
| + void observe(IDBDatabase* db, IDBTransaction* tx, ExceptionState& exceptionState); |
|
Marijn Kruisselbrink
2016/06/02 23:51:24
Blink styleguide doesn't want redundant parameter
palakj1
2016/06/03 01:21:53
Done
|
| + |
| + DECLARE_TRACE(); |
| + |
| +private: |
| + explicit IDBObserver(IDBObserverCallback&, bool transaction, bool values, bool noRecords); |
|
Marijn Kruisselbrink
2016/06/02 23:51:24
Having bool parameters (and especially having mult
palakj1
2016/06/03 01:21:53
Done
|
| + void clearWeakMembers(Visitor*); |
| + Member<IDBObserverCallback> m_callback; |
| + bool m_transaction, m_values, m_noRecords; |
|
Marijn Kruisselbrink
2016/06/02 23:51:24
We generally prefer having every variable or field
palakj1
2016/06/03 01:21:53
Done
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // IDBObserver_h |