| 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 | 
|  11  *     notice, this list of conditions and the following disclaimer in the |  11  *     notice, this list of conditions and the following disclaimer in the | 
|  12  *     documentation and/or other materials provided with the distribution. |  12  *     documentation and/or other materials provided with the distribution. | 
|  13  * |  13  * | 
|  14  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |  14  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 
|  15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |  15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 
|  16  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |  16  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 
|  17  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |  17  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 
|  18  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |  18  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 
|  19  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |  19  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 
|  20  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |  20  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 
|  21  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |  21  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 
|  22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |  22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 
|  23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
|  24  */ |  24  */ | 
|  25  |  25  | 
|  26 #ifndef WebIDBCallbacks_h |  26 #ifndef WebIDBCallbacks_h | 
|  27 #define WebIDBCallbacks_h |  27 #define WebIDBCallbacks_h | 
|  28  |  28  | 
 |  29 #include "WebDOMStringList.h" | 
|  29 #include "../../../Platform/chromium/public/WebCommon.h" |  30 #include "../../../Platform/chromium/public/WebCommon.h" | 
|  30 #include "../../../Platform/chromium/public/WebVector.h" |  31 #include "../../../Platform/chromium/public/WebVector.h" | 
|  31  |  32  | 
|  32 namespace WebKit { |  33 namespace WebKit { | 
|  33  |  34  | 
|  34 class WebDOMStringList; |  | 
|  35 class WebData; |  35 class WebData; | 
|  36 class WebIDBCursor; |  36 class WebIDBCursor; | 
|  37 class WebIDBDatabase; |  37 class WebIDBDatabase; | 
|  38 class WebIDBDatabaseError; |  38 class WebIDBDatabaseError; | 
|  39 class WebIDBIndex; |  39 class WebIDBIndex; | 
|  40 class WebIDBKey; |  40 class WebIDBKey; | 
|  41 class WebIDBKeyPath; |  41 class WebIDBKeyPath; | 
 |  42 class WebString; | 
|  42 struct WebIDBMetadata; |  43 struct WebIDBMetadata; | 
|  43  |  44  | 
|  44 class WebIDBCallbacks { |  45 class WebIDBCallbacks { | 
|  45 public: |  46 public: | 
|  46     virtual ~WebIDBCallbacks() { } |  47     virtual ~WebIDBCallbacks() { } | 
|  47  |  48  | 
|  48     // For classes that follow the PImpl pattern, pass a const reference. |  49     // For classes that follow the PImpl pattern, pass a const reference. | 
|  49     // For the rest, pass ownership to the callee via a pointer. |  50     // For the rest, pass ownership to the callee via a pointer. | 
|  50     virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED
    (); } |  51     virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED
    (); } | 
|  51     virtual void onSuccess(const WebDOMStringList&) { WEBKIT_ASSERT_NOT_REACHED(
    ); } |  52     virtual void onSuccess(const WebDOMStringList&) { WEBKIT_ASSERT_NOT_REACHED(
    ); } | 
 |  53     virtual void onSuccess(const WebVector<WebString>& stringList) | 
 |  54     { | 
 |  55         WebDOMStringList domStringList; | 
 |  56         for (size_t i = 0; i < stringList.size(); ++i) | 
 |  57             domStringList.append(stringList[i]); | 
 |  58         onSuccess(domStringList); | 
 |  59     } | 
|  52     virtual void onSuccess(WebIDBCursor*, const WebIDBKey& key, const WebIDBKey&
     primaryKey, const WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } |  60     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(); } |  61     virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  54     virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) { WEBKIT_ASSE
    RT_NOT_REACHED(); } |  62     virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) { WEBKIT_ASSE
    RT_NOT_REACHED(); } | 
|  55     virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); } |  63     virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  56     virtual void onSuccess(const WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } |  64     virtual void onSuccess(const WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  57     virtual void onSuccess(const WebData&, const WebIDBKey&, const WebIDBKeyPath
    &) { WEBKIT_ASSERT_NOT_REACHED(); } |  65     virtual void onSuccess(const WebData&, const WebIDBKey&, const WebIDBKeyPath
    &) { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  58     virtual void onSuccess(long long) { WEBKIT_ASSERT_NOT_REACHED(); } |  66     virtual void onSuccess(long long) { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  59     virtual void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } |  67     virtual void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  60     virtual void onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, co
    nst WebData&) { WEBKIT_ASSERT_NOT_REACHED(); } |  68     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: |  69     // FIXME: Remove the following overload once callers are updated: | 
|  62     virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); } |  70     virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  63     virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED(); 
    } |  71     virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED(); 
    } | 
|  64     virtual void onSuccessWithPrefetch(const WebVector<WebIDBKey>& keys, const W
    ebVector<WebIDBKey>& primaryKeys, const WebVector<WebData>& values) { WEBKIT_ASS
    ERT_NOT_REACHED(); } |  72     virtual void onSuccessWithPrefetch(const WebVector<WebIDBKey>& keys, const W
    ebVector<WebIDBKey>& primaryKeys, const WebVector<WebData>& values) { WEBKIT_ASS
    ERT_NOT_REACHED(); } | 
|  65     virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const We
    bIDBMetadata&) { WEBKIT_ASSERT_NOT_REACHED(); } |  73     virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const We
    bIDBMetadata&) { WEBKIT_ASSERT_NOT_REACHED(); } | 
|  66 }; |  74 }; | 
|  67  |  75  | 
|  68 } // namespace WebKit |  76 } // namespace WebKit | 
|  69  |  77  | 
|  70 #endif // WebIDBCallbacks_h |  78 #endif // WebIDBCallbacks_h | 
| OLD | NEW |