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

Side by Side Diff: Source/modules/geofencing/Geofencing.cpp

Issue 1240763002: CallbackPromiseAdapter types should be more compatible with WebCallbacks (3/3). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 4 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 | Annotate | Revision Log
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 "config.h" 5 #include "config.h"
6 #include "modules/geofencing/Geofencing.h" 6 #include "modules/geofencing/Geofencing.h"
7 7
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" 8 #include "bindings/core/v8/CallbackPromiseAdapter.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
(...skipping 10 matching lines...) Expand all
21 #include "wtf/OwnPtr.h" 21 #include "wtf/OwnPtr.h"
22 #include "wtf/PassOwnPtr.h" 22 #include "wtf/PassOwnPtr.h"
23 23
24 namespace blink { 24 namespace blink {
25 25
26 namespace { 26 namespace {
27 27
28 // For CallbackPromiseAdapter to convert a WebVector of regions to a HeapVector. 28 // For CallbackPromiseAdapter to convert a WebVector of regions to a HeapVector.
29 class RegionArray { 29 class RegionArray {
30 public: 30 public:
31 using WebType = OwnPtr<WebVector<WebGeofencingRegistration>>; 31 using WebType = const WebVector<WebGeofencingRegistration>&;
32 static HeapVector<Member<GeofencingRegion>> take(ScriptPromiseResolver* reso lver, PassOwnPtr<WebVector<WebGeofencingRegistration>> webRegions) 32 static HeapVector<Member<GeofencingRegion>> take(ScriptPromiseResolver* reso lver, const WebVector<WebGeofencingRegistration>& webRegions)
33 { 33 {
34 HeapVector<Member<GeofencingRegion>> regions; 34 HeapVector<Member<GeofencingRegion>> regions;
35 for (size_t i = 0; i < webRegions->size(); ++i) 35 for (size_t i = 0; i < webRegions.size(); ++i)
36 regions.append(CircularGeofencingRegion::create((*webRegions)[i].id, (*webRegions)[i].region)); 36 regions.append(CircularGeofencingRegion::create(webRegions[i].id, we bRegions[i].region));
37 return regions; 37 return regions;
38 } 38 }
39 39
40 private: 40 private:
41 RegionArray(); 41 RegionArray();
42 }; 42 };
43 43
44 } // namespace 44 } // namespace
45 45
46 Geofencing::Geofencing(ServiceWorkerRegistration* registration) 46 Geofencing::Geofencing(ServiceWorkerRegistration* registration)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 provider->getRegisteredRegions(serviceWorkerRegistration, callbacks); 95 provider->getRegisteredRegions(serviceWorkerRegistration, callbacks);
96 return promise; 96 return promise;
97 } 97 }
98 98
99 DEFINE_TRACE(Geofencing) 99 DEFINE_TRACE(Geofencing)
100 { 100 {
101 visitor->trace(m_registration); 101 visitor->trace(m_registration);
102 } 102 }
103 103
104 } // namespace blink 104 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/cachestorage/InspectorCacheStorageAgent.cpp ('k') | Source/modules/geofencing/GeofencingError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698