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

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

Issue 18398002: Remove IDBNotFoundError ExceptionCode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge Created 7 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 | 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 23 matching lines...) Expand all
34 #include "core/dom/EventNames.h" 34 #include "core/dom/EventNames.h"
35 #include "core/dom/EventTarget.h" 35 #include "core/dom/EventTarget.h"
36 #include "modules/indexeddb/IDBMetadata.h" 36 #include "modules/indexeddb/IDBMetadata.h"
37 #include "modules/indexeddb/IndexedDB.h" 37 #include "modules/indexeddb/IndexedDB.h"
38 #include "wtf/HashSet.h" 38 #include "wtf/HashSet.h"
39 #include "wtf/RefCounted.h" 39 #include "wtf/RefCounted.h"
40 40
41 namespace WebCore { 41 namespace WebCore {
42 42
43 class DOMError; 43 class DOMError;
44 class ExceptionState;
44 class IDBCursor; 45 class IDBCursor;
45 class IDBDatabase; 46 class IDBDatabase;
46 class IDBDatabaseBackendInterface; 47 class IDBDatabaseBackendInterface;
47 class IDBObjectStore; 48 class IDBObjectStore;
48 class IDBOpenDBRequest; 49 class IDBOpenDBRequest;
49 struct IDBObjectStoreMetadata; 50 struct IDBObjectStoreMetadata;
50 51
52 typedef int ExceptionCode;
53
51 class IDBTransaction : public ScriptWrappable, public RefCounted<IDBTransaction> , public EventTarget, public ActiveDOMObject { 54 class IDBTransaction : public ScriptWrappable, public RefCounted<IDBTransaction> , public EventTarget, public ActiveDOMObject {
52 public: 55 public:
53 static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, int64_t, c onst Vector<String>& objectStoreNames, IndexedDB::TransactionMode, IDBDatabase*) ; 56 static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, int64_t, c onst Vector<String>& objectStoreNames, IndexedDB::TransactionMode, IDBDatabase*) ;
54 static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, int64_t, I DBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata); 57 static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, int64_t, I DBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
55 virtual ~IDBTransaction(); 58 virtual ~IDBTransaction();
56 59
57 static const AtomicString& modeReadOnly(); 60 static const AtomicString& modeReadOnly();
58 static const AtomicString& modeReadWrite(); 61 static const AtomicString& modeReadWrite();
59 static const AtomicString& modeVersionChange(); 62 static const AtomicString& modeVersionChange();
60 static const AtomicString& modeReadOnlyLegacy(); 63 static const AtomicString& modeReadOnlyLegacy();
61 static const AtomicString& modeReadWriteLegacy(); 64 static const AtomicString& modeReadWriteLegacy();
62 65
63 static IndexedDB::TransactionMode stringToMode(const String&, ExceptionCode& ); 66 static IndexedDB::TransactionMode stringToMode(const String&, ExceptionCode& );
64 static const AtomicString& modeToString(IndexedDB::TransactionMode); 67 static const AtomicString& modeToString(IndexedDB::TransactionMode);
65 68
66 IDBDatabaseBackendInterface* backendDB() const; 69 IDBDatabaseBackendInterface* backendDB() const;
67 70
68 int64_t id() const { return m_id; } 71 int64_t id() const { return m_id; }
69 bool isActive() const { return m_state == Active; } 72 bool isActive() const { return m_state == Active; }
70 bool isFinished() const { return m_state == Finished; } 73 bool isFinished() const { return m_state == Finished; }
71 bool isReadOnly() const { return m_mode == IndexedDB::TransactionReadOnly; } 74 bool isReadOnly() const { return m_mode == IndexedDB::TransactionReadOnly; }
72 bool isVersionChange() const { return m_mode == IndexedDB::TransactionVersio nChange; } 75 bool isVersionChange() const { return m_mode == IndexedDB::TransactionVersio nChange; }
73 76
74 // Implement the IDBTransaction IDL 77 // Implement the IDBTransaction IDL
75 const String& mode() const; 78 const String& mode() const;
76 IDBDatabase* db() const { return m_database.get(); } 79 IDBDatabase* db() const { return m_database.get(); }
77 PassRefPtr<DOMError> error() const { return m_error; } 80 PassRefPtr<DOMError> error() const { return m_error; }
78 PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&); 81 PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionState&);
79 void abort(ExceptionCode&); 82 void abort(ExceptionCode&);
80 83
81 class OpenCursorNotifier { 84 class OpenCursorNotifier {
82 public: 85 public:
83 OpenCursorNotifier(PassRefPtr<IDBTransaction>, IDBCursor*); 86 OpenCursorNotifier(PassRefPtr<IDBTransaction>, IDBCursor*);
84 ~OpenCursorNotifier(); 87 ~OpenCursorNotifier();
85 void cursorFinished(); 88 void cursorFinished();
86 private: 89 private:
87 RefPtr<IDBTransaction> m_transaction; 90 RefPtr<IDBTransaction> m_transaction;
88 IDBCursor* m_cursor; 91 IDBCursor* m_cursor;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 IDBDatabaseMetadata m_previousMetadata; 165 IDBDatabaseMetadata m_previousMetadata;
163 166
164 HashSet<IDBCursor*> m_openCursors; 167 HashSet<IDBCursor*> m_openCursors;
165 168
166 EventTargetData m_eventTargetData; 169 EventTargetData m_eventTargetData;
167 }; 170 };
168 171
169 } // namespace WebCore 172 } // namespace WebCore
170 173
171 #endif // IDBTransaction_h 174 #endif // IDBTransaction_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698