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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp

Issue 1836193002: [Binding] Do not install document into hidden Window object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop document from a hidden value list Created 4 years, 8 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 | « third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h ('k') | no next file » | 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, 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 return; 424 return;
425 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp ty()); 425 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp ty());
426 if (m_document.isEmpty()) 426 if (m_document.isEmpty())
427 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); 427 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper));
428 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); 428 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document());
429 429
430 ASSERT(documentWrapper->IsObject()); 430 ASSERT(documentWrapper->IsObject());
431 // TODO(jochen): Don't replace the accessor with a data value. We need a way to tell v8 that the accessor's return value won't change after this point. 431 // TODO(jochen): Don't replace the accessor with a data value. We need a way to tell v8 that the accessor's return value won't change after this point.
432 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO nly | v8::DontDelete)))) 432 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO nly | v8::DontDelete))))
433 return; 433 return;
434
435 // We also stash a reference to the document on the inner global object so t hat
436 // LocalDOMWindow objects we obtain from JavaScript references are guarantee d to have
437 // live Document objects.
438 V8HiddenValue::setHiddenValue(m_scriptState.get(), toInnerGlobalObject(conte xt), V8HiddenValue::document(m_isolate), documentWrapper);
439 } 434 }
440 435
441 void WindowProxy::updateActivityLogger() 436 void WindowProxy::updateActivityLogger()
442 { 437 {
443 m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::acti vityLogger( 438 m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::acti vityLogger(
444 m_world->worldId(), m_frame->isLocalFrame() && toLocalFrame(m_frame)->do cument() ? toLocalFrame(m_frame)->document()->baseURI() : KURL())); 439 m_world->worldId(), m_frame->isLocalFrame() && toLocalFrame(m_frame)->do cument() ? toLocalFrame(m_frame)->document()->baseURI() : KURL()));
445 } 440 }
446 441
447 void WindowProxy::setSecurityToken(SecurityOrigin* origin) 442 void WindowProxy::setSecurityToken(SecurityOrigin* origin)
448 { 443 {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 574 }
580 575
581 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 576 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
582 { 577 {
583 if (!isContextInitialized()) 578 if (!isContextInitialized())
584 return; 579 return;
585 setSecurityToken(origin); 580 setSecurityToken(origin);
586 } 581 }
587 582
588 } // namespace blink 583 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698