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

Side by Side Diff: Source/core/testing/MockPagePopupDriver.cpp

Issue 17640007: Refactoring: Simplify DocumentWriter by reorganizing its lifetime. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-landing after fixing ASAN failure on set-parent-src-synchronously.xhtml. Created 7 years, 5 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/testing/Internals.idl ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); 66 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
67 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x() , CSSPrimitiveValue::CSS_PX, true); 67 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x() , CSSPrimitiveValue::CSS_PX, true);
68 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY (), CSSPrimitiveValue::CSS_PX, true); 68 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY (), CSSPrimitiveValue::CSS_PX, true);
69 if (document->body()) 69 if (document->body())
70 document->body()->appendChild(m_iframe.get()); 70 document->body()->appendChild(m_iframe.get());
71 Frame* contentFrame = m_iframe->contentFrame(); 71 Frame* contentFrame = m_iframe->contentFrame();
72 DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->beg inWriting("text/html", "UTF-8"); 72 DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->beg inWriting("text/html", "UTF-8");
73 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon troller = parent.internals.pagePopupController;</script>"; 73 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon troller = parent.internals.pagePopupController;</script>";
74 writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePo pupController)); 74 writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePo pupController));
75 m_popupClient->writeDocument(*writer); 75 m_popupClient->writeDocument(*writer);
76 writer->end(); 76 contentFrame->loader()->activeDocumentLoader()->endWriting(writer);
77 } 77 }
78 78
79 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I ntRect& originBoundsInRootView, Frame* mainFrame) 79 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I ntRect& originBoundsInRootView, Frame* mainFrame)
80 { 80 {
81 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame) ); 81 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame) );
82 } 82 }
83 83
84 void MockPagePopup::closeLater() 84 void MockPagePopup::closeLater()
85 { 85 {
86 ref(); 86 ref();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 { 132 {
133 if (!popup || popup != m_mockPagePopup.get()) 133 if (!popup || popup != m_mockPagePopup.get())
134 return; 134 return;
135 m_mockPagePopup->closeLater(); 135 m_mockPagePopup->closeLater();
136 m_mockPagePopup.clear(); 136 m_mockPagePopup.clear();
137 m_pagePopupController->clearPagePopupClient(); 137 m_pagePopupController->clearPagePopupClient();
138 m_pagePopupController.clear(); 138 m_pagePopupController.clear();
139 } 139 }
140 140
141 } 141 }
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698