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

Side by Side Diff: third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp

Issue 2748023002: getInstalledRelatedApps: Change internal url fields to URL type. (Closed)
Patch Set: Created 3 years, 9 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/installedapp/NavigatorInstalledApp.h" 5 #include "modules/installedapp/NavigatorInstalledApp.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 class RelatedAppArray { 51 class RelatedAppArray {
52 STATIC_ONLY(RelatedAppArray); 52 STATIC_ONLY(RelatedAppArray);
53 53
54 public: 54 public:
55 using WebType = const WebVector<WebRelatedApplication>&; 55 using WebType = const WebVector<WebRelatedApplication>&;
56 56
57 static HeapVector<Member<RelatedApplication>> take( 57 static HeapVector<Member<RelatedApplication>> take(
58 ScriptPromiseResolver*, 58 ScriptPromiseResolver*,
59 const WebVector<WebRelatedApplication>& webInfo) { 59 const WebVector<WebRelatedApplication>& webInfo) {
60 HeapVector<Member<RelatedApplication>> applications; 60 HeapVector<Member<RelatedApplication>> applications;
61 for (const auto& webApplication : webInfo) 61 for (const auto& webApplication : webInfo) {
62 applications.push_back(RelatedApplication::create( 62 applications.push_back(RelatedApplication::create(
63 webApplication.platform, webApplication.url, webApplication.id)); 63 webApplication.platform, webApplication.url.string(),
64 webApplication.id));
65 }
64 return applications; 66 return applications;
65 } 67 }
66 }; 68 };
67 69
68 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps( 70 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps(
69 ScriptState* scriptState) { 71 ScriptState* scriptState) {
70 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); 72 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
71 ScriptPromise promise = resolver->promise(); 73 ScriptPromise promise = resolver->promise();
72 74
73 InstalledAppController* appController = controller(); 75 InstalledAppController* appController = controller();
(...skipping 19 matching lines...) Expand all
93 95
94 const char* NavigatorInstalledApp::supplementName() { 96 const char* NavigatorInstalledApp::supplementName() {
95 return "NavigatorInstalledApp"; 97 return "NavigatorInstalledApp";
96 } 98 }
97 99
98 DEFINE_TRACE(NavigatorInstalledApp) { 100 DEFINE_TRACE(NavigatorInstalledApp) {
99 Supplement<Navigator>::trace(visitor); 101 Supplement<Navigator>::trace(visitor);
100 } 102 }
101 103
102 } // namespace blink 104 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698