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

Side by Side Diff: headless/public/headless_tab_socket.h

Issue 2813953002: Add HeadlessTabSocket (Closed)
Patch Set: Change HeadlessTabSocketImpl::SetListener Created 3 years, 8 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
« no previous file with comments | « headless/public/headless_browser_context.h ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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 HEADLESS_PUBLIC_HEADLESS_TAB_SOCKET_H_
6 #define HEADLESS_PUBLIC_HEADLESS_TAB_SOCKET_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "headless/public/headless_export.h"
12
13 namespace headless {
14
15 // A bidirectional communications channel between C++ and JS.
16 class HEADLESS_EXPORT HeadlessTabSocket {
17 public:
18 class HEADLESS_EXPORT Listener {
19 public:
20 Listener() {}
21 virtual ~Listener() {}
22
23 // The |message| may be potentially sent by untrusted web content so it
24 // should be validated carefully.
25 virtual void OnMessageFromTab(const std::string& message) = 0;
26
27 private:
28 DISALLOW_COPY_AND_ASSIGN(Listener);
29 };
30
31 virtual void SendMessageToTab(const std::string& message) = 0;
32
33 virtual void SetListener(Listener* listener) = 0;
34
35 protected:
36 HeadlessTabSocket() {}
37 virtual ~HeadlessTabSocket() {}
38
39 private:
40 DISALLOW_COPY_AND_ASSIGN(HeadlessTabSocket);
41 };
42
43 } // namespace headless
44
45 #endif // HEADLESS_PUBLIC_HEADLESS_TAB_SOCKET_H_
OLDNEW
« no previous file with comments | « headless/public/headless_browser_context.h ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698