Index: third_party/WebKit/Source/web/WebFrameletImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebFrameletImpl.cpp b/third_party/WebKit/Source/web/WebFrameletImpl.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f7617c89400485961087d01e58439922e80b00b0 |
--- /dev/null |
+++ b/third_party/WebKit/Source/web/WebFrameletImpl.cpp |
@@ -0,0 +1,71 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "WebFrameletImpl.h" |
+ |
+#include "core/html/HTMLFrameletElement.h" |
+#include "public/web/WebFrameletClient.h" |
+ |
+namespace blink { |
+ |
+WebFramelet* WebFramelet::create(WebFrameletClient* client) |
+{ |
+ return WebFrameletImpl::create(client); |
+} |
+ |
+WebFrameletImpl::WebFrameletImpl(WebFrameletClient* client) |
+ : m_frameletClient(FrameletClientImpl::create(this)) |
+ , m_client(client) |
+{ |
+ ASSERT(client); |
+} |
+ |
+WebFrameletImpl::~WebFrameletImpl() |
+{ |
+} |
+ |
+WebFrameletImpl* WebFrameletImpl::create(WebFrameletClient* client) |
+{ |
+ WebFrameletImpl* frame = new WebFrameletImpl(client); |
+#if ENABLE(OILPAN) |
+ return frame; |
+#else |
+ return adoptRef(frame).leakRef(); |
+#endif |
+} |
+ |
+void WebFrameletImpl::close() |
+{ |
+#if ENABLE(OILPAN) |
+ m_selfKeepAlive.clear(); |
+#else |
+ deref(); |
+#endif |
+} |
+ |
+void WebFrameletImpl::setWebLayer(WebLayer* webLayer) |
+{ |
+ if (!framelet()) |
+ return; |
+ |
+ framelet()->setRemotePlatformLayer(webLayer); |
+} |
+ |
+WebFrameletClient* WebFrameletImpl::client() |
+{ |
+ return m_client; |
+} |
+ |
+void WebFrameletImpl::initializeCoreFramelet(FrameOwner* owner) |
+{ |
+ setCoreFramelet(Framelet::create(m_frameletClient.get(), owner)); |
+ framelet()->createView(); |
+} |
+ |
+void WebFrameletImpl::setCoreFramelet(PassRefPtrWillBeRawPtr<Framelet> framelet) |
+{ |
+ m_framelet = framelet; |
+} |
+ |
+} // namespace blink |