Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; |
|
haraken
2014/05/23 05:38:20
I guess we decided to explicitly initialize this k
tkent
2014/05/23 06:21:47
Done.
| |
| 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) { |
| 392 return m_document; | 392 // FIXME: Oilpan: Remove .get() when m_document becomes Member<>. |
| 393 return m_document.get(); | |
|
haraken
2014/05/23 05:38:20
Document is now on the heap, so can we just make m
sof
2014/05/23 05:43:52
Not much to it, I had to do this for https://coder
tkent
2014/05/23 06:21:47
I want to avoid it because I don't understand life
tkent
2014/05/23 06:21:47
Wow, conflict!
sof
2014/05/23 06:23:51
I will wait and rebase (there's too many CLs flyin
| |
| 394 } | |
| 393 | 395 |
| 394 m_frame->script().updateDocument(); | 396 m_frame->script().updateDocument(); |
| 395 m_document->updateViewportDescription(); | 397 m_document->updateViewportDescription(); |
| 396 | 398 |
| 397 if (m_frame->page() && m_frame->view()) { | 399 if (m_frame->page() && m_frame->view()) { |
| 398 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll ingCoordinator()) { | 400 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll ingCoordinator()) { |
| 399 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), HorizontalScrollbar); | 401 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), HorizontalScrollbar); |
| 400 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), VerticalScrollbar); | 402 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), VerticalScrollbar); |
| 401 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi ew()); | 403 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi ew()); |
| 402 } | 404 } |
| 403 } | 405 } |
| 404 | 406 |
| 405 m_frame->selection().updateSecureKeyboardEntryIfActive(); | 407 m_frame->selection().updateSecureKeyboardEntryIfActive(); |
| 406 | 408 |
| 407 if (m_frame->isMainFrame()) { | 409 if (m_frame->isMainFrame()) { |
| 408 m_frame->notifyChromeClientWheelEventHandlerCountChanged(); | 410 m_frame->notifyChromeClientWheelEventHandlerCountChanged(); |
| 409 if (m_document->hasTouchEventHandlers()) | 411 if (m_document->hasTouchEventHandlers()) |
| 410 m_frame->host()->chrome().client().needTouchEvents(true); | 412 m_frame->host()->chrome().client().needTouchEvents(true); |
| 411 } | 413 } |
| 412 | 414 |
| 413 return m_document; | 415 // FIXME: Oilpan: Remove .get() when m_document becomes Member<>. |
| 416 return m_document.get(); | |
|
haraken
2014/05/23 05:38:20
Ditto.
| |
| 414 } | 417 } |
| 415 | 418 |
| 416 EventQueue* DOMWindow::eventQueue() const | 419 EventQueue* DOMWindow::eventQueue() const |
| 417 { | 420 { |
| 418 return m_eventQueue.get(); | 421 return m_eventQueue.get(); |
| 419 } | 422 } |
| 420 | 423 |
| 421 void DOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event) | 424 void DOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event) |
| 422 { | 425 { |
| 423 if (!m_eventQueue) | 426 if (!m_eventQueue) |
| (...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1886 visitor->trace(m_media); | 1889 visitor->trace(m_media); |
| 1887 visitor->trace(m_sessionStorage); | 1890 visitor->trace(m_sessionStorage); |
| 1888 visitor->trace(m_localStorage); | 1891 visitor->trace(m_localStorage); |
| 1889 visitor->trace(m_applicationCache); | 1892 visitor->trace(m_applicationCache); |
| 1890 visitor->trace(m_performance); | 1893 visitor->trace(m_performance); |
| 1891 visitor->trace(m_css); | 1894 visitor->trace(m_css); |
| 1892 WillBeHeapSupplementable<DOMWindow>::trace(visitor); | 1895 WillBeHeapSupplementable<DOMWindow>::trace(visitor); |
| 1893 } | 1896 } |
| 1894 | 1897 |
| 1895 } // namespace WebCore | 1898 } // namespace WebCore |
| OLD | NEW |