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_SERVICE_CAST_SERVICE_H_
6 #define CHROMECAST_SERVICE_CAST_SERVICE_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
20 class URLRequestContextGetter;
23 namespace chromecast {
27 // Create() takes a separate url request context getter because the request
28 // context getter obtained through the browser context might not be
29 // appropriate for the url requests made by the cast service/reciever.
30 // For example, on Chromecast, it is needed to pass in a system url request
31 // context getter that would set the request context for NSS, which the main
33 static CastService* Create(
34 content::BrowserContext* browser_context,
35 net::URLRequestContextGetter* request_context_getter);
37 virtual ~CastService();
39 // Start/stop the cast service.
44 explicit CastService(content::BrowserContext* browser_context);
45 virtual void Initialize() = 0;
47 // Implementation-specific start/stop behavior.
48 virtual void StartInternal() = 0;
49 virtual void StopInternal() = 0;
51 content::BrowserContext* browser_context() const { return browser_context_; }
54 content::BrowserContext* const browser_context_;
57 const scoped_ptr<base::ThreadChecker> thread_checker_;
59 DISALLOW_COPY_AND_ASSIGN(CastService);
62 } // namespace chromecast
64 #endif // CHROMECAST_SERVICE_CAST_SERVICE_H_