[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / mojo / shell / run.cc
blob7cd120016f2e1e5929dc899ef0578e6517f67e3b
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
3 // found in the LICENSE file.
5 #include "mojo/shell/run.h"
7 #include "base/logging.h"
8 #include "mojo/service_manager/service_manager.h"
9 #include "mojo/shell/context.h"
10 #include "mojo/shell/keep_alive.h"
12 namespace mojo {
13 namespace shell {
15 class StubServiceProvider : public InterfaceImpl<ServiceProvider> {
16 private:
17 virtual void ConnectToService(const mojo::String& service_name,
18 ScopedMessagePipeHandle client_handle)
19 MOJO_OVERRIDE {
24 void Run(Context* context, const std::vector<GURL>& app_urls) {
25 KeepAlive keep_alive(context);
27 if (app_urls.empty()) {
28 LOG(ERROR) << "No app path specified";
29 return;
32 for (std::vector<GURL>::const_iterator it = app_urls.begin();
33 it != app_urls.end();
34 ++it) {
35 // TODO(davemoore): These leak...need refs to them.
36 StubServiceProvider* stub_sp = new StubServiceProvider;
37 ServiceProviderPtr spp;
38 BindToProxy(stub_sp, &spp);
40 context->service_manager()->ConnectToApplication(
41 *it, GURL(), spp.Pass());
45 } // namespace shell
46 } // namespace mojo