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 "content/common/manifest_manager_messages.h" | 7 #include "content/common/manifest_manager_messages.h" |
8 #include "content/public/browser/render_frame_host.h" | 8 #include "content/public/browser/render_frame_host.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/common/manifest.h" | 10 #include "content/public/common/manifest.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 if (!manifest.start_url.is_valid()) | 112 if (!manifest.start_url.is_valid()) |
113 manifest.start_url = GURL(); | 113 manifest.start_url = GURL(); |
114 for (size_t i = 0; i < manifest.icons.size(); ++i) { | 114 for (size_t i = 0; i < manifest.icons.size(); ++i) { |
115 if (!manifest.icons[i].src.is_valid()) | 115 if (!manifest.icons[i].src.is_valid()) |
116 manifest.icons[i].src = GURL(); | 116 manifest.icons[i].src = GURL(); |
117 manifest.icons[i].type = base::NullableString16( | 117 manifest.icons[i].type = base::NullableString16( |
118 manifest.icons[i].type.string().substr(0, | 118 manifest.icons[i].type.string().substr(0, |
119 Manifest::kMaxIPCStringLength), | 119 Manifest::kMaxIPCStringLength), |
120 manifest.icons[i].type.is_null()); | 120 manifest.icons[i].type.is_null()); |
121 } | 121 } |
| 122 manifest.gcm_sender_id = base::NullableString16( |
| 123 manifest.gcm_sender_id.string().substr( |
| 124 0, Manifest::kMaxIPCStringLength), |
| 125 manifest.gcm_sender_id.is_null()); |
122 | 126 |
123 callback->Run(manifest); | 127 callback->Run(manifest); |
124 callbacks->Remove(request_id); | 128 callbacks->Remove(request_id); |
125 if (callbacks->IsEmpty()) { | 129 if (callbacks->IsEmpty()) { |
126 delete callbacks; | 130 delete callbacks; |
127 pending_callbacks_.erase(render_frame_host); | 131 pending_callbacks_.erase(render_frame_host); |
128 } | 132 } |
129 } | 133 } |
130 | 134 |
131 } // namespace content | 135 } // namespace content |
OLD | NEW |