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

Side by Side Diff: Source/bindings/v8/V8WindowShell.cpp

Issue 303363002: Fix toV8 and ExceptionState with empty context. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 m_document.set(m_isolate, wrapper); 331 m_document.set(m_isolate, wrapper);
332 } 332 }
333 333
334 void V8WindowShell::updateDocumentProperty() 334 void V8WindowShell::updateDocumentProperty()
335 { 335 {
336 if (!m_world->isMainWorld()) 336 if (!m_world->isMainWorld())
337 return; 337 return;
338 338
339 ScriptState::Scope scope(m_scriptState.get()); 339 ScriptState::Scope scope(m_scriptState.get());
340 v8::Handle<v8::Context> context = m_scriptState->context(); 340 v8::Handle<v8::Context> context = m_scriptState->context();
341 v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), v8::Handle <v8::Object>(), context->GetIsolate()); 341 v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), context->G lobal(), context->GetIsolate());
342 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp ty()); 342 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp ty());
343 if (m_document.isEmpty()) 343 if (m_document.isEmpty())
344 updateDocumentWrapper(v8::Handle<v8::Object>::Cast(documentWrapper)); 344 updateDocumentWrapper(v8::Handle<v8::Object>::Cast(documentWrapper));
345 checkDocumentWrapper(m_document.newLocal(m_isolate), m_frame->document()); 345 checkDocumentWrapper(m_document.newLocal(m_isolate), m_frame->document());
346 346
347 // If instantiation of the document wrapper fails, clear the cache 347 // If instantiation of the document wrapper fails, clear the cache
348 // and let the DOMWindow accessor handle access to the document. 348 // and let the DOMWindow accessor handle access to the document.
349 if (documentWrapper.IsEmpty()) { 349 if (documentWrapper.IsEmpty()) {
350 clearDocumentProperty(); 350 clearDocumentProperty();
351 return; 351 return;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin) 485 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin)
486 { 486 {
487 ASSERT(m_world->isMainWorld()); 487 ASSERT(m_world->isMainWorld());
488 if (!isContextInitialized()) 488 if (!isContextInitialized())
489 return; 489 return;
490 setSecurityToken(origin); 490 setSecurityToken(origin);
491 } 491 }
492 492
493 } // WebCore 493 } // WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptDebugServer.cpp ('k') | Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698