OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/presentation/PresentationReceiver.h" | 5 #include "modules/presentation/PresentationReceiver.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (!GetFrame()) | 92 if (!GetFrame()) |
93 return; | 93 return; |
94 | 94 |
95 auto* window = GetFrame()->DomWindow(); | 95 auto* window = GetFrame()->DomWindow(); |
96 if (!window || window->closed()) | 96 if (!window || window->closed()) |
97 return; | 97 return; |
98 | 98 |
99 window->close(GetFrame()->GetDocument()); | 99 window->close(GetFrame()->GetDocument()); |
100 } | 100 } |
101 | 101 |
| 102 void PresentationReceiver::RemoveConnection( |
| 103 WebPresentationConnection* connection) { |
| 104 DCHECK(connection_list_); |
| 105 connection_list_->RemoveConnection(connection); |
| 106 } |
| 107 |
102 void PresentationReceiver::RegisterConnection( | 108 void PresentationReceiver::RegisterConnection( |
103 PresentationConnection* connection) { | 109 PresentationConnection* connection) { |
104 DCHECK(connection_list_); | 110 DCHECK(connection_list_); |
105 connection_list_->AddConnection(connection); | 111 connection_list_->AddConnection(connection); |
106 } | 112 } |
107 | 113 |
108 void PresentationReceiver::RecordOriginTypeAccess(Document* document) const { | 114 void PresentationReceiver::RecordOriginTypeAccess(Document* document) const { |
109 DCHECK(document); | 115 DCHECK(document); |
110 if (document->IsSecureContext()) { | 116 if (document->IsSecureContext()) { |
111 UseCounter::Count(document, UseCounter::kPresentationReceiverSecureOrigin); | 117 UseCounter::Count(document, UseCounter::kPresentationReceiverSecureOrigin); |
112 } else { | 118 } else { |
113 UseCounter::Count(document, | 119 UseCounter::Count(document, |
114 UseCounter::kPresentationReceiverInsecureOrigin); | 120 UseCounter::kPresentationReceiverInsecureOrigin); |
115 } | 121 } |
116 } | 122 } |
117 | 123 |
118 DEFINE_TRACE(PresentationReceiver) { | 124 DEFINE_TRACE(PresentationReceiver) { |
119 visitor->Trace(connection_list_); | 125 visitor->Trace(connection_list_); |
120 visitor->Trace(connection_list_property_); | 126 visitor->Trace(connection_list_property_); |
121 ContextClient::Trace(visitor); | 127 ContextClient::Trace(visitor); |
122 } | 128 } |
123 | 129 |
124 } // namespace blink | 130 } // namespace blink |
OLD | NEW |