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 CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_H_
6 #define CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_H_
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
23 class URLRequestContextGetter
;
26 namespace chromecast
{
30 virtual ~CastService();
32 // Initializes/finalizes the cast service.
36 // Starts/stops the cast service.
41 CastService(content::BrowserContext
* browser_context
,
42 PrefService
* pref_service
);
44 // Implementation-specific initialization. Initialization of cast service's
45 // sub-components, and anything that requires IO operations should go here.
46 // Anything that should happen before cast service is started but doesn't need
47 // the sub-components to finish initializing should also go here.
48 virtual void InitializeInternal() = 0;
50 // Implementation-specific finalization. Any initializations done by
51 // InitializeInternal() should be finalized here.
52 virtual void FinalizeInternal() = 0;
54 // Implementation-specific start behavior. It basically starts the
55 // sub-component services and does additional initialization that cannot be
56 // done in the InitializationInternal().
57 virtual void StartInternal() = 0;
59 // Implementation-specific stop behavior. Any initializations done by
60 // StartInternal() should be finalized here.
61 virtual void StopInternal() = 0;
63 content::BrowserContext
* browser_context() const { return browser_context_
; }
64 PrefService
* pref_service() const { return pref_service_
; }
67 content::BrowserContext
* const browser_context_
;
68 PrefService
* const pref_service_
;
70 const scoped_ptr
<base::ThreadChecker
> thread_checker_
;
72 DISALLOW_COPY_AND_ASSIGN(CastService
);
75 } // namespace chromecast
77 #endif // CHROMECAST_BROWSER_SERVICE_CAST_SERVICE_H_