summaryrefslogtreecommitdiff
path: root/chromium/components/services/unzip/unzip_service.h
blob: 290190863529977f076f7ac58ae532aacdef0e73 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2017 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.

#ifndef COMPONENTS_SERVICES_UNZIP_UNZIP_SERVICE_H_
#define COMPONENTS_SERVICES_UNZIP_UNZIP_SERVICE_H_

#include <memory>
#include <string>

#include "base/macros.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/service_context.h"
#include "services/service_manager/public/cpp/service_context_ref.h"

namespace unzip {

class UnzipService : public service_manager::Service {
 public:
  ~UnzipService() override;

  // Factory method for creating the service.
  static std::unique_ptr<service_manager::Service> CreateService();

  // Lifescycle events that occur after the service has started to spinup.
  void OnStart() override;
  void OnBindInterface(const service_manager::BindSourceInfo& source_info,
                       const std::string& interface_name,
                       mojo::ScopedMessagePipeHandle interface_pipe) override;

 private:
  UnzipService();

  // State needed to manage service lifecycle and lifecycle of bound clients.
  std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_;
  service_manager::BinderRegistry registry_;
  DISALLOW_COPY_AND_ASSIGN(UnzipService);
};

}  // namespace unzip

#endif  // COMPONENTS_SERVICES_UNZIP_UNZIP_SERVICE_H_