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

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

Issue 2709523008: [Cast Channel] Add support for nonce challenge to Cast channel authentication. (Closed)
Patch Set: Rebase-only Created 3 years, 9 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_MESSAGE_UTIL_H_ 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace extensions { 10 namespace extensions {
11 namespace api { 11 namespace api {
12 namespace cast_channel { 12 namespace cast_channel {
13 13
14 class AuthContext;
14 class CastMessage; 15 class CastMessage;
15 class DeviceAuthMessage; 16 class DeviceAuthMessage;
16 struct MessageInfo; 17 struct MessageInfo;
17 18
18 // Fills |message_proto| from |message| and returns true on success. 19 // Fills |message_proto| from |message| and returns true on success.
19 bool MessageInfoToCastMessage(const MessageInfo& message, 20 bool MessageInfoToCastMessage(const MessageInfo& message,
20 CastMessage* message_proto); 21 CastMessage* message_proto);
21 22
22 // Checks if the contents of |message_proto| are valid. 23 // Checks if the contents of |message_proto| are valid.
23 bool IsCastMessageValid(const CastMessage& message_proto); 24 bool IsCastMessageValid(const CastMessage& message_proto);
24 25
25 // Fills |message| from |message_proto| and returns true on success. 26 // Fills |message| from |message_proto| and returns true on success.
26 bool CastMessageToMessageInfo(const CastMessage& message_proto, 27 bool CastMessageToMessageInfo(const CastMessage& message_proto,
27 MessageInfo* message); 28 MessageInfo* message);
28 29
29 // Returns a human readable string for |message_proto|. 30 // Returns a human readable string for |message_proto|.
30 std::string CastMessageToString(const CastMessage& message_proto); 31 std::string CastMessageToString(const CastMessage& message_proto);
31 32
32 // Returns a human readable string for |message|. 33 // Returns a human readable string for |message|.
33 std::string AuthMessageToString(const DeviceAuthMessage& message); 34 std::string AuthMessageToString(const DeviceAuthMessage& message);
34 35
35 // Fills |message_proto| appropriately for an auth challenge request message. 36 // Fills |message_proto| appropriately for an auth challenge request message.
36 void CreateAuthChallengeMessage(CastMessage* message_proto); 37 // Uses the nonce challenge in |auth_context|.
38 void CreateAuthChallengeMessage(CastMessage* message_proto,
39 const AuthContext& auth_context);
37 40
38 // Returns whether the given message is an auth handshake message. 41 // Returns whether the given message is an auth handshake message.
39 bool IsAuthMessage(const CastMessage& message); 42 bool IsAuthMessage(const CastMessage& message);
40 43
41 } // namespace cast_channel 44 } // namespace cast_channel
42 } // namespace api 45 } // namespace api
43 } // namespace extensions 46 } // namespace extensions
44 47
45 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ 48 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698