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

Side by Side Diff: Source/core/dom/MessagePort.cpp

Issue 924983002: Expose v8 context a MessagePort lives in to give content side code a valid context to (de)serialize… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use a separate (per-MessagePort) v8::Context Created 5 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
« no previous file with comments | « Source/core/dom/MessagePort.h ('k') | public/platform/WebMessagePortChannelClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 259 }
260 return portArray.release(); 260 return portArray.release();
261 } 261 }
262 262
263 DEFINE_TRACE(MessagePort) 263 DEFINE_TRACE(MessagePort)
264 { 264 {
265 ActiveDOMObject::trace(visitor); 265 ActiveDOMObject::trace(visitor);
266 EventTargetWithInlineData::trace(visitor); 266 EventTargetWithInlineData::trace(visitor);
267 } 267 }
268 268
269 v8::Isolate* MessagePort::scriptIsolate()
270 {
271 ASSERT(executionContext());
272 return toIsolate(executionContext());
273 }
274
275 v8::Handle<v8::Context> MessagePort::scriptContextForMessageConversion()
276 {
277 ASSERT(executionContext());
278 if (!m_scriptStateForConversion) {
279 v8::Isolate* isolate = scriptIsolate();
280 m_scriptStateForConversion = ScriptState::create(v8::Context::New(isolat e), DOMWrapperWorld::create(isolate));
haraken 2015/02/25 18:40:33 You need to call: m_scriptStateForConversion->d
Marijn Kruisselbrink 2015/02/25 18:45:09 Done.
281 }
282 return m_scriptStateForConversion->context();
283 }
284
269 } // namespace blink 285 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/MessagePort.h ('k') | public/platform/WebMessagePortChannelClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698