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

Side by Side Diff: content/browser/manifest/manifest_manager_host.cc

Issue 919293002: Add related_applications field to manifest parser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update for additions to spec 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/browser/manifest/manifest_manager_host.h" 5 #include "content/browser/manifest/manifest_manager_host.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "content/common/manifest_manager_messages.h" 8 #include "content/common/manifest_manager_messages.h"
9 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 manifest.icons[i].src = GURL(); 122 manifest.icons[i].src = GURL();
123 manifest.icons[i].type = base::NullableString16( 123 manifest.icons[i].type = base::NullableString16(
124 manifest.icons[i].type.string().substr(0, 124 manifest.icons[i].type.string().substr(0,
125 Manifest::kMaxIPCStringLength), 125 Manifest::kMaxIPCStringLength),
126 manifest.icons[i].type.is_null()); 126 manifest.icons[i].type.is_null());
127 } 127 }
128 manifest.gcm_sender_id = base::NullableString16( 128 manifest.gcm_sender_id = base::NullableString16(
129 manifest.gcm_sender_id.string().substr( 129 manifest.gcm_sender_id.string().substr(
130 0, Manifest::kMaxIPCStringLength), 130 0, Manifest::kMaxIPCStringLength),
131 manifest.gcm_sender_id.is_null()); 131 manifest.gcm_sender_id.is_null());
132 for (size_t i = 0; i < manifest.related_applications.size(); ++i) {
133 manifest.related_applications[i].id= base::NullableString16(
mlamouri (slow - plz ping) 2015/04/10 09:49:44 nit: space before the "=".
benwells 2015/04/15 06:45:22 Done.
134 manifest.related_applications[i].id.string().substr(
135 0,
136 Manifest::kMaxIPCStringLength),
137 manifest.related_applications[i].id.is_null());
138 }
mlamouri (slow - plz ping) 2015/04/10 09:49:44 Can you sanitize the url too?
benwells 2015/04/15 06:45:22 Done.
132 139
133 callback->Run(manifest); 140 callback->Run(manifest);
134 callbacks->Remove(request_id); 141 callbacks->Remove(request_id);
135 if (callbacks->IsEmpty()) { 142 if (callbacks->IsEmpty()) {
136 delete callbacks; 143 delete callbacks;
137 pending_callbacks_.erase(render_frame_host); 144 pending_callbacks_.erase(render_frame_host);
138 } 145 }
139 } 146 }
140 147
141 } // namespace content 148 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/manifest_manager_messages.h » ('j') | content/public/common/manifest.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698