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

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

Issue 1367333002: Remove WebDocument::createEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/ipc_echo.h" 5 #include "content/shell/renderer/ipc_echo.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/shell/common/shell_messages.h" 9 #include "content/shell/common/shell_messages.h"
10 #include "gin/handle.h" 10 #include "gin/handle.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 105
106 void IPCEcho::RequestEcho(int id, int size) { 106 void IPCEcho::RequestEcho(int id, int size) {
107 sender_->Send(new ShellViewHostMsg_EchoPing( 107 sender_->Send(new ShellViewHostMsg_EchoPing(
108 routing_id_, id, std::string(size, '*'))); 108 routing_id_, id, std::string(size, '*')));
109 } 109 }
110 110
111 void IPCEcho::DidRespondEcho(int id, int size) { 111 void IPCEcho::DidRespondEcho(int id, int size) {
112 last_echo_id_ = id; 112 last_echo_id_ = id;
113 last_echo_size_ = size; 113 last_echo_size_ = size;
114 blink::WebString eventName = blink::WebString::fromUTF8("CustomEvent"); 114 document_.dispatchEvent(blink::WebDOMCustomEvent("pong"));
115 blink::WebString eventType = blink::WebString::fromUTF8("pong");
116 blink::WebDOMEvent event = document_.createEvent(eventName);
117 event.to<blink::WebDOMCustomEvent>().initCustomEvent(
118 eventType, false, false, blink::WebSerializedScriptValue());
119 document_.dispatchEvent(event);
120 } 115 }
121 116
122 void IPCEcho::Install(blink::WebFrame* frame) { 117 void IPCEcho::Install(blink::WebFrame* frame) {
123 IPCEchoBindings::Install(weak_factory_.GetWeakPtr(), frame); 118 IPCEchoBindings::Install(weak_factory_.GetWeakPtr(), frame);
124 } 119 }
125 120
126 } // namespace content 121 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | third_party/WebKit/Source/web/WebDOMCustomEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698