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

Side by Side Diff: content/renderer/manifest/manifest_manager.cc

Issue 919293002: Add related_applications field to manifest parser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback Created 5 years, 8 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 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 "content/renderer/manifest/manifest_manager.h" 5 #include "content/renderer/manifest/manifest_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/nullable_string16.h" 8 #include "base/strings/nullable_string16.h"
9 #include "content/common/manifest_manager_messages.h" 9 #include "content/common/manifest_manager_messages.h"
10 #include "content/public/renderer/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 for (size_t i = 0; i < ipc_manifest.icons.size(); ++i) { 64 for (size_t i = 0; i < ipc_manifest.icons.size(); ++i) {
65 ipc_manifest.icons[i].type = base::NullableString16( 65 ipc_manifest.icons[i].type = base::NullableString16(
66 ipc_manifest.icons[i].type.string().substr( 66 ipc_manifest.icons[i].type.string().substr(
67 0, Manifest::kMaxIPCStringLength), 67 0, Manifest::kMaxIPCStringLength),
68 ipc_manifest.icons[i].type.is_null()); 68 ipc_manifest.icons[i].type.is_null());
69 } 69 }
70 ipc_manifest.gcm_sender_id = base::NullableString16( 70 ipc_manifest.gcm_sender_id = base::NullableString16(
71 ipc_manifest.gcm_sender_id.string().substr( 71 ipc_manifest.gcm_sender_id.string().substr(
72 0, Manifest::kMaxIPCStringLength), 72 0, Manifest::kMaxIPCStringLength),
73 ipc_manifest.gcm_sender_id.is_null()); 73 ipc_manifest.gcm_sender_id.is_null());
74 for (size_t i = 0; i < ipc_manifest.related_applications.size(); ++i) {
75 ipc_manifest.related_applications[i].id = base::NullableString16(
76 ipc_manifest.related_applications[i].id.string().substr(
77 0, Manifest::kMaxIPCStringLength),
78 ipc_manifest.related_applications[i].id.is_null());
79 }
Avi (use Gerrit) 2015/04/15 20:36:34 ditto re for (auto x : y)
benwells 2015/04/16 01:30:46 Done.
74 80
75 Send(new ManifestManagerHostMsg_RequestManifestResponse( 81 Send(new ManifestManagerHostMsg_RequestManifestResponse(
76 routing_id(), request_id, ipc_manifest)); 82 routing_id(), request_id, ipc_manifest));
77 } 83 }
78 84
79 void ManifestManager::GetManifest(const GetManifestCallback& callback) { 85 void ManifestManager::GetManifest(const GetManifestCallback& callback) {
80 if (!may_have_manifest_) { 86 if (!may_have_manifest_) {
81 callback.Run(Manifest()); 87 callback.Run(Manifest());
82 return; 88 return;
83 } 89 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 179
174 pending_callbacks_.clear(); 180 pending_callbacks_.clear();
175 181
176 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin(); 182 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin();
177 it != callbacks.end(); ++it) { 183 it != callbacks.end(); ++it) {
178 it->Run(manifest); 184 it->Run(manifest);
179 } 185 }
180 } 186 }
181 187
182 } // namespace content 188 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698