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

Side by Side Diff: third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.cpp

Issue 2862963003: Replace ASSERT with DCHECK in modules/ (Closed)
Patch Set: NOTREACHED instead of DCHECK(false) Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698