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

Side by Side Diff: third_party/WebKit/Source/modules/nfc/NFC.cpp

Issue 2693433002: Migrate WTF::HashMap::add() to ::insert() [final] (Closed)
Patch Set: more platform-specific references 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 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/nfc/NFC.h" 5 #include "modules/nfc/NFC.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/V8ArrayBuffer.h" 8 #include "bindings/core/v8/V8ArrayBuffer.h"
9 #include "bindings/core/v8/V8StringResource.h" 9 #include "bindings/core/v8/V8StringResource.h"
10 #include "core/dom/DOMArrayBuffer.h" 10 #include "core/dom/DOMArrayBuffer.h"
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 // https://w3c.github.io/web-nfc/#dom-nfc-watch 809 // https://w3c.github.io/web-nfc/#dom-nfc-watch
810 // 8. If the request fails, reject promise with "NotSupportedError" 810 // 8. If the request fails, reject promise with "NotSupportedError"
811 // and abort these steps. 811 // and abort these steps.
812 if (!id) { 812 if (!id) {
813 resolver->reject(NFCError::take( 813 resolver->reject(NFCError::take(
814 resolver, device::nfc::mojom::blink::NFCErrorType::NOT_SUPPORTED)); 814 resolver, device::nfc::mojom::blink::NFCErrorType::NOT_SUPPORTED));
815 return; 815 return;
816 } 816 }
817 817
818 if (error.is_null()) { 818 if (error.is_null()) {
819 m_callbacks.add(id, callback); 819 m_callbacks.insert(id, callback);
820 resolver->resolve(id); 820 resolver->resolve(id);
821 } else { 821 } else {
822 resolver->reject(NFCError::take(resolver, error->error_type)); 822 resolver->reject(NFCError::take(resolver, error->error_type));
823 } 823 }
824 } 824 }
825 825
826 DEFINE_TRACE(NFC) { 826 DEFINE_TRACE(NFC) {
827 PageVisibilityObserver::trace(visitor); 827 PageVisibilityObserver::trace(visitor);
828 ContextLifecycleObserver::trace(visitor); 828 ContextLifecycleObserver::trace(visitor);
829 visitor->trace(m_requests); 829 visitor->trace(m_requests);
830 visitor->trace(m_callbacks); 830 visitor->trace(m_callbacks);
831 } 831 }
832 832
833 } // namespace blink 833 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698