| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/serviceworkers/NavigatorServiceWorker.h" | 5 #include "modules/serviceworkers/NavigatorServiceWorker.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptState.h" | |
| 8 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 9 #include "core/dom/ExecutionContext.h" | 8 #include "core/dom/ExecutionContext.h" |
| 10 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 11 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| 12 #include "core/frame/Navigator.h" | 11 #include "core/frame/Navigator.h" |
| 13 #include "modules/serviceworkers/ServiceWorkerContainer.h" | 12 #include "modules/serviceworkers/ServiceWorkerContainer.h" |
| 13 #include "platform/bindings/ScriptState.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 NavigatorServiceWorker::NavigatorServiceWorker(Navigator& navigator) {} | 17 NavigatorServiceWorker::NavigatorServiceWorker(Navigator& navigator) {} |
| 18 | 18 |
| 19 NavigatorServiceWorker* NavigatorServiceWorker::From(Document& document) { | 19 NavigatorServiceWorker* NavigatorServiceWorker::From(Document& document) { |
| 20 if (!document.GetFrame() || !document.GetFrame()->DomWindow()) | 20 if (!document.GetFrame() || !document.GetFrame()->DomWindow()) |
| 21 return nullptr; | 21 return nullptr; |
| 22 Navigator& navigator = *document.GetFrame()->DomWindow()->navigator(); | 22 Navigator& navigator = *document.GetFrame()->DomWindow()->navigator(); |
| 23 return &From(navigator); | 23 return &From(navigator); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void NavigatorServiceWorker::ClearServiceWorker() { | 122 void NavigatorServiceWorker::ClearServiceWorker() { |
| 123 service_worker_ = nullptr; | 123 service_worker_ = nullptr; |
| 124 } | 124 } |
| 125 | 125 |
| 126 DEFINE_TRACE(NavigatorServiceWorker) { | 126 DEFINE_TRACE(NavigatorServiceWorker) { |
| 127 visitor->Trace(service_worker_); | 127 visitor->Trace(service_worker_); |
| 128 Supplement<Navigator>::Trace(visitor); | 128 Supplement<Navigator>::Trace(visitor); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |