- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / renderer / media / cast_session.h
1 // Copyright 2013 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 CHROME_RENDERER_MEDIA_CAST_SESSION_H_
6 #define CHROME_RENDERER_MEDIA_CAST_SESSION_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace base {
13 class MessageLoopProxy;
14 }  // namespace base
15
16 class CastSessionDelegate;
17
18 // This class represents a Cast session and allows the session to be
19 // configured on the main thread. Actual work is forwarded to
20 // CastSessionDelegate on the IO thread.
21 class CastSession : public base::RefCounted<CastSession> {
22  public:
23   CastSession();
24
25  private:
26   friend class base::RefCounted<CastSession>;
27   virtual ~CastSession();
28
29   // This member should never be dereferenced on the main thread.
30   // CastSessionDelegate lives only on the IO thread. It is always
31   // safe to post task on the IO thread to access CastSessionDelegate
32   // because it is owned by this object.
33   scoped_ptr<CastSessionDelegate> delegate_;
34
35   // Proxy to the IO message loop.
36   const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
37
38   DISALLOW_COPY_AND_ASSIGN(CastSession);
39 };
40
41 #endif  // CHROME_RENDERER_MEDIA_CAST_SESSION_H_