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

Side by Side Diff: content/public/browser/presentation_session_message.h

Issue 1118103002: Implements ListenForSessionMessages in PresentationServiceImpl; uses Swap to avoid copying large da… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_MESSAGE_H_
6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_MESSAGE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/memory/scoped_ptr.h"
12 #include "content/common/content_export.h"
13
14 namespace content {
15
16 // Represents a presentation session message.
17 // If this is a text message, |data| is null; otherwise, |message| is null.
18 // Empty messages are allowed.
19 struct CONTENT_EXPORT PresentationSessionMessage {
20 public:
21 ~PresentationSessionMessage();
22
23 // Creates string message, which takes the ownership of |message|.
24 static scoped_ptr<PresentationSessionMessage> CreateStringMessage(
25 const std::string& presentation_url,
26 const std::string& presentation_id,
27 scoped_ptr<std::string> message);
28
29 // Creates binary message, which takes the ownership of |data|.
30 static scoped_ptr<PresentationSessionMessage> CreateBinaryMessage(
31 const std::string& presentation_url,
32 const std::string& presentation_id,
33 scoped_ptr<std::vector<uint8_t>> data);
34
35 bool is_binary() const;
36 std::string presentation_url;
37 std::string presentation_id;
38 scoped_ptr<std::string> message;
39 scoped_ptr<std::vector<uint8_t>> data;
40
41 private:
42 PresentationSessionMessage(const std::string& presentation_url,
43 const std::string& presentation_id,
44 scoped_ptr<std::string> message);
45 PresentationSessionMessage(const std::string& presentation_url,
46 const std::string& presentation_id,
47 scoped_ptr<std::vector<uint8_t>> data);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_
OLDNEW
« no previous file with comments | « content/public/browser/presentation_service_delegate.h ('k') | content/public/browser/presentation_session_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698