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

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

Issue 235883002: IndexedDB: Make sure indexing completes if object store is deleted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void continueFunction(ExecutionContext*, const ScriptValue& key, ExceptionSt ate&); 70 void continueFunction(ExecutionContext*, const ScriptValue& key, ExceptionSt ate&);
71 void continuePrimaryKey(ExecutionContext*, const ScriptValue& key, const Scr iptValue& primaryKey, ExceptionState&); 71 void continuePrimaryKey(ExecutionContext*, const ScriptValue& key, const Scr iptValue& primaryKey, ExceptionState&);
72 PassRefPtr<IDBRequest> deleteFunction(ExecutionContext*, ExceptionState&); 72 PassRefPtr<IDBRequest> deleteFunction(ExecutionContext*, ExceptionState&);
73 73
74 bool isKeyDirty() const { return m_keyDirty; } 74 bool isKeyDirty() const { return m_keyDirty; }
75 bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; } 75 bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; }
76 bool isValueDirty() const { return m_valueDirty; } 76 bool isValueDirty() const { return m_valueDirty; }
77 77
78 void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Exc eptionState&); 78 void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Exc eptionState&);
79 void postSuccessHandlerCallback(); 79 void postSuccessHandlerCallback();
80 bool isDeleted() const;
80 void close(); 81 void close();
81 void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe fPtr<SharedBuffer> value); 82 void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe fPtr<SharedBuffer> value);
82 PassRefPtr<IDBKey> idbPrimaryKey() const { return m_primaryKey; } 83 PassRefPtr<IDBKey> idbPrimaryKey() const { return m_primaryKey; }
83 IDBRequest* request() const { return m_request.get(); } 84 IDBRequest* request() const { return m_request.get(); }
84 virtual bool isKeyCursor() const { return true; } 85 virtual bool isKeyCursor() const { return true; }
85 virtual bool isCursorWithValue() const { return false; } 86 virtual bool isCursorWithValue() const { return false; }
86 87
87 void deref() 88 void deref()
88 { 89 {
89 if (derefBase()) 90 if (derefBase())
90 delete this; 91 delete this;
91 else if (hasOneRef()) 92 else if (hasOneRef())
92 checkForReferenceCycle(); 93 checkForReferenceCycle();
93 } 94 }
94 95
95 protected: 96 protected:
96 IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursor::Direction, I DBRequest*, IDBAny* source, IDBTransaction*); 97 IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursor::Direction, I DBRequest*, IDBAny* source, IDBTransaction*);
97 98
98 private: 99 private:
99 PassRefPtr<IDBObjectStore> effectiveObjectStore() const; 100 PassRefPtr<IDBObjectStore> effectiveObjectStore() const;
100 101
101 void checkForReferenceCycle(); 102 void checkForReferenceCycle();
102 bool isDeleted() const;
103 103
104 OwnPtr<blink::WebIDBCursor> m_backend; 104 OwnPtr<blink::WebIDBCursor> m_backend;
105 RefPtr<IDBRequest> m_request; 105 RefPtr<IDBRequest> m_request;
106 const blink::WebIDBCursor::Direction m_direction; 106 const blink::WebIDBCursor::Direction m_direction;
107 RefPtr<IDBAny> m_source; 107 RefPtr<IDBAny> m_source;
108 RefPtr<IDBTransaction> m_transaction; 108 RefPtr<IDBTransaction> m_transaction;
109 bool m_gotValue; 109 bool m_gotValue;
110 bool m_keyDirty; 110 bool m_keyDirty;
111 bool m_primaryKeyDirty; 111 bool m_primaryKeyDirty;
112 bool m_valueDirty; 112 bool m_valueDirty;
113 RefPtr<IDBKey> m_key; 113 RefPtr<IDBKey> m_key;
114 RefPtr<IDBKey> m_primaryKey; 114 RefPtr<IDBKey> m_primaryKey;
115 RefPtr<SharedBuffer> m_value; 115 RefPtr<SharedBuffer> m_value;
116 }; 116 };
117 117
118 } // namespace WebCore 118 } // namespace WebCore
119 119
120 #endif // IDBCursor_h 120 #endif // IDBCursor_h
OLDNEW
« no previous file with comments | « LayoutTests/storage/indexeddb/createIndex-deleteObjectStore-expected.txt ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698