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

Unified Diff: services/service_manager/public/cpp/interface_binder.h

Issue 2859343003: Enable overriding interface binders for any services running in current process. (Closed)
Patch Set: Override by service identity --> service name Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: services/service_manager/public/cpp/interface_binder.h
diff --git a/services/service_manager/public/cpp/interface_binder.h b/services/service_manager/public/cpp/interface_binder.h
index 0f4845bab1168e76bd4f73f5c0c66636333606b8..6e1c2fc45a6ff951abdefb32d66048b512218ed7 100644
--- a/services/service_manager/public/cpp/interface_binder.h
+++ b/services/service_manager/public/cpp/interface_binder.h
@@ -89,6 +89,33 @@ class GenericCallbackBinder : public InterfaceBinder {
DISALLOW_COPY_AND_ASSIGN(GenericCallbackBinder);
};
+class FullCallbackBinder : public InterfaceBinder {
Ken Rockot(use gerrit already) 2017/05/11 02:32:08 Could you please just modify GenericCallbackBinder
leonhsl(Using Gerrit) 2017/05/11 03:10:04 Done. Thank you very much! I should have done such
+ public:
+ using BindCallback = base::Callback<void(const BindSourceInfo&,
+ const std::string&,
+ mojo::ScopedMessagePipeHandle)>;
+
+ FullCallbackBinder(
+ const BindCallback& callback,
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
+ ~FullCallbackBinder() override;
+
+ private:
+ // InterfaceBinder:
+ void BindInterface(const BindSourceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle handle) override;
+
+ static void RunCallback(const BindCallback& callback,
+ const BindSourceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle client_handle);
+
+ const BindCallback callback_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ DISALLOW_COPY_AND_ASSIGN(FullCallbackBinder);
+};
+
} // namespace service_manager
#endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_BINDER_H_

Powered by Google App Engine
This is Rietveld 408576698