Chromium Code Reviews
DescriptionProvides a way to use bindings that doesn't require subclassing
I'm writing a test and want to test a concrete implementation of my
mojo service. My service has a client. I don't want to create a pipe
or anything for my test; that all doesn't matter. Rather I want to
directly create my concrete service class and supply a test client
implementation. This has the added benefit of all being synchronous.
Having my service implementation subclass InterfaceImpl is a bit
awkward. It doesn't make sense for InterfaceImpl to allow setting the
client and I get some baggage from the superclass.
I split out the logic managing the binding into a class called
InterfaceBinding. I changed InterfaceImpl to internally use this
class. So, you can either subclass InterfaceImpl (as you always have)
or use InterfaceBinding supplying your service implementation (that
doesn't subclass InterfaceImpl).
Having InterfaceImpl and InterfaceBinding share code results in some
what tricky code.
R=davemoore@chromium.org, jamesr@chromium.org
Patch Set 1 #Patch Set 2 : comment #
Total comments: 7
Patch Set 3 : merge 2 trunk #Patch Set 4 : review feedback #
Messages
Total messages: 10 (2 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||