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

Side by Side Diff: Source/bindings/core/v8/custom/V8WindowCustom.cpp

Issue 538933002: ScriptState::contextIsEmpty shouldn't return true for a context whose global object is detached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 m_scriptStateForDialogFrame = ScriptState::from(context); 327 m_scriptStateForDialogFrame = ScriptState::from(context);
328 328
329 ScriptState::Scope scope(m_scriptStateForDialogFrame.get()); 329 ScriptState::Scope scope(m_scriptStateForDialogFrame.get());
330 m_scriptStateForDialogFrame->context()->Global()->Set(v8AtomicString(m_scrip tState->isolate(), "dialogArguments"), m_dialogArguments); 330 m_scriptStateForDialogFrame->context()->Global()->Set(v8AtomicString(m_scrip tState->isolate(), "dialogArguments"), m_dialogArguments);
331 } 331 }
332 332
333 v8::Handle<v8::Value> DialogHandler::returnValue() const 333 v8::Handle<v8::Value> DialogHandler::returnValue() const
334 { 334 {
335 if (!m_scriptStateForDialogFrame) 335 if (!m_scriptStateForDialogFrame)
336 return v8Undefined(); 336 return v8Undefined();
337 ASSERT(!m_scriptStateForDialogFrame->contextIsEmpty()); 337 ASSERT(!m_scriptStateForDialogFrame->contextIsValid());
338 338
339 v8::Isolate* isolate = m_scriptStateForDialogFrame->isolate(); 339 v8::Isolate* isolate = m_scriptStateForDialogFrame->isolate();
340 v8::EscapableHandleScope handleScope(isolate); 340 v8::EscapableHandleScope handleScope(isolate);
341 ScriptState::Scope scope(m_scriptStateForDialogFrame.get()); 341 ScriptState::Scope scope(m_scriptStateForDialogFrame.get());
342 v8::Local<v8::Value> returnValue = m_scriptStateForDialogFrame->context()->G lobal()->Get(v8AtomicString(isolate, "returnValue")); 342 v8::Local<v8::Value> returnValue = m_scriptStateForDialogFrame->context()->G lobal()->Get(v8AtomicString(isolate, "returnValue"));
343 if (returnValue.IsEmpty()) 343 if (returnValue.IsEmpty())
344 return v8Undefined(); 344 return v8Undefined();
345 return handleScope.Escape(returnValue); 345 return handleScope.Escape(returnValue);
346 } 346 }
347 347
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren t(isolate)); 544 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren t(isolate));
545 if (context.IsEmpty()) 545 if (context.IsEmpty())
546 return v8Undefined(); 546 return v8Undefined();
547 547
548 v8::Handle<v8::Object> global = context->Global(); 548 v8::Handle<v8::Object> global = context->Global();
549 ASSERT(!global.IsEmpty()); 549 ASSERT(!global.IsEmpty());
550 return global; 550 return global;
551 } 551 }
552 552
553 } // namespace blink 553 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/WindowProxy.cpp ('k') | Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698