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

Unified Diff: sky/engine/core/html/HTMLIFrameElement.cpp

Issue 862943004: <iframe> should expose its mojo::ServiceProvider handle (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/engine/core/html/HTMLIFrameElement.h ('k') | sky/engine/core/html/HTMLIFrameElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/HTMLIFrameElement.cpp
diff --git a/sky/engine/core/html/HTMLIFrameElement.cpp b/sky/engine/core/html/HTMLIFrameElement.cpp
index 4717866ae70fdb1b2ee22b7751becd90631e8a11..07a1cc25933763cb6c7c0a01ab648a13b3fa1db0 100644
--- a/sky/engine/core/html/HTMLIFrameElement.cpp
+++ b/sky/engine/core/html/HTMLIFrameElement.cpp
@@ -6,6 +6,7 @@
#include "sky/engine/core/html/HTMLIFrameElement.h"
#include "gen/sky/core/HTMLNames.h"
+#include "mojo/edk/js/handle.h"
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/html/parser/HTMLParserIdioms.h"
#include "sky/engine/core/loader/FrameLoaderClient.h"
@@ -55,6 +56,11 @@ void HTMLIFrameElement::OnViewDestroyed(mojo::View* view)
m_contentView = nullptr;
}
+ScriptValue HTMLIFrameElement::takeServiceProvider(ScriptState* scriptState)
+{
+ return ScriptValue(scriptState, gin::ConvertToV8(scriptState->isolate(), m_serviceProvider.release()));
+}
+
void HTMLIFrameElement::createView()
{
String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames::srcAttr));
@@ -70,7 +76,10 @@ void HTMLIFrameElement::createView()
if (!m_contentView)
return;
- m_contentView->Embed(mojo::String::From(url.string().utf8().data()));
+ mojo::MessagePipe pipe;
+ m_serviceProvider = pipe.handle0.Pass();
+ m_contentView->Embed(mojo::String::From(url.string().utf8().data()),
+ mojo::MakeRequest<mojo::ServiceProvider>(pipe.handle1.Pass()));
m_contentView->AddObserver(this);
}
« no previous file with comments | « sky/engine/core/html/HTMLIFrameElement.h ('k') | sky/engine/core/html/HTMLIFrameElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698