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

Side by Side Diff: content/shell/renderer/ipc_echo.h

Issue 478483005: Add IPC benchmarking API to Blink TestRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 6 years, 4 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 | « content/shell/renderer/binding_helpers.h ('k') | content/shell/renderer/ipc_echo.cc » ('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 2013 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_SHELL_IPC_ECHO_H_
6 #define CONTENT_SHELL_IPC_ECHO_H_
7
8 #include <utility>
9 #include <vector>
10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h"
12 #include "third_party/WebKit/public/web/WebDocument.h"
13
14 namespace blink {
15 class WebFrame;
16 }
17
18 namespace IPC {
19 class Sender;
20 }
21
22 namespace content {
23
24 // This class is for writing micro benchmarks exercising underlying
25 // IPC::Channel using HTML and JavaScript.
26 //
27 // TODO(morrita): The benchmark effort tries to makesure that
28 // IPC::ChannelMojo is as performant as native IPC::Channel
29 // implementations. Currently IPC::ChannelMojo is hidden behind
30 // "--enable-renderer-mojo-channel". Once it is turned on by default.
31 // we no longer need this class and should remove it.
32 class IPCEcho : public base::SupportsWeakPtr<IPCEcho> {
33 public:
34 IPCEcho(blink::WebDocument document, IPC::Sender* sender, int routing_id);
35 ~IPCEcho();
36
37 void RequestEcho(int id, int size);
38 void DidRespondEcho(int id, int size);
39 void Install(blink::WebFrame*);
40
41 int last_echo_id() const { return last_echo_id_; }
42 int last_echo_size() const { return last_echo_size_; }
43
44 base::WeakPtrFactory<IPCEcho> weak_factory_;
45 blink::WebDocument document_;
46 IPC::Sender* sender_;
47 int routing_id_;
48 int last_echo_id_;
49 int last_echo_size_;
50 };
51
52 } // namespace content
53
54 #endif // CONTENT_SHELL_IPC_ECHO_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/shell/renderer/binding_helpers.h ('k') | content/shell/renderer/ipc_echo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698