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

Side by Side Diff: extensions/browser/api/cast_channel/cast_socket.h

Issue 2891923004: [cast_channel] Make cast_channel related files not depend on "cast_channel.h" (Closed)
Patch Set: rename cast_channel_type to cast_channel_enum Created 3 years, 6 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
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 EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
11 #include <string> 11 #include <string>
12 12
13 #include "base/cancelable_callback.h" 13 #include "base/cancelable_callback.h"
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/threading/thread_checker.h" 17 #include "base/threading/thread_checker.h"
18 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
19 #include "components/cast_channel/cast_channel_enum.h"
19 #include "extensions/browser/api/api_resource.h" 20 #include "extensions/browser/api/api_resource.h"
20 #include "extensions/browser/api/api_resource_manager.h" 21 #include "extensions/browser/api/api_resource_manager.h"
21 #include "extensions/browser/api/cast_channel/cast_auth_util.h" 22 #include "extensions/browser/api/cast_channel/cast_auth_util.h"
22 #include "extensions/browser/api/cast_channel/cast_socket.h" 23 #include "extensions/browser/api/cast_channel/cast_socket.h"
23 #include "extensions/browser/api/cast_channel/cast_transport.h" 24 #include "extensions/browser/api/cast_channel/cast_transport.h"
24 #include "extensions/common/api/cast_channel.h"
25 #include "extensions/common/api/cast_channel/logging.pb.h" 25 #include "extensions/common/api/cast_channel/logging.pb.h"
26 #include "net/base/completion_callback.h" 26 #include "net/base/completion_callback.h"
27 #include "net/base/io_buffer.h" 27 #include "net/base/io_buffer.h"
28 #include "net/base/ip_endpoint.h" 28 #include "net/base/ip_endpoint.h"
29 #include "net/log/net_log_source.h" 29 #include "net/log/net_log_source.h"
30 30
31 namespace net { 31 namespace net {
32 class CertVerifier; 32 class CertVerifier;
33 class CTPolicyEnforcer; 33 class CTPolicyEnforcer;
34 class CTVerifier; 34 class CTVerifier;
(...skipping 18 matching lines...) Expand all
53 VIDEO_OUT = 1 << 0, 53 VIDEO_OUT = 1 << 0,
54 VIDEO_IN = 1 << 1, 54 VIDEO_IN = 1 << 1,
55 AUDIO_OUT = 1 << 2, 55 AUDIO_OUT = 1 << 2,
56 AUDIO_IN = 1 << 3, 56 AUDIO_IN = 1 << 3,
57 DEV_MODE = 1 << 4 57 DEV_MODE = 1 << 4
58 }; 58 };
59 59
60 // Public interface of the CastSocket class. 60 // Public interface of the CastSocket class.
61 class CastSocket : public ApiResource { 61 class CastSocket : public ApiResource {
62 public: 62 public:
63 using ChannelError = ::cast_channel::ChannelError;
64 using ChannelAuthType = ::cast_channel::ChannelAuthType;
65 using ReadyState = ::cast_channel::ReadyState;
66
63 explicit CastSocket(const std::string& owner_extension_id); 67 explicit CastSocket(const std::string& owner_extension_id);
64 ~CastSocket() override {} 68 ~CastSocket() override {}
65 69
66 // Used by BrowserContextKeyedAPIFactory. 70 // Used by BrowserContextKeyedAPIFactory.
67 static const char* service_name() { return "CastSocketImplManager"; } 71 static const char* service_name() { return "CastSocketImplManager"; }
68 72
69 // Connects the channel to the peer. If successful, the channel will be in 73 // Connects the channel to the peer. If successful, the channel will be in
70 // READY_STATE_OPEN. DO NOT delete the CastSocket object in |callback|. 74 // READY_STATE_OPEN. DO NOT delete the CastSocket object in |callback|.
71 // Instead use Close(). 75 // Instead use Close().
72 // |callback| will be invoked with any ChannelError that occurred, or 76 // |callback| will be invoked with any ChannelError that occurred, or
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // information. 405 // information.
402 AuthTransportDelegate* auth_delegate_; 406 AuthTransportDelegate* auth_delegate_;
403 407
404 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl); 408 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl);
405 }; 409 };
406 } // namespace cast_channel 410 } // namespace cast_channel
407 } // namespace api 411 } // namespace api
408 } // namespace extensions 412 } // namespace extensions
409 413
410 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ 414 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698