| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 manifest.icons[i].src = GURL(); | 120 manifest.icons[i].src = GURL(); |
| 121 manifest.icons[i].type = base::NullableString16( | 121 manifest.icons[i].type = base::NullableString16( |
| 122 manifest.icons[i].type.string().substr(0, | 122 manifest.icons[i].type.string().substr(0, |
| 123 Manifest::kMaxIPCStringLength), | 123 Manifest::kMaxIPCStringLength), |
| 124 manifest.icons[i].type.is_null()); | 124 manifest.icons[i].type.is_null()); |
| 125 } | 125 } |
| 126 manifest.gcm_sender_id = base::NullableString16( | 126 manifest.gcm_sender_id = base::NullableString16( |
| 127 manifest.gcm_sender_id.string().substr( | 127 manifest.gcm_sender_id.string().substr( |
| 128 0, Manifest::kMaxIPCStringLength), | 128 0, Manifest::kMaxIPCStringLength), |
| 129 manifest.gcm_sender_id.is_null()); | 129 manifest.gcm_sender_id.is_null()); |
| 130 for (size_t i = 0; i < manifest.chrome_related_applications.size(); ++i) { |
| 131 manifest.chrome_related_applications[i].id= base::NullableString16( |
| 132 manifest.chrome_related_applications[i].id.string().substr( |
| 133 0, |
| 134 Manifest::kMaxIPCStringLength), |
| 135 manifest.chrome_related_applications[i].id.is_null()); |
| 136 } |
| 130 | 137 |
| 131 callback->Run(manifest); | 138 callback->Run(manifest); |
| 132 callbacks->Remove(request_id); | 139 callbacks->Remove(request_id); |
| 133 if (callbacks->IsEmpty()) { | 140 if (callbacks->IsEmpty()) { |
| 134 delete callbacks; | 141 delete callbacks; |
| 135 pending_callbacks_.erase(render_frame_host); | 142 pending_callbacks_.erase(render_frame_host); |
| 136 } | 143 } |
| 137 } | 144 } |
| 138 | 145 |
| 139 } // namespace content | 146 } // namespace content |
| OLD | NEW |