• blundell's avatar
    Enable connection to Mojo services from Blink · 8e3745ac
    blundell authored
    This CL enables connections to Mojo services from Blink; more specifically,
    from //third_party/WebKit/Source/modules, where dependencies on Chromium
    code are in general undesired (including on Mojo services' client
    libraries). To enable connecting to services without using the
    Service Manager's client library, this CL does the following:
    
    (1) Adds a method to Platform that exposes the connection to the
    ServiceManager as a service_manager::mojom::blink::ConnectorPtr.
    (2) Builds a bare-bones ServiceConnector around this ConnectorPtr that
    supports connecting to Mojo services by name from Blink.
    (3) Ports TimeZoneMonitor to be hosted in the Device Service as an example
    of connecting to an interface that is hosted in a service other than
    //content/browser from Blink.
    
    ServiceConnector being "bare-bones" includes the facts that:
    - Unlike blink::InterfaceProvider, blink::ServiceConnector is currently
    thread-hostile. This should be easy to relax using similar mechanisms as
    InterfaceProviderImpl.
    - There is currently no API for obtaining an InterfaceProvider for a given
    service (or a thread-safe wrapper, per the above comment). Again, this should
    be easy to add.
    
    This CL also moves the definition of the device service name to mojom instead
    of C++ in order to facilitate using this constant from Blink.
    
    BUG=612341
    TEST=http://crbug.com/288697#c12: load the page, change the system time zone,
         and then click "recheck" to ensure that the renderer picks up the new
         time zone. Don't reload the page, which is likely to give you a new
         renderer process, use the "recheck" link on the page.
    
    Review-Url: https://codereview.chromium.org/2460723003
    Cr-Commit-Position: refs/heads/master@{#439498}
    8e3745ac
DEPS 1.29 KB