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) { | |
Avi (use Gerrit)
2015/04/15 20:36:34
for (auto& related_app : manifest.related_applicat
benwells
2015/04/16 01:30:46
Done.
| |
133 if (!manifest.related_applications[i].url.is_valid()) | |
134 manifest.related_applications[i].url = GURL(); | |
135 manifest.related_applications[i].id = base::NullableString16( | |
136 manifest.related_applications[i].id.string().substr( | |
137 0, | |
138 Manifest::kMaxIPCStringLength), | |
139 manifest.related_applications[i].id.is_null()); | |
140 } | |
132 | 141 |
133 callback->Run(manifest); | 142 callback->Run(manifest); |
134 callbacks->Remove(request_id); | 143 callbacks->Remove(request_id); |
135 if (callbacks->IsEmpty()) { | 144 if (callbacks->IsEmpty()) { |
136 delete callbacks; | 145 delete callbacks; |
137 pending_callbacks_.erase(render_frame_host); | 146 pending_callbacks_.erase(render_frame_host); |
138 } | 147 } |
139 } | 148 } |
140 | 149 |
141 } // namespace content | 150 } // namespace content |
OLD | NEW |