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

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

Issue 419863004: Refactor frame detach to work for both local and remote frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment typo Created 6 years, 4 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
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | Source/core/html/HTMLFrameOwnerElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/frame/RemoteFrame.h" 6 #include "core/frame/RemoteFrame.h"
7 7
8 #include "core/frame/RemoteFrameView.h" 8 #include "core/frame/RemoteFrameView.h"
9 #include "core/html/HTMLFrameOwnerElement.h" 9 #include "core/html/HTMLFrameOwnerElement.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 inline RemoteFrame::RemoteFrame(FrameClient* client, FrameHost* host, FrameOwner * owner) 13 inline RemoteFrame::RemoteFrame(FrameClient* client, FrameHost* host, FrameOwner * owner)
14 : Frame(client, host, owner) 14 : Frame(client, host, owner)
15 { 15 {
16 } 16 }
17 17
18 PassRefPtr<RemoteFrame> RemoteFrame::create(FrameClient* client, FrameHost* host , FrameOwner* owner) 18 PassRefPtr<RemoteFrame> RemoteFrame::create(FrameClient* client, FrameHost* host , FrameOwner* owner)
19 { 19 {
20 RefPtr<RemoteFrame> frame = adoptRef(new RemoteFrame(client, host, owner)); 20 RefPtr<RemoteFrame> frame = adoptRef(new RemoteFrame(client, host, owner));
21 return frame.release(); 21 return frame.release();
22 } 22 }
23 23
24 RemoteFrame::~RemoteFrame() 24 RemoteFrame::~RemoteFrame()
25 { 25 {
26 setView(nullptr); 26 setView(nullptr);
27 } 27 }
28 28
29 void RemoteFrame::detach()
30 {
31 detachChildren();
32 m_host = 0;
33 }
34
29 void RemoteFrame::setView(PassRefPtr<RemoteFrameView> view) 35 void RemoteFrame::setView(PassRefPtr<RemoteFrameView> view)
30 { 36 {
31 m_view = view; 37 m_view = view;
32 } 38 }
33 39
34 void RemoteFrame::createView() 40 void RemoteFrame::createView()
35 { 41 {
36 RefPtr<RemoteFrameView> view = RemoteFrameView::create(this); 42 RefPtr<RemoteFrameView> view = RemoteFrameView::create(this);
37 setView(view); 43 setView(view);
38 44
39 if (ownerRenderer()) { 45 if (ownerRenderer()) {
40 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); 46 HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
41 ASSERT(owner); 47 ASSERT(owner);
42 owner->setWidget(view); 48 owner->setWidget(view);
43 } 49 }
44 } 50 }
45 51
46 } // namespace blink 52 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | Source/core/html/HTMLFrameOwnerElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698