Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / mojo / services / test_service / test_request_tracker_client_impl.h
blobd28133f1d81296b21c8e14030aa6ee7ff0d215b6
1 // Copyright 2014 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 #ifndef MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_CLIENT_IMPL_H_
6 #define MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_CLIENT_IMPL_H_
8 #include "mojo/public/cpp/system/macros.h"
9 #include "mojo/services/test_service/test_request_tracker.mojom.h"
11 namespace mojo {
12 namespace test {
14 class TestRequestTrackerClientImpl : public TestRequestTrackerClient {
15 public:
16 TestRequestTrackerClientImpl(
17 TestRequestTrackerPtr tracker,
18 const std::string& service_name,
19 const mojo::Callback<void()>& tracking_connected_callback);
20 virtual ~TestRequestTrackerClientImpl();
22 // Call whenever an event happens that you want to be recorded.
23 void RecordNewRequest();
25 // TestRequestTrackerClient impl.
26 virtual void SetIdAndReturnName(
27 uint64_t id,
28 const mojo::Callback<void(mojo::String)>& callback) MOJO_OVERRIDE;
30 private:
31 void SendStats();
32 uint64_t id_;
33 uint64_t requests_since_upload_;
34 const std::string service_name_;
35 TestRequestTrackerPtr tracker_;
36 mojo::Callback<void()> tracking_connected_callback_;
39 } // namespace test
40 } // namespace mojo
42 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_CLIENT_IMPL_H_