| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 693 |
| 694 private: | 694 private: |
| 695 // If you're hitting a compile error here due to "final" - great! You're | 695 // If you're hitting a compile error here due to "final" - great! You're |
| 696 // doing the right thing, you just need to extend UIThreadExtensionFunction | 696 // doing the right thing, you just need to extend UIThreadExtensionFunction |
| 697 // instead of SyncExtensionFunction. | 697 // instead of SyncExtensionFunction. |
| 698 ResponseAction Run() final; | 698 ResponseAction Run() final; |
| 699 | 699 |
| 700 DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction); | 700 DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction); |
| 701 }; | 701 }; |
| 702 | 702 |
| 703 class SyncIOThreadExtensionFunction : public IOThreadExtensionFunction { | |
| 704 public: | |
| 705 SyncIOThreadExtensionFunction(); | |
| 706 | |
| 707 protected: | |
| 708 ~SyncIOThreadExtensionFunction() override; | |
| 709 | |
| 710 // Deprecated: Override IOThreadExtensionFunction and implement Run() instead. | |
| 711 // | |
| 712 // SyncIOThreadExtensionFunctions implement this method. Return true to | |
| 713 // respond immediately with success, false to respond immediately with an | |
| 714 // error. | |
| 715 virtual bool RunSync() = 0; | |
| 716 | |
| 717 // ValidationFailure override to match RunSync(). | |
| 718 static bool ValidationFailure(SyncIOThreadExtensionFunction* function); | |
| 719 | |
| 720 private: | |
| 721 // If you're hitting a compile error here due to "final" - great! You're | |
| 722 // doing the right thing, you just need to extend IOThreadExtensionFunction | |
| 723 // instead of SyncIOExtensionFunction. | |
| 724 ResponseAction Run() final; | |
| 725 | |
| 726 DISALLOW_COPY_AND_ASSIGN(SyncIOThreadExtensionFunction); | |
| 727 }; | |
| 728 | |
| 729 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 703 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
| OLD | NEW |