Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #ifndef WebCallbacks_h | 31 #ifndef WebCallbacks_h |
| 32 #define WebCallbacks_h | 32 #define WebCallbacks_h |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 template<typename S, typename T> | 36 template<typename S, typename T> |
| 37 class WebCallbacks { | 37 class WebCallbacks { |
| 38 public: | 38 public: |
| 39 virtual ~WebCallbacks() { } | 39 virtual ~WebCallbacks() { } |
| 40 virtual void onSuccess(S) { } | |
|
yhirano
2015/07/08 11:18:43
I don't like having two onSuccess functions in one
yhirano
2015/07/08 11:36:19
No, I was confused. I wanted to say
moving existi
| |
| 40 virtual void onSuccess(S*) { } | 41 virtual void onSuccess(S*) { } |
| 41 virtual void onError(T*) { } | 42 virtual void onError(T*) { } |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 template<typename T> | 45 template<typename T> |
| 45 class WebCallbacks<void, T> { | 46 class WebCallbacks<void, T> { |
| 46 public: | 47 public: |
| 47 virtual ~WebCallbacks() { } | 48 virtual ~WebCallbacks() { } |
| 48 virtual void onSuccess() { } | 49 virtual void onSuccess() { } |
| 49 virtual void onError(T*) { } | 50 virtual void onError(T*) { } |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 template<typename S> | 53 template<typename S> |
| 53 class WebCallbacks<S, void> { | 54 class WebCallbacks<S, void> { |
| 54 public: | 55 public: |
| 55 virtual ~WebCallbacks() { } | 56 virtual ~WebCallbacks() { } |
| 57 virtual void onSuccess(S) { } | |
| 56 virtual void onSuccess(S*) { } | 58 virtual void onSuccess(S*) { } |
| 57 virtual void onError() { } | 59 virtual void onError() { } |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 template<> | 62 template<> |
| 61 class WebCallbacks<void, void> { | 63 class WebCallbacks<void, void> { |
| 62 public: | 64 public: |
| 63 virtual ~WebCallbacks() { } | 65 virtual ~WebCallbacks() { } |
| 64 virtual void onSuccess() { } | 66 virtual void onSuccess() { } |
| 65 virtual void onError() { } | 67 virtual void onError() { } |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace blink | 70 } // namespace blink |
| 69 | 71 |
| 70 #endif | 72 #endif |
| OLD | NEW |