| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/media/media_metadata_sanitizer.h" | 5 #include "content/common/media/media_metadata_sanitizer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/public/common/media_metadata.h" |
| 11 |
| 10 namespace content { | 12 namespace content { |
| 11 | 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 // Maximum length for all the strings inside the MediaMetadata when it is sent | 16 // Maximum length for all the strings inside the MediaMetadata when it is sent |
| 15 // over IPC. The renderer process should truncate the strings before sending | 17 // over IPC. The renderer process should truncate the strings before sending |
| 16 // the MediaMetadata and the browser process must do the same when receiving | 18 // the MediaMetadata and the browser process must do the same when receiving |
| 17 // it. | 19 // it. |
| 18 const size_t kMaxIPCStringLength = 4 * 1024; | 20 const size_t kMaxIPCStringLength = 4 * 1024; |
| 19 | 21 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 CheckArtworkSanity(artwork) ? artwork : SanitizeArtwork(artwork)); | 106 CheckArtworkSanity(artwork) ? artwork : SanitizeArtwork(artwork)); |
| 105 | 107 |
| 106 if (sanitized_metadata.artwork.size() == kMaxNumberOfArtworkImages) | 108 if (sanitized_metadata.artwork.size() == kMaxNumberOfArtworkImages) |
| 107 break; | 109 break; |
| 108 } | 110 } |
| 109 | 111 |
| 110 return sanitized_metadata; | 112 return sanitized_metadata; |
| 111 } | 113 } |
| 112 | 114 |
| 113 } // namespace content | 115 } // namespace content |
| OLD | NEW |