OLD | NEW |
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 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 WebMessagePortChannelImpl::CreateFromMessagePorts(params.message_ports); | 2234 WebMessagePortChannelImpl::CreateFromMessagePorts(params.message_ports); |
2235 | 2235 |
2236 WebSerializedScriptValue serialized_script_value; | 2236 WebSerializedScriptValue serialized_script_value; |
2237 if (params.is_data_raw_string) { | 2237 if (params.is_data_raw_string) { |
2238 v8::HandleScope handle_scope(blink::mainThreadIsolate()); | 2238 v8::HandleScope handle_scope(blink::mainThreadIsolate()); |
2239 v8::Local<v8::Context> context = frame_->mainWorldScriptContext(); | 2239 v8::Local<v8::Context> context = frame_->mainWorldScriptContext(); |
2240 v8::Context::Scope context_scope(context); | 2240 v8::Context::Scope context_scope(context); |
2241 V8ValueConverterImpl converter; | 2241 V8ValueConverterImpl converter; |
2242 converter.SetDateAllowed(true); | 2242 converter.SetDateAllowed(true); |
2243 converter.SetRegExpAllowed(true); | 2243 converter.SetRegExpAllowed(true); |
2244 std::unique_ptr<base::Value> value(new base::StringValue(params.data)); | 2244 std::unique_ptr<base::Value> value(new base::Value(params.data)); |
2245 v8::Local<v8::Value> result_value = converter.ToV8Value(value.get(), | 2245 v8::Local<v8::Value> result_value = converter.ToV8Value(value.get(), |
2246 context); | 2246 context); |
2247 serialized_script_value = WebSerializedScriptValue::serialize(result_value); | 2247 serialized_script_value = WebSerializedScriptValue::serialize(result_value); |
2248 } else { | 2248 } else { |
2249 serialized_script_value = | 2249 serialized_script_value = |
2250 WebSerializedScriptValue::fromString(WebString::fromUTF16(params.data)); | 2250 WebSerializedScriptValue::fromString(WebString::fromUTF16(params.data)); |
2251 } | 2251 } |
2252 | 2252 |
2253 // We must pass in the target_origin to do the security check on this side, | 2253 // We must pass in the target_origin to do the security check on this side, |
2254 // since it may have changed since the original postMessage call was made. | 2254 // since it may have changed since the original postMessage call was made. |
(...skipping 4604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6859 // event target. Potentially a Pepper plugin will receive the event. | 6859 // event target. Potentially a Pepper plugin will receive the event. |
6860 // In order to tell whether a plugin gets the last mouse event and which it | 6860 // In order to tell whether a plugin gets the last mouse event and which it |
6861 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6861 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6862 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6862 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6863 // |pepper_last_mouse_event_target_|. | 6863 // |pepper_last_mouse_event_target_|. |
6864 pepper_last_mouse_event_target_ = nullptr; | 6864 pepper_last_mouse_event_target_ = nullptr; |
6865 #endif | 6865 #endif |
6866 } | 6866 } |
6867 | 6867 |
6868 } // namespace content | 6868 } // namespace content |
OLD | NEW |