summaryrefslogtreecommitdiffstats
path: root/content/public/browser/presentation_session_message.h
blob: 788b136a346e866c9d0bf54f352bdee46a6682f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_MESSAGE_H_
#define CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_MESSAGE_H_

#include <stdint.h>

#include <string>
#include <vector>

#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"

namespace content {

enum PresentationMessageType {
  TEXT,
  ARRAY_BUFFER,
  BLOB,
};

// Represents a presentation session message.
// If this is a text message, |data| is null; otherwise, |message| is null.
// Empty messages are allowed.
struct CONTENT_EXPORT PresentationSessionMessage {
 public:
  explicit PresentationSessionMessage(PresentationMessageType type);
  ~PresentationSessionMessage();

  bool is_binary() const;
  const PresentationMessageType type;
  std::string message;
  scoped_ptr<std::vector<uint8_t>> data;
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_