OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 class SharedBuffer; | 53 class SharedBuffer; |
54 | 54 |
55 class IDBRequest | 55 class IDBRequest |
56 : public RefCountedGarbageCollected<IDBRequest> | 56 : public RefCountedGarbageCollected<IDBRequest> |
57 , public ScriptWrappable | 57 , public ScriptWrappable |
58 , public EventTargetWithInlineData | 58 , public EventTargetWithInlineData |
59 , public ActiveDOMObject { | 59 , public ActiveDOMObject { |
60 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<IDBRequest>); | 60 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<IDBRequest>); |
61 | 61 |
62 public: | 62 public: |
63 static IDBRequest* create(ExecutionContext*, IDBAny* source, IDBTransaction*
); | 63 static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*); |
64 virtual ~IDBRequest(); | 64 virtual ~IDBRequest(); |
65 virtual void trace(Visitor*); | 65 virtual void trace(Visitor*); |
66 | 66 |
67 ScriptValue result(ExceptionState&); | 67 ScriptValue result(ExceptionState&); |
68 PassRefPtrWillBeRawPtr<DOMError> error(ExceptionState&) const; | 68 PassRefPtrWillBeRawPtr<DOMError> error(ExceptionState&) const; |
69 ScriptValue source() const; | 69 ScriptValue source() const; |
70 IDBTransaction* transaction() const { return m_transaction.get(); } | 70 IDBTransaction* transaction() const { return m_transaction.get(); } |
71 | 71 |
72 bool isResultDirty() const { return m_resultDirty; } | 72 bool isResultDirty() const { return m_resultDirty; } |
73 IDBAny* resultAsAny() const { return m_result; } | 73 IDBAny* resultAsAny() const { return m_result; } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; | 120 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; |
121 | 121 |
122 // Called by a version change transaction that has finished to set this | 122 // Called by a version change transaction that has finished to set this |
123 // request back from DONE (following "upgradeneeded") back to PENDING (for | 123 // request back from DONE (following "upgradeneeded") back to PENDING (for |
124 // the upcoming "success" or "error"). | 124 // the upcoming "success" or "error"). |
125 void transactionDidFinishAndDispatch(); | 125 void transactionDidFinishAndDispatch(); |
126 | 126 |
127 IDBCursor* getResultCursor() const; | 127 IDBCursor* getResultCursor() const; |
128 | 128 |
129 protected: | 129 protected: |
130 IDBRequest(ExecutionContext*, IDBAny* source, IDBTransaction*); | 130 IDBRequest(ScriptState*, IDBAny* source, IDBTransaction*); |
131 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); | 131 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); |
132 void dequeueEvent(Event*); | 132 void dequeueEvent(Event*); |
133 virtual bool shouldEnqueueEvent() const; | 133 virtual bool shouldEnqueueEvent() const; |
134 void onSuccessInternal(IDBAny*); | 134 void onSuccessInternal(IDBAny*); |
135 void setResult(IDBAny*); | 135 void setResult(IDBAny*); |
136 | 136 |
137 bool m_contextStopped; | 137 bool m_contextStopped; |
138 Member<IDBTransaction> m_transaction; | 138 Member<IDBTransaction> m_transaction; |
139 ReadyState m_readyState; | 139 ReadyState m_readyState; |
140 bool m_requestAborted; // May be aborted by transaction then receive async o
nsuccess; ignore vs. assert. | 140 bool m_requestAborted; // May be aborted by transaction then receive async o
nsuccess; ignore vs. assert. |
(...skipping 22 matching lines...) Expand all Loading... |
163 OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo; | 163 OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo; |
164 | 164 |
165 bool m_didFireUpgradeNeededEvent; | 165 bool m_didFireUpgradeNeededEvent; |
166 bool m_preventPropagation; | 166 bool m_preventPropagation; |
167 bool m_resultDirty; | 167 bool m_resultDirty; |
168 }; | 168 }; |
169 | 169 |
170 } // namespace WebCore | 170 } // namespace WebCore |
171 | 171 |
172 #endif // IDBRequest_h | 172 #endif // IDBRequest_h |
OLD | NEW |