Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: content/common/media/media_metadata_sanitizer.cc

Issue 2300083002: Wrap MediaMetadata in base::Optional in content and chrome (Closed)
Patch Set: fix Android build Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/common/media/media_metadata_sanitizer.h ('k') | content/common/media/media_session_messages_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698