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

Side by Side Diff: Source/core/frame/DOMWindow.cpp

Issue 292503006: Oilpan: add [WillBeGarbageCollected] for Node. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + use transition types in XSLTProcessor Created 6 years, 7 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/frame/DOMWindow.h ('k') | Source/core/loader/SinkDocument.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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 356 }
357 357
358 void DOMWindow::clearEventQueue() 358 void DOMWindow::clearEventQueue()
359 { 359 {
360 if (!m_eventQueue) 360 if (!m_eventQueue)
361 return; 361 return;
362 m_eventQueue->close(); 362 m_eventQueue->close();
363 m_eventQueue.clear(); 363 m_eventQueue.clear();
364 } 364 }
365 365
366 PassRefPtr<Document> DOMWindow::createDocument(const String& mimeType, const Doc umentInit& init, bool forceXHTML) 366 PassRefPtrWillBeRawPtr<Document> DOMWindow::createDocument(const String& mimeTyp e, const DocumentInit& init, bool forceXHTML)
367 { 367 {
368 RefPtr<Document> document; 368 RefPtrWillBeRawPtr<Document> document;
369 if (forceXHTML) { 369 if (forceXHTML) {
370 // This is a hack for XSLTProcessor. See XSLTProcessor::createDocumentFr omSource(). 370 // This is a hack for XSLTProcessor. See XSLTProcessor::createDocumentFr omSource().
371 document = Document::create(init); 371 document = Document::create(init);
372 } else { 372 } else {
373 document = DOMImplementation::createDocument(mimeType, init, init.frame( ) ? init.frame()->inViewSourceMode() : false); 373 document = DOMImplementation::createDocument(mimeType, init, init.frame( ) ? init.frame()->inViewSourceMode() : false);
374 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins )) 374 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins ))
375 document = SinkDocument::create(init); 375 document = SinkDocument::create(init);
376 } 376 }
377 377
378 return document.release(); 378 return document.release();
379 } 379 }
380 380
381 PassRefPtr<Document> DOMWindow::installNewDocument(const String& mimeType, const DocumentInit& init, bool forceXHTML) 381 PassRefPtrWillBeRawPtr<Document> DOMWindow::installNewDocument(const String& mim eType, const DocumentInit& init, bool forceXHTML)
382 { 382 {
383 ASSERT(init.frame() == m_frame); 383 ASSERT(init.frame() == m_frame);
384 384
385 clearDocument(); 385 clearDocument();
386 386
387 m_document = createDocument(mimeType, init, forceXHTML); 387 m_document = createDocument(mimeType, init, forceXHTML);
388 m_eventQueue = DOMWindowEventQueue::create(m_document.get()); 388 m_eventQueue = DOMWindowEventQueue::create(m_document.get());
389 m_document->attach(); 389 m_document->attach();
390 390
391 if (!m_frame) 391 if (!m_frame)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 enqueuePopstateEvent(stateObject); 479 enqueuePopstateEvent(stateObject);
480 else 480 else
481 m_pendingStateObject = stateObject; 481 m_pendingStateObject = stateObject;
482 } 482 }
483 483
484 DOMWindow::~DOMWindow() 484 DOMWindow::~DOMWindow()
485 { 485 {
486 ASSERT(m_hasBeenReset); 486 ASSERT(m_hasBeenReset);
487 reset(); 487 reset();
488 488
489 #if ENABLE(OILPAN)
490 clearDocument();
Mads Ager (chromium) 2014/05/23 06:27:29 Why do we have this call to clearDocument in the o
sof 2014/05/23 06:32:58 Oh, clearDocument() not a simple clearing setter.
491 #endif
489 removeAllEventListeners(); 492 removeAllEventListeners();
490 493
491 #if ENABLE(OILPAN) 494 #if !ENABLE(OILPAN)
492 ASSERT(m_document->isDisposed());
493 #else
494 ASSERT(m_document->isStopped()); 495 ASSERT(m_document->isStopped());
496 clearDocument();
495 #endif 497 #endif
496
497 clearDocument();
498 } 498 }
499 499
500 const AtomicString& DOMWindow::interfaceName() const 500 const AtomicString& DOMWindow::interfaceName() const
501 { 501 {
502 return EventTargetNames::DOMWindow; 502 return EventTargetNames::DOMWindow;
503 } 503 }
504 504
505 ExecutionContext* DOMWindow::executionContext() const 505 ExecutionContext* DOMWindow::executionContext() const
506 { 506 {
507 return m_document.get(); 507 return m_document.get();
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>: :lifecycleNotifier()); 1865 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<DOMWindow>: :lifecycleNotifier());
1866 } 1866 }
1867 1867
1868 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier() 1868 PassOwnPtr<LifecycleNotifier<DOMWindow> > DOMWindow::createLifecycleNotifier()
1869 { 1869 {
1870 return DOMWindowLifecycleNotifier::create(this); 1870 return DOMWindowLifecycleNotifier::create(this);
1871 } 1871 }
1872 1872
1873 void DOMWindow::trace(Visitor* visitor) 1873 void DOMWindow::trace(Visitor* visitor)
1874 { 1874 {
1875 visitor->trace(m_document);
1875 visitor->trace(m_screen); 1876 visitor->trace(m_screen);
1876 visitor->trace(m_history); 1877 visitor->trace(m_history);
1877 visitor->trace(m_locationbar); 1878 visitor->trace(m_locationbar);
1878 visitor->trace(m_menubar); 1879 visitor->trace(m_menubar);
1879 visitor->trace(m_personalbar); 1880 visitor->trace(m_personalbar);
1880 visitor->trace(m_scrollbars); 1881 visitor->trace(m_scrollbars);
1881 visitor->trace(m_statusbar); 1882 visitor->trace(m_statusbar);
1882 visitor->trace(m_toolbar); 1883 visitor->trace(m_toolbar);
1883 visitor->trace(m_console); 1884 visitor->trace(m_console);
1884 visitor->trace(m_navigator); 1885 visitor->trace(m_navigator);
1885 visitor->trace(m_location); 1886 visitor->trace(m_location);
1886 visitor->trace(m_media); 1887 visitor->trace(m_media);
1887 visitor->trace(m_sessionStorage); 1888 visitor->trace(m_sessionStorage);
1888 visitor->trace(m_localStorage); 1889 visitor->trace(m_localStorage);
1889 visitor->trace(m_applicationCache); 1890 visitor->trace(m_applicationCache);
1890 visitor->trace(m_performance); 1891 visitor->trace(m_performance);
1891 visitor->trace(m_css); 1892 visitor->trace(m_css);
1892 WillBeHeapSupplementable<DOMWindow>::trace(visitor); 1893 WillBeHeapSupplementable<DOMWindow>::trace(visitor);
1893 } 1894 }
1894 1895
1895 } // namespace WebCore 1896 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/DOMWindow.h ('k') | Source/core/loader/SinkDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698