| 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/netinfo/NavigatorNetworkInformation.h" | 5 #include "modules/netinfo/NavigatorNetworkInformation.h" |
| 6 | 6 |
| 7 #include "core/frame/LocalDOMWindow.h" | 7 #include "core/frame/LocalDOMWindow.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "core/frame/Navigator.h" | 9 #include "core/frame/Navigator.h" |
| 10 #include "modules/netinfo/NetworkInformation.h" | 10 #include "modules/netinfo/NetworkInformation.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 return "NavigatorNetworkInformation"; | 36 return "NavigatorNetworkInformation"; |
| 37 } | 37 } |
| 38 | 38 |
| 39 NetworkInformation* NavigatorNetworkInformation::connection( | 39 NetworkInformation* NavigatorNetworkInformation::connection( |
| 40 Navigator& navigator) { | 40 Navigator& navigator) { |
| 41 return NavigatorNetworkInformation::From(navigator).connection(); | 41 return NavigatorNetworkInformation::From(navigator).connection(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 NetworkInformation* NavigatorNetworkInformation::connection() { | 44 NetworkInformation* NavigatorNetworkInformation::connection() { |
| 45 if (!connection_ && GetFrame()) { | 45 if (!connection_ && GetFrame()) { |
| 46 ASSERT(GetFrame()->DomWindow()); | 46 DCHECK(GetFrame()->DomWindow()); |
| 47 connection_ = NetworkInformation::Create( | 47 connection_ = NetworkInformation::Create( |
| 48 GetFrame()->DomWindow()->GetExecutionContext()); | 48 GetFrame()->DomWindow()->GetExecutionContext()); |
| 49 } | 49 } |
| 50 return connection_.Get(); | 50 return connection_.Get(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 DEFINE_TRACE(NavigatorNetworkInformation) { | 53 DEFINE_TRACE(NavigatorNetworkInformation) { |
| 54 visitor->Trace(connection_); | 54 visitor->Trace(connection_); |
| 55 Supplement<Navigator>::Trace(visitor); | 55 Supplement<Navigator>::Trace(visitor); |
| 56 ContextClient::Trace(visitor); | 56 ContextClient::Trace(visitor); |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace blink | 59 } // namespace blink |
| OLD | NEW |