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

Unified Diff: Source/core/testing/MockPagePopupDriver.cpp

Issue 120513004: Don't expose DocumentWriter to embedding layer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/web/ColorChooserPopupUIController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/MockPagePopupDriver.cpp
diff --git a/Source/core/testing/MockPagePopupDriver.cpp b/Source/core/testing/MockPagePopupDriver.cpp
index d1ef760af78149aeff191d4192769fcc2d9ca6eb..e0a789ea24a48357b23f4844867d67e03c79efe5 100644
--- a/Source/core/testing/MockPagePopupDriver.cpp
+++ b/Source/core/testing/MockPagePopupDriver.cpp
@@ -30,8 +30,7 @@
#include "CSSValueKeywords.h"
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/html/HTMLIFrameElement.h"
-#include "core/loader/DocumentLoader.h"
-#include "core/loader/DocumentWriter.h"
+#include "core/loader/FrameLoadRequest.h"
#include "core/loader/FrameLoader.h"
#include "core/frame/Frame.h"
#include "core/page/PagePopup.h"
@@ -69,12 +68,10 @@ inline MockPagePopup::MockPagePopup(PagePopupClient* client, const IntRect& orig
m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY(), CSSPrimitiveValue::CSS_PX, true);
if (document->body())
document->body()->appendChild(m_iframe.get());
- Frame* contentFrame = m_iframe->contentFrame();
- DocumentWriter* writer = contentFrame->loader().documentLoader()->beginWriting("text/html", "UTF-8");
const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupController = parent.internals.pagePopupController;</script>";
- writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePopupController));
- m_popupClient->writeDocument(*writer);
- contentFrame->loader().documentLoader()->endWriting(writer);
+ RefPtr<SharedBuffer> data = SharedBuffer::create(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePopupController));
+ m_popupClient->writeDocument(data.get());
+ m_iframe->contentFrame()->loader().load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), ForceSynchronousLoad)));
}
PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const IntRect& originBoundsInRootView, Frame* mainFrame)
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/web/ColorChooserPopupUIController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698