summaryrefslogtreecommitdiffstats
path: root/mojo/examples/sample_app/hello_world_client_impl.cc
blob: 2d6d112dc0e6e06190da507de07458909f27126d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "mojo/examples/sample_app/hello_world_client_impl.h"

#include <stdio.h>

#include "base/message_loop/message_loop.h"

namespace mojo {
namespace examples {

HelloWorldClientImpl::HelloWorldClientImpl(ScopedMessagePipeHandle pipe)
    : service_(pipe.Pass()) {
  service_.SetPeer(this);
}

void HelloWorldClientImpl::DidReceiveGreeting(int32_t result) {
  printf("DidReceiveGreeting from pipe: %d\n", result);
  // Stop the current message loop.
  base::MessageLoop::current()->QuitNow();
}

HelloWorldClientImpl::~HelloWorldClientImpl() {}

}  // examples
}  // mojo