• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef MOJO_SERVICE_MANAGER_SERVICE_LOADER_H_
6 #define MOJO_SERVICE_MANAGER_SERVICE_LOADER_H_
7 
8 #include "mojo/public/cpp/system/core.h"
9 #include "mojo/service_manager/service_manager_export.h"
10 #include "url/gurl.h"
11 
12 namespace mojo {
13 
14 class ServiceManager;
15 
16 // Interface to allowing default loading behavior to be overridden for a
17 // specific url.
18 class MOJO_SERVICE_MANAGER_EXPORT ServiceLoader {
19  public:
~ServiceLoader()20   virtual ~ServiceLoader() {}
21   virtual void LoadService(ServiceManager* manager,
22                            const GURL& url,
23                            ScopedMessagePipeHandle service_handle) = 0;
24   virtual void OnServiceError(ServiceManager* manager, const GURL& url) = 0;
25 
26  protected:
ServiceLoader()27   ServiceLoader() {}
28 };
29 
30 }  // namespace mojo
31 
32 #endif  // MOJO_SERVICE_MANAGER_SERVICE_LOADER_H_
33