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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Rebase Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 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 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 WebFrame* source_frame = NULL; 2208 WebFrame* source_frame = NULL;
2209 if (params.source_routing_id != MSG_ROUTING_NONE) { 2209 if (params.source_routing_id != MSG_ROUTING_NONE) {
2210 RenderFrameProxy* source_proxy = 2210 RenderFrameProxy* source_proxy =
2211 RenderFrameProxy::FromRoutingID(params.source_routing_id); 2211 RenderFrameProxy::FromRoutingID(params.source_routing_id);
2212 if (source_proxy) 2212 if (source_proxy)
2213 source_frame = source_proxy->web_frame(); 2213 source_frame = source_proxy->web_frame();
2214 } 2214 }
2215 2215
2216 // If the message contained MessagePorts, create the corresponding endpoints. 2216 // If the message contained MessagePorts, create the corresponding endpoints.
2217 blink::WebMessagePortChannelArray channels = 2217 blink::WebMessagePortChannelArray channels =
2218 WebMessagePortChannelImpl::CreatePorts( 2218 WebMessagePortChannelImpl::CreateFromMessagePorts(params.message_ports);
2219 params.message_ports, params.new_routing_ids,
2220 base::ThreadTaskRunnerHandle::Get().get());
2221 2219
2222 WebSerializedScriptValue serialized_script_value; 2220 WebSerializedScriptValue serialized_script_value;
2223 if (params.is_data_raw_string) { 2221 if (params.is_data_raw_string) {
2224 v8::HandleScope handle_scope(blink::mainThreadIsolate()); 2222 v8::HandleScope handle_scope(blink::mainThreadIsolate());
2225 v8::Local<v8::Context> context = frame_->mainWorldScriptContext(); 2223 v8::Local<v8::Context> context = frame_->mainWorldScriptContext();
2226 v8::Context::Scope context_scope(context); 2224 v8::Context::Scope context_scope(context);
2227 V8ValueConverterImpl converter; 2225 V8ValueConverterImpl converter;
2228 converter.SetDateAllowed(true); 2226 converter.SetDateAllowed(true);
2229 converter.SetRegExpAllowed(true); 2227 converter.SetRegExpAllowed(true);
2230 std::unique_ptr<base::Value> value(new base::StringValue(params.data)); 2228 std::unique_ptr<base::Value> value(new base::StringValue(params.data));
(...skipping 4634 matching lines...) Expand 10 before | Expand all | Expand 10 after
6865 // event target. Potentially a Pepper plugin will receive the event. 6863 // event target. Potentially a Pepper plugin will receive the event.
6866 // In order to tell whether a plugin gets the last mouse event and which it 6864 // In order to tell whether a plugin gets the last mouse event and which it
6867 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6865 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6868 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6866 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6869 // |pepper_last_mouse_event_target_|. 6867 // |pepper_last_mouse_event_target_|.
6870 pepper_last_mouse_event_target_ = nullptr; 6868 pepper_last_mouse_event_target_ = nullptr;
6871 #endif 6869 #endif
6872 } 6870 }
6873 6871
6874 } // namespace content 6872 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698