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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2762423003: Made Frame constructors (and subclasses) take Page& instead of Page* (Closed)
Patch Set: Rebase Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 webFrame->setParent(oldWebFrame->parent()); 1518 webFrame->setParent(oldWebFrame->parent());
1519 webFrame->setOpener(oldWebFrame->opener()); 1519 webFrame->setOpener(oldWebFrame->opener());
1520 // Note: this *always* temporarily sets a frame owner, even for main frames! 1520 // Note: this *always* temporarily sets a frame owner, even for main frames!
1521 // When a core Frame is created with no owner, it attempts to set itself as 1521 // When a core Frame is created with no owner, it attempts to set itself as
1522 // the main frame of the Page. However, this is a provisional frame, and may 1522 // the main frame of the Page. However, this is a provisional frame, and may
1523 // disappear, so Page::m_mainFrame can't be updated just yet. 1523 // disappear, so Page::m_mainFrame can't be updated just yet.
1524 FrameOwner* tempOwner = DummyFrameOwner::create(); 1524 FrameOwner* tempOwner = DummyFrameOwner::create();
1525 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to 1525 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to
1526 // reuse it here. 1526 // reuse it here.
1527 LocalFrame* frame = LocalFrame::create(webFrame->m_localFrameClientImpl.get(), 1527 LocalFrame* frame = LocalFrame::create(webFrame->m_localFrameClientImpl.get(),
1528 oldFrame->page(), tempOwner, 1528 *oldFrame->page(), tempOwner,
1529 interfaceProvider, interfaceRegistry); 1529 interfaceProvider, interfaceRegistry);
1530 frame->tree().setName( 1530 frame->tree().setName(
1531 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name()); 1531 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name());
1532 webFrame->setCoreFrame(frame); 1532 webFrame->setCoreFrame(frame);
1533 1533
1534 frame->setOwner(oldFrame->owner()); 1534 frame->setOwner(oldFrame->owner());
1535 1535
1536 if (frame->owner() && frame->owner()->isRemote()) 1536 if (frame->owner() && frame->owner()->isRemote())
1537 toRemoteFrameOwner(frame->owner()) 1537 toRemoteFrameOwner(frame->owner())
1538 ->setSandboxFlags(static_cast<SandboxFlags>(flags)); 1538 ->setSandboxFlags(static_cast<SandboxFlags>(flags));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 WebFrameImplBase::trace(visitor); 1594 WebFrameImplBase::trace(visitor);
1595 } 1595 }
1596 1596
1597 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) { 1597 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) {
1598 m_frame = frame; 1598 m_frame = frame;
1599 } 1599 }
1600 1600
1601 void WebLocalFrameImpl::initializeCoreFrame(Page& page, 1601 void WebLocalFrameImpl::initializeCoreFrame(Page& page,
1602 FrameOwner* owner, 1602 FrameOwner* owner,
1603 const AtomicString& name) { 1603 const AtomicString& name) {
1604 setCoreFrame(LocalFrame::create(m_localFrameClientImpl.get(), &page, owner, 1604 setCoreFrame(LocalFrame::create(m_localFrameClientImpl.get(), page, owner,
1605 m_interfaceProvider, m_interfaceRegistry)); 1605 m_interfaceProvider, m_interfaceRegistry));
1606 frame()->tree().setName(name); 1606 frame()->tree().setName(name);
1607 // We must call init() after m_frame is assigned because it is referenced 1607 // We must call init() after m_frame is assigned because it is referenced
1608 // during init(). Note that this may dispatch JS events; the frame may be 1608 // during init(). Note that this may dispatch JS events; the frame may be
1609 // detached after init() returns. 1609 // detached after init() returns.
1610 frame()->init(); 1610 frame()->init();
1611 if (frame()) { 1611 if (frame()) {
1612 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && 1612 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() &&
1613 !parent() && !opener() && 1613 !parent() && !opener() &&
1614 frame()->settings()->getShouldReuseGlobalForUnownedMainFrame()) { 1614 frame()->settings()->getShouldReuseGlobalForUnownedMainFrame()) {
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
2503 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2503 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2504 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2504 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2505 } else { 2505 } else {
2506 clipHtml = 2506 clipHtml =
2507 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2507 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2508 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2508 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2509 } 2509 }
2510 } 2510 }
2511 2511
2512 } // namespace blink 2512 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.cpp ('k') | third_party/WebKit/Source/web/WebPagePopupImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698