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

Side by Side Diff: content/public/common/presentation_session.h

Issue 2613153003: [Presentation API] Replaces type converters with typemaps (Closed)
Patch Set: Extend presentation ID max length to 64. Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_PUBLIC_COMMON_PRESENTATION_SESSION_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_PRESENTATION_SESSION_H_
6 #define CONTENT_PUBLIC_COMMON_PRESENTATION_SESSION_H_ 6 #define CONTENT_PUBLIC_COMMON_PRESENTATION_SESSION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 13 matching lines...) Expand all
24 enum PresentationConnectionCloseReason { 24 enum PresentationConnectionCloseReason {
25 PRESENTATION_CONNECTION_CLOSE_REASON_CONNECTION_ERROR, 25 PRESENTATION_CONNECTION_CLOSE_REASON_CONNECTION_ERROR,
26 PRESENTATION_CONNECTION_CLOSE_REASON_CLOSED, 26 PRESENTATION_CONNECTION_CLOSE_REASON_CLOSED,
27 PRESENTATION_CONNECTION_CLOSE_REASON_WENT_AWAY 27 PRESENTATION_CONNECTION_CLOSE_REASON_WENT_AWAY
28 }; 28 };
29 29
30 // TODO(imcheng): Rename to PresentationConnectionInfo. 30 // TODO(imcheng): Rename to PresentationConnectionInfo.
31 // Represents a presentation session that has been established via either 31 // Represents a presentation session that has been established via either
32 // browser actions or Presentation API. 32 // browser actions or Presentation API.
33 struct CONTENT_EXPORT PresentationSessionInfo { 33 struct CONTENT_EXPORT PresentationSessionInfo {
34 PresentationSessionInfo() = default;
34 PresentationSessionInfo(const GURL& presentation_url, 35 PresentationSessionInfo(const GURL& presentation_url,
35 const std::string& presentation_id); 36 const std::string& presentation_id);
36 ~PresentationSessionInfo(); 37 ~PresentationSessionInfo();
37 38
38 const GURL presentation_url; 39 static constexpr size_t kMaxIdLength = 64;
39 const std::string presentation_id; 40
41 GURL presentation_url;
42 std::string presentation_id;
40 }; 43 };
41 44
42 // Possible reasons why an attempt to create a presentation session failed. 45 // Possible reasons why an attempt to create a presentation session failed.
43 enum PresentationErrorType { 46 enum PresentationErrorType {
44 PRESENTATION_ERROR_NO_AVAILABLE_SCREENS, 47 PRESENTATION_ERROR_NO_AVAILABLE_SCREENS,
45 PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED, 48 PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED,
46 PRESENTATION_ERROR_NO_PRESENTATION_FOUND, 49 PRESENTATION_ERROR_NO_PRESENTATION_FOUND,
47 PRESENTATION_ERROR_PREVIOUS_START_IN_PROGRESS, 50 PRESENTATION_ERROR_PREVIOUS_START_IN_PROGRESS,
48 PRESENTATION_ERROR_UNKNOWN, 51 PRESENTATION_ERROR_UNKNOWN,
49 }; 52 };
50 53
51 // Struct returned when an attempt to create a presentation session failed. 54 // Struct returned when an attempt to create a presentation session failed.
52 struct CONTENT_EXPORT PresentationError { 55 struct CONTENT_EXPORT PresentationError {
56 PresentationError() = default;
53 PresentationError(PresentationErrorType error_type, 57 PresentationError(PresentationErrorType error_type,
54 const std::string& message); 58 const std::string& message);
55 ~PresentationError(); 59 ~PresentationError();
56 60
57 const PresentationErrorType error_type; 61 static constexpr size_t kMaxMessageLength = 256;
58 const std::string message; 62
63 PresentationErrorType error_type;
64 std::string message;
59 }; 65 };
60 66
61 } // namespace content 67 } // namespace content
62 68
63 #endif // CONTENT_PUBLIC_COMMON_PRESENTATION_SESSION_H_ 69 #endif // CONTENT_PUBLIC_COMMON_PRESENTATION_SESSION_H_
OLDNEW
« no previous file with comments | « content/common/presentation/typemaps.gni ('k') | content/renderer/presentation/presentation_connection_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698