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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnectionList.h

Issue 2874483002: [Presentation API] Remove closed connections from PresentationConnectionList (Closed)
Patch Set: rebase with master 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef PresentationConnectionList_h 5 #ifndef PresentationConnectionList_h
6 #define PresentationConnectionList_h 6 #define PresentationConnectionList_h
7 7
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/events/EventTarget.h" 9 #include "core/events/EventTarget.h"
10 #include "modules/ModulesExport.h" 10 #include "modules/ModulesExport.h"
(...skipping 19 matching lines...) Expand all
30 const AtomicString& InterfaceName() const override; 30 const AtomicString& InterfaceName() const override;
31 ExecutionContext* GetExecutionContext() const override { 31 ExecutionContext* GetExecutionContext() const override {
32 return ContextClient::GetExecutionContext(); 32 return ContextClient::GetExecutionContext();
33 } 33 }
34 34
35 // PresentationConnectionList.idl implementation. 35 // PresentationConnectionList.idl implementation.
36 const HeapVector<Member<PresentationConnection>>& connections() const; 36 const HeapVector<Member<PresentationConnection>>& connections() const;
37 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable); 37 DEFINE_ATTRIBUTE_EVENT_LISTENER(connectionavailable);
38 38
39 void AddConnection(PresentationConnection*); 39 void AddConnection(PresentationConnection*);
40 // Remove connection from connection list. Returns true if connection is
41 // successfully removed; Returns false if connection does not exist.
42 bool RemoveConnection(WebPresentationConnection*);
40 void DispatchConnectionAvailableEvent(PresentationConnection*); 43 void DispatchConnectionAvailableEvent(PresentationConnection*);
41 bool IsEmpty(); 44 bool IsEmpty();
42 45
43 DECLARE_VIRTUAL_TRACE(); 46 DECLARE_VIRTUAL_TRACE();
44 47
45 protected: 48 protected:
46 // EventTarget implementation. 49 // EventTarget implementation.
47 void AddedEventListener(const AtomicString& event_type, 50 void AddedEventListener(const AtomicString& event_type,
48 RegisteredEventListener&) override; 51 RegisteredEventListener&) override;
49 52
50 private: 53 private:
51 friend class PresentationReceiverTest; 54 friend class PresentationReceiverTest;
52 55
53 HeapVector<Member<PresentationConnection>> connections_; 56 HeapVector<Member<PresentationConnection>> connections_;
54 }; 57 };
55 58
56 } // namespace blink 59 } // namespace blink
57 60
58 #endif // PresentationConnectionList_h 61 #endif // PresentationConnectionList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698