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

Unified Diff: third_party/WebKit/Source/core/html/LinkServiceWorker.cpp

Issue 1781783002: Implement support for link type serviceworker in link elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: third_party/WebKit/Source/core/html/LinkServiceWorker.cpp
diff --git a/third_party/WebKit/Source/core/html/LinkServiceWorker.cpp b/third_party/WebKit/Source/core/html/LinkServiceWorker.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..36c2610dbe7cd02719e550f447f43bcd9959d6ee
--- /dev/null
+++ b/third_party/WebKit/Source/core/html/LinkServiceWorker.cpp
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
falken 2016/03/17 03:57:23 2016
Marijn Kruisselbrink 2016/03/17 19:53:34 Fixed
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/html/LinkServiceWorker.h"
+
+#include "core/dom/Document.h"
+#include "core/frame/LocalFrame.h"
+#include "core/html/HTMLLinkElement.h"
+#include "core/loader/FrameLoaderClient.h"
+
+namespace blink {
+
+PassOwnPtrWillBeRawPtr<LinkServiceWorker> LinkServiceWorker::create(HTMLLinkElement* owner)
+{
+ return adoptPtrWillBeNoop(new LinkServiceWorker(owner));
+}
+
+LinkServiceWorker::~LinkServiceWorker()
+{
+}
+
+void LinkServiceWorker::process()
+{
+ if (!m_owner || !m_owner->document().frame())
+ return;
+
+ m_owner->document().frame()->loader().client()->registerServiceWorker(m_owner->href(), m_owner->scope(), m_owner);
+}
+
+bool LinkServiceWorker::hasLoaded() const
+{
+ return false;
+}
+
+void LinkServiceWorker::ownerRemoved()
+{
+ process();
+}
+
+LinkServiceWorker::LinkServiceWorker(HTMLLinkElement* owner)
+ : LinkResource(owner)
+{
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698