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

Side by Side Diff: third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp

Issue 2696183002: Migrate WTF::HashSet::remove() to ::erase() [part 1] (Closed)
Patch Set: one more platform-specific reference Created 3 years, 10 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 #include "modules/webshare/NavigatorShare.h" 5 #include "modules/webshare/NavigatorShare.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 25 matching lines...) Expand all
36 Member<ScriptPromiseResolver> m_resolver; 36 Member<ScriptPromiseResolver> m_resolver;
37 }; 37 };
38 38
39 NavigatorShare::ShareClientImpl::ShareClientImpl( 39 NavigatorShare::ShareClientImpl::ShareClientImpl(
40 NavigatorShare* navigator_share, 40 NavigatorShare* navigator_share,
41 ScriptPromiseResolver* resolver) 41 ScriptPromiseResolver* resolver)
42 : m_navigator(navigator_share), m_resolver(resolver) {} 42 : m_navigator(navigator_share), m_resolver(resolver) {}
43 43
44 void NavigatorShare::ShareClientImpl::callback(const String& error) { 44 void NavigatorShare::ShareClientImpl::callback(const String& error) {
45 if (m_navigator) 45 if (m_navigator)
46 m_navigator->m_clients.remove(this); 46 m_navigator->m_clients.erase(this);
47 47
48 if (error.isNull()) { 48 if (error.isNull()) {
49 m_resolver->resolve(); 49 m_resolver->resolve();
50 } else { 50 } else {
51 // TODO(mgiuca): Work out which error type to use. 51 // TODO(mgiuca): Work out which error type to use.
52 m_resolver->reject(DOMException::create(AbortError, error)); 52 m_resolver->reject(DOMException::create(AbortError, error));
53 } 53 }
54 } 54 }
55 55
56 void NavigatorShare::ShareClientImpl::onConnectionError() { 56 void NavigatorShare::ShareClientImpl::onConnectionError() {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 void NavigatorShare::onConnectionError() { 129 void NavigatorShare::onConnectionError() {
130 for (auto& client : m_clients) { 130 for (auto& client : m_clients) {
131 client->onConnectionError(); 131 client->onConnectionError();
132 } 132 }
133 m_clients.clear(); 133 m_clients.clear();
134 m_service.reset(); 134 m_service.reset();
135 } 135 }
136 136
137 } // namespace blink 137 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698