content/renderer/pepper/pepper_flash_clipboard_host.cc
// Functions to pack/unpack custom data from a pickle. See the header file for
// more detail on custom formats in Pepper.
// TODO(raymes): Currently pepper custom formats are stored in their own
// native format type. However we should be able to store them in the same way
// as "Web Custom" formats are. This would allow clipboard data to be shared
// between pepper applications and web applications. However currently web apps
// assume all data that is placed on the clipboard is UTF16 and pepper allows
// arbitrary data so this change would require some reworking of the chrome
// clipboard interface for custom data.
Functions to pack/unpack custom data from a pickle. See the header file for
more detail on custom formats in Pepper.
TODO(raymes): Currently pepper custom formats are stored in their own
native format type. However we should be able to store them in the same way
as "Web Custom" formats are. This would allow clipboard data to be shared
between pepper applications and web applications. However currently web apps
assume all data that is placed on the clipboard is UTF16 and pepper allows
arbitrary data so this change would require some reworking of the chrome
clipboard interface for custom data.
Functions to pack / unpack custom data from a pickle . See the header file for more detail on custom formats in Pepper . TODO ( raymes ) : Currently pepper custom formats are stored in their own native format type . However we should be able to store them in the same way as " Web Custom " formats are . This would allow clipboard data to be shared between pepper applications and web applications . However currently web apps assume all data that is placed on the clipboard is UTF16 and pepper allows arbitrary data so this change would require some reworking of the chrome clipboard interface for custom data .
bool JumpToFormatInPickle(const string16& format, PickleIterator* iter) {
  uint64 size = 0;
  if (!iter->ReadUInt64(&size))
    return false;
  for (uint64 i = 0; i < size; ++i) {
    string16 stored_format;
    if (!iter->ReadString16(&stored_format))
      return false;
    if (stored_format == format)
      return true;
    int skip_length;
    if (!iter->ReadLength(&skip_length))
      return false;
    if (!iter->SkipBytes(skip_length))
      return false;
  }
  return false;
}
bool JumpToFormatInPickle ( const string16 & format , PickleIterator * iter ) { uint64 size = 0 ; if ( ! iter -> ReadUInt64 ( & size ) ) return false ; for ( uint64 i = 0 ; i < size ; ++ i ) { string16 stored_format ; if ( ! iter -> ReadString16 ( & stored_format ) ) return false ; if ( stored_format == format ) return true ; int skip_length ; if ( ! iter -> ReadLength ( & skip_length ) ) return false ; if ( ! iter -> SkipBytes ( skip_length ) ) return false ; } return false ; }
Functions to pack/unpack custom data from a pickle.
Functions to pack / unpack custom data from a pickle .