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

Side by Side Diff: Source/modules/indexeddb/IDBDatabase.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 26 matching lines...) Expand all
37 #include "modules/indexeddb/IDBObjectStore.h" 37 #include "modules/indexeddb/IDBObjectStore.h"
38 #include "modules/indexeddb/IDBTransaction.h" 38 #include "modules/indexeddb/IDBTransaction.h"
39 #include "modules/indexeddb/IndexedDB.h" 39 #include "modules/indexeddb/IndexedDB.h"
40 #include "wtf/PassRefPtr.h" 40 #include "wtf/PassRefPtr.h"
41 #include "wtf/RefCounted.h" 41 #include "wtf/RefCounted.h"
42 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
43 43
44 namespace WebCore { 44 namespace WebCore {
45 45
46 class DOMError; 46 class DOMError;
47 class ExceptionState;
47 class ScriptExecutionContext; 48 class ScriptExecutionContext;
48 49
49 typedef int ExceptionCode; 50 typedef int ExceptionCode;
50 51
51 class IDBDatabase : public RefCounted<IDBDatabase>, public ScriptWrappable, publ ic EventTarget, public ActiveDOMObject { 52 class IDBDatabase : public RefCounted<IDBDatabase>, public ScriptWrappable, publ ic EventTarget, public ActiveDOMObject {
52 public: 53 public:
53 static PassRefPtr<IDBDatabase> create(ScriptExecutionContext*, PassRefPtr<ID BDatabaseBackendInterface>, PassRefPtr<IDBDatabaseCallbacks>); 54 static PassRefPtr<IDBDatabase> create(ScriptExecutionContext*, PassRefPtr<ID BDatabaseBackendInterface>, PassRefPtr<IDBDatabaseCallbacks>);
54 ~IDBDatabase(); 55 ~IDBDatabase();
55 56
56 void setMetadata(const IDBDatabaseMetadata& metadata) { m_metadata = metadat a; } 57 void setMetadata(const IDBDatabaseMetadata& metadata) { m_metadata = metadat a; }
57 void indexCreated(int64_t objectStoreId, const IDBIndexMetadata&); 58 void indexCreated(int64_t objectStoreId, const IDBIndexMetadata&);
58 void indexDeleted(int64_t objectStoreId, int64_t indexId); 59 void indexDeleted(int64_t objectStoreId, int64_t indexId);
59 void transactionCreated(IDBTransaction*); 60 void transactionCreated(IDBTransaction*);
60 void transactionFinished(IDBTransaction*); 61 void transactionFinished(IDBTransaction*);
61 62
62 // Implement the IDL 63 // Implement the IDL
63 const String name() const { return m_metadata.name; } 64 const String name() const { return m_metadata.name; }
64 PassRefPtr<IDBAny> version() const; 65 PassRefPtr<IDBAny> version() const;
65 PassRefPtr<DOMStringList> objectStoreNames() const; 66 PassRefPtr<DOMStringList> objectStoreNames() const;
66 67
67 PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dicti onary&, ExceptionCode&); 68 PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dicti onary&, ExceptionCode&);
68 PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKe yPath&, bool autoIncrement, ExceptionCode&); 69 PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKe yPath&, bool autoIncrement, ExceptionCode&);
69 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, Pass RefPtr<DOMStringList> scope, const String& mode, ExceptionCode& ec) { return tra nsaction(context, *scope, mode, ec); } 70 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, Pass RefPtr<DOMStringList> scope, const String& mode, ExceptionState& es) { return tr ansaction(context, *scope, mode, es); }
70 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector <String>&, const String& mode, ExceptionCode&); 71 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector <String>&, const String& mode, ExceptionState&);
71 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String &, const String& mode, ExceptionCode&); 72 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String &, const String& mode, ExceptionState&);
72 void deleteObjectStore(const String& name, ExceptionCode&); 73 void deleteObjectStore(const String& name, ExceptionState&);
73 void close(); 74 void close();
74 75
75 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); 76 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
76 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 77 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
77 DEFINE_ATTRIBUTE_EVENT_LISTENER(versionchange); 78 DEFINE_ATTRIBUTE_EVENT_LISTENER(versionchange);
78 79
79 // IDBDatabaseCallbacks 80 // IDBDatabaseCallbacks
80 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion); 81 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion);
81 virtual void onAbort(int64_t, PassRefPtr<DOMError>); 82 virtual void onAbort(int64_t, PassRefPtr<DOMError>);
82 virtual void onComplete(int64_t); 83 virtual void onComplete(int64_t);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // Keep track of the versionchange events waiting to be fired on this 136 // Keep track of the versionchange events waiting to be fired on this
136 // database so that we can cancel them if the database closes. 137 // database so that we can cancel them if the database closes.
137 Vector<RefPtr<Event> > m_enqueuedEvents; 138 Vector<RefPtr<Event> > m_enqueuedEvents;
138 139
139 RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks; 140 RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
140 }; 141 };
141 142
142 } // namespace WebCore 143 } // namespace WebCore
143 144
144 #endif // IDBDatabase_h 145 #endif // IDBDatabase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698