OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |