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

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

Issue 477343002: Revert "Add IPC benchmarking API to Blink TestRunner" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « content/shell/renderer/ipc_echo.h ('k') | content/shell/renderer/test_runner/WebTestDelegate.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 2014 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 #include "content/shell/renderer/ipc_echo.h"
6
7 #include "base/logging.h"
8 #include "content/shell/common/shell_messages.h"
9 #include "ipc/ipc_sender.h"
10 #include "third_party/WebKit/public/web/WebDOMCustomEvent.h"
11 #include "third_party/WebKit/public/web/WebDOMEvent.h"
12 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
13
14 namespace content {
15
16 IPCEcho::IPCEcho(blink::WebDocument document,
17 IPC::Sender* sender,
18 int routing_id)
19 : document_(document), sender_(sender), routing_id_(routing_id),
20 last_echo_id_(0) {
21 }
22
23 void IPCEcho::RequestEcho(int id, int size) {
24 sender_->Send(new ShellViewHostMsg_EchoPing(
25 routing_id_, id, std::string(size, '*')));
26 }
27
28 void IPCEcho::DidRespondEcho(int id, int size) {
29 last_echo_id_ = id;
30 last_echo_size_ = size;
31 blink::WebString eventName = blink::WebString::fromUTF8("CustomEvent");
32 blink::WebString eventType = blink::WebString::fromUTF8("pong");
33 blink::WebDOMEvent event = document_.createEvent(eventName);
34 event.to<blink::WebDOMCustomEvent>().initCustomEvent(
35 eventType, false, false, blink::WebSerializedScriptValue());
36 document_.dispatchEvent(event);
37 }
38
39 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/ipc_echo.h ('k') | content/shell/renderer/test_runner/WebTestDelegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698