| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 static CastChannelAPI* Get(content::BrowserContext* context); | 38 static CastChannelAPI* Get(content::BrowserContext* context); |
| 39 | 39 |
| 40 // BrowserContextKeyedAPI implementation. | 40 // BrowserContextKeyedAPI implementation. |
| 41 static BrowserContextKeyedAPIFactory<CastChannelAPI>* GetFactoryInstance(); | 41 static BrowserContextKeyedAPIFactory<CastChannelAPI>* GetFactoryInstance(); |
| 42 | 42 |
| 43 // Returns a new CastSocket that connects to |ip_endpoint| with authentication | 43 // Returns a new CastSocket that connects to |ip_endpoint| with authentication |
| 44 // |channel_auth| and is to be owned by |extension_id|. | 44 // |channel_auth| and is to be owned by |extension_id|. |
| 45 scoped_ptr<cast_channel::CastSocket> CreateCastSocket( | 45 scoped_ptr<cast_channel::CastSocket> CreateCastSocket( |
| 46 const std::string& extension_id, | 46 const std::string& extension_id, |
| 47 const net::IPEndPoint& ip_endpoint, | 47 const net::IPEndPoint& ip_endpoint, |
| 48 cast_channel::ChannelAuthType channel_auth); | 48 cast_channel::ChannelAuthType channel_auth, |
| 49 int timeout_millis); |
| 49 | 50 |
| 50 // Sets the CastSocket instance to be returned by CreateCastSocket for | 51 // Sets the CastSocket instance to be returned by CreateCastSocket for |
| 51 // testing. | 52 // testing. |
| 52 void SetSocketForTest(scoped_ptr<cast_channel::CastSocket> socket_for_test); | 53 void SetSocketForTest(scoped_ptr<cast_channel::CastSocket> socket_for_test); |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 friend class BrowserContextKeyedAPIFactory<CastChannelAPI>; | 56 friend class BrowserContextKeyedAPIFactory<CastChannelAPI>; |
| 56 friend class ::CastChannelAPITest; | 57 friend class ::CastChannelAPITest; |
| 57 | 58 |
| 58 virtual ~CastChannelAPI(); | 59 virtual ~CastChannelAPI(); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void OnClose(int result); | 198 void OnClose(int result); |
| 198 | 199 |
| 199 scoped_ptr<cast_channel::Close::Params> params_; | 200 scoped_ptr<cast_channel::Close::Params> params_; |
| 200 | 201 |
| 201 DISALLOW_COPY_AND_ASSIGN(CastChannelCloseFunction); | 202 DISALLOW_COPY_AND_ASSIGN(CastChannelCloseFunction); |
| 202 }; | 203 }; |
| 203 | 204 |
| 204 } // namespace extensions | 205 } // namespace extensions |
| 205 | 206 |
| 206 #endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ | 207 #endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ |
| OLD | NEW |