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