Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Side by Side Diff: chromecast/service/cast_service.h

Issue 606513002: Pass the system url request context getter to the cast service so that it can be used by various sy… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chromecast/service/cast_service_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMECAST_SERVICE_CAST_SERVICE_H_ 5 #ifndef CHROMECAST_SERVICE_CAST_SERVICE_H_
6 #define CHROMECAST_SERVICE_CAST_SERVICE_H_ 6 #define CHROMECAST_SERVICE_CAST_SERVICE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 10
11 namespace base { 11 namespace base {
12 class ThreadChecker; 12 class ThreadChecker;
13 } 13 }
14 14
15 namespace content{ 15 namespace content{
16 class BrowserContext; 16 class BrowserContext;
17 } 17 }
18 18
19 namespace net {
20 class URLRequestContextGetter;
21 }
22
19 namespace chromecast { 23 namespace chromecast {
20 24
21 class CastService { 25 class CastService {
22 public: 26 public:
23 static CastService* Create(content::BrowserContext* browser_context); 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
32 // getter doesn't do.
33 static CastService* Create(
34 content::BrowserContext* browser_context,
35 net::URLRequestContextGetter* request_context_getter);
gunsch 2014/09/25 15:50:02 Hm, is there any case where we actually want to ch
lcwu1 2014/09/25 17:07:37 There are two reasons to pass in an url request co
24 36
25 virtual ~CastService(); 37 virtual ~CastService();
26 38
27 // Start/stop the cast service. 39 // Start/stop the cast service.
28 void Start(); 40 void Start();
29 void Stop(); 41 void Stop();
30 42
31 protected: 43 protected:
32 explicit CastService(content::BrowserContext* browser_context); 44 explicit CastService(content::BrowserContext* browser_context);
33 virtual void Initialize() = 0; 45 virtual void Initialize() = 0;
34 46
35 // Implementation-specific start/stop behavior. 47 // Implementation-specific start/stop behavior.
36 virtual void StartInternal() = 0; 48 virtual void StartInternal() = 0;
37 virtual void StopInternal() = 0; 49 virtual void StopInternal() = 0;
38 50
39 content::BrowserContext* browser_context() const { return browser_context_; } 51 content::BrowserContext* browser_context() const { return browser_context_; }
40 52
41 private: 53 private:
42 content::BrowserContext* const browser_context_; 54 content::BrowserContext* const browser_context_;
43 bool stopped_; 55 bool stopped_;
44 56
45 const scoped_ptr<base::ThreadChecker> thread_checker_; 57 const scoped_ptr<base::ThreadChecker> thread_checker_;
46 58
47 DISALLOW_COPY_AND_ASSIGN(CastService); 59 DISALLOW_COPY_AND_ASSIGN(CastService);
48 }; 60 };
49 61
50 } // namespace chromecast 62 } // namespace chromecast
51 63
52 #endif // CHROMECAST_SERVICE_CAST_SERVICE_H_ 64 #endif // CHROMECAST_SERVICE_CAST_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chromecast/service/cast_service_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698