Skip to content

Commit 7dbed7a

Browse files
committed
trying to follow cspot...
1 parent dc62afd commit 7dbed7a

36 files changed

+621
-420
lines changed

components/spotify/cspot/include/AccessKeyFetcher.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#pragma once
22

3-
#include <functional>
4-
#include <memory>
5-
6-
#include "CSpotContext.h"
7-
#include "Utils.h"
3+
#include <functional> // for function
4+
#include <memory> // for shared_ptr
5+
#include <string> // for string
86

97
namespace cspot {
8+
struct Context;
9+
1010
class AccessKeyFetcher {
1111
public:
1212
AccessKeyFetcher(std::shared_ptr<cspot::Context> ctx);

components/spotify/cspot/include/ApResolve.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#pragma once
22

3-
#include <memory>
4-
#include <string>
5-
6-
#include "HTTPClient.h"
3+
#include <string> // for string
74
#ifdef BELL_ONLY_CJSON
85
#include "cJSON.h"
96
#else
10-
#include "nlohmann/json.hpp"
117
#endif
128

139
namespace cspot {

components/spotify/cspot/include/AuthChallenges.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
#pragma once
22

33

4-
#include <algorithm>
5-
#include <climits>
6-
#include <functional>
7-
#include <memory>
8-
#include <random>
9-
#include <vector>
10-
11-
#include "Crypto.h"
12-
#include "Logger.h"
13-
#include "NanoPBHelper.h"
14-
#include "Utils.h"
15-
16-
#include "protobuf/authentication.pb.h"
17-
#include "protobuf/keyexchange.pb.h"
4+
#include <cstdint> // for uint8_t
5+
#include <memory> // for unique_ptr
6+
#include <string> // for string
7+
#include <vector> // for vector
8+
9+
#include "Crypto.h" // for Crypto
10+
#include "protobuf/authentication.pb.h" // for ClientResponseEncrypted
11+
#include "protobuf/keyexchange.pb.h" // for APResponseMessage, ClientHello
1812

1913
namespace cspot {
2014
class AuthChallenges {

components/spotify/cspot/include/CDNTrackStream.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
#pragma once
22

3-
#include <cstddef>
4-
#include <memory>
5-
#include "Crypto.h"
6-
#include "WrappedSemaphore.h"
3+
#include <cstddef> // for size_t
4+
#include <cstdint> // for uint8_t
5+
#include <memory> // for shared_ptr, unique_ptr
6+
#include <string> // for string
7+
#include <vector> // for vector
78

8-
#include "Logger.h"
9-
#include "Utils.h"
10-
#include "CSpotContext.h"
11-
#include "AccessKeyFetcher.h"
9+
#include "Crypto.h" // for Crypto
10+
#include "HTTPClient.h" // for HTTPClient
11+
12+
namespace bell {
13+
class WrappedSemaphore;
14+
} // namespace bell
1215

1316
namespace cspot {
17+
class AccessKeyFetcher;
1418

1519
class CDNTrackStream {
1620

components/spotify/cspot/include/CSpotContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "MercurySession.h"
66
#include "TimeProvider.h"
77
#include "protobuf/metadata.pb.h"
8+
#include "LoginBlob.h"
89

910
namespace cspot {
1011
struct Context {

components/spotify/cspot/include/LoginBlob.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
#pragma once
22

3-
#include <iostream>
4-
#include <map>
5-
#include <memory>
6-
#ifndef BELL_ONLY_CJSON
7-
#include <nlohmann/json.hpp>
8-
#endif
9-
#include <vector>
10-
11-
#include "ConstantParameters.h"
12-
#include "Crypto.h"
13-
14-
#include "protobuf/authentication.pb.h"
3+
#include <cstdint> // for uint8_t, uint32_t
4+
#include <map> // for map
5+
#include <memory> // for unique_ptr
6+
#include <string> // for string
7+
#include <vector> // for vector
8+
9+
#include "Crypto.h" // for CryptoMbedTLS, Crypto
1510

1611
namespace cspot {
1712
class LoginBlob {

components/spotify/cspot/include/MercurySession.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
#pragma once
22

3-
#include <atomic>
4-
#include <functional>
5-
#include <memory>
6-
#include <string>
7-
#include <unordered_map>
8-
#include <vector>
9-
#include "BellTask.h"
10-
#include "Logger.h"
11-
#include "NanoPBHelper.h"
12-
#include "Packet.h"
13-
#include "Queue.h"
14-
#include "Session.h"
15-
#include "TimeProvider.h"
16-
#include "Utils.h"
17-
#include "protobuf/mercury.pb.h"
3+
#include <atomic> // for atomic
4+
#include <cstdint> // for uint8_t, uint64_t, uint32_t
5+
#include <functional> // for function
6+
#include <memory> // for shared_ptr
7+
#include <mutex> // for mutex
8+
#include <string> // for string
9+
#include <unordered_map> // for unordered_map
10+
#include <vector> // for vector
11+
12+
#include "BellTask.h" // for Task
13+
#include "Packet.h" // for Packet
14+
#include "Queue.h" // for Queue
15+
#include "Session.h" // for Session
16+
#include "protobuf/mercury.pb.h" // for Header
1817

1918
namespace cspot {
19+
class TimeProvider;
20+
2021
class MercurySession : public bell::Task, public cspot::Session {
2122
public:
2223
MercurySession(std::shared_ptr<cspot::TimeProvider> timeProvider);

components/spotify/cspot/include/PlainConnection.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@
33
#ifdef _WIN32
44
#include <winsock2.h>
55
#include <ws2tcpip.h>
6+
67
#include "win32shim.h"
78
#else
8-
#include <netdb.h>
9-
#include <unistd.h>
10-
#include "sys/socket.h"
11-
#include <netinet/in.h>
9+
#include <unistd.h> // for size_t
1210
#endif
13-
#include <cstdint>
14-
#include <functional>
15-
#include <string>
16-
#include <vector>
17-
#include "Packet.h"
18-
#include "Utils.h"
11+
#include <cstdint> // for uint8_t
12+
#include <functional> // for function
13+
#include <string> // for string
14+
#include <vector> // for vector
1915

2016
typedef std::function<bool()> timeoutCallback;
2117

components/spotify/cspot/include/PlaybackState.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
#pragma once
22

3-
#include <NanoPBHelper.h>
4-
#include <memory>
5-
#include <string>
6-
#include <vector>
7-
#include "CSpotContext.h"
8-
#include "ConstantParameters.h"
9-
#include "CspotAssert.h"
10-
#include "TimeProvider.h"
11-
#include "Utils.h"
12-
13-
#include "protobuf/spirc.pb.h"
3+
#include <stdint.h> // for uint8_t, uint32_t
4+
#include <memory> // for shared_ptr
5+
#include <string> // for string
6+
#include <vector> // for vector
7+
8+
#include "protobuf/spirc.pb.h" // for Frame, TrackRef, CapabilityType, Mess...
149

1510
namespace cspot {
11+
struct Context;
1612

1713
class PlaybackState {
1814
private:

components/spotify/cspot/include/Session.h

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
#pragma once
22

3-
#include <algorithm>
4-
#include <functional>
5-
#include <memory>
6-
#include <vector>
7-
8-
#include "ApResolve.h"
9-
#include "AuthChallenges.h"
10-
#include "ConstantParameters.h"
11-
#include "Logger.h"
12-
#include "LoginBlob.h"
13-
#include "Packet.h"
14-
#include "PlainConnection.h"
15-
#include "ShannonConnection.h"
16-
#include "Utils.h"
17-
#include "protobuf/mercury.pb.h"
3+
#include <stdint.h> // for uint8_t
4+
#include <memory> // for shared_ptr, unique_ptr
5+
#include <string> // for string
6+
#include <vector> // for vector
7+
8+
namespace cspot {
9+
class AuthChallenges;
10+
class LoginBlob;
11+
class PlainConnection;
12+
class ShannonConnection;
13+
} // namespace cspot
1814

1915
#define LOGIN_REQUEST_COMMAND 0xAB
2016
#define AUTH_SUCCESSFUL_COMMAND 0xAC

0 commit comments

Comments
 (0)