| 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 27 matching lines...) Expand all Loading... |
| 38 class WebIDBIndex; | 38 class WebIDBIndex; |
| 39 class WebIDBKey; | 39 class WebIDBKey; |
| 40 class WebIDBKeyPath; | 40 class WebIDBKeyPath; |
| 41 class WebString; | 41 class WebString; |
| 42 struct WebIDBMetadata; | 42 struct WebIDBMetadata; |
| 43 | 43 |
| 44 class WebIDBCallbacks { | 44 class WebIDBCallbacks { |
| 45 public: | 45 public: |
| 46 virtual ~WebIDBCallbacks() { } | 46 virtual ~WebIDBCallbacks() { } |
| 47 | 47 |
| 48 enum DataLoss { |
| 49 DataLossNone = 0, |
| 50 DataLossTotal = 1 |
| 51 }; |
| 52 |
| 48 // For classes that follow the PImpl pattern, pass a const reference. | 53 // For classes that follow the PImpl pattern, pass a const reference. |
| 49 // For the rest, pass ownership to the callee via a pointer. | 54 // For the rest, pass ownership to the callee via a pointer. |
| 50 virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED
(); } | 55 virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED
(); } |
| 51 virtual void onSuccess(const WebVector<WebString>&) { WEBKIT_ASSERT_NOT_REAC
HED(); } | 56 virtual void onSuccess(const WebVector<WebString>&) { WEBKIT_ASSERT_NOT_REAC
HED(); } |
| 52 virtual void onSuccess(WebIDBCursor*, const WebIDBKey& key, const WebIDBKey&
primaryKey, const WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } | 57 virtual void onSuccess(WebIDBCursor*, const WebIDBKey& key, const WebIDBKey&
primaryKey, const WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 53 virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); } | 58 virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 54 virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) { WEBKIT_ASSE
RT_NOT_REACHED(); } | 59 virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) { WEBKIT_ASSE
RT_NOT_REACHED(); } |
| 55 virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); } | 60 virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 56 virtual void onSuccess(const WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } | 61 virtual void onSuccess(const WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 57 virtual void onSuccess(const WebData&, const WebIDBKey&, const WebIDBKeyPath
&) { WEBKIT_ASSERT_NOT_REACHED(); } | 62 virtual void onSuccess(const WebData&, const WebIDBKey&, const WebIDBKeyPath
&) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 58 virtual void onSuccess(long long) { WEBKIT_ASSERT_NOT_REACHED(); } | 63 virtual void onSuccess(long long) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 59 virtual void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } | 64 virtual void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } |
| 60 virtual void onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, co
nst WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } | 65 virtual void onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, co
nst WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 61 // FIXME: Remove the following overload once callers are updated: | 66 // FIXME: Remove the following overload once callers are updated: |
| 62 virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); } | 67 virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); } |
| 63 virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED();
} | 68 virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED();
} |
| 64 virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const We
bIDBMetadata&) { WEBKIT_ASSERT_NOT_REACHED(); } | 69 virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database,
const WebIDBMetadata& metadata) |
| 70 { |
| 71 onUpgradeNeeded(oldVersion, database, metadata, DataLossNone); |
| 72 } |
| 73 virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const We
bIDBMetadata&, DataLoss dataLoss) { WEBKIT_ASSERT_NOT_REACHED(); } |
| 65 }; | 74 }; |
| 66 | 75 |
| 67 } // namespace WebKit | 76 } // namespace WebKit |
| 68 | 77 |
| 69 #endif // WebIDBCallbacks_h | 78 #endif // WebIDBCallbacks_h |
| OLD | NEW |