RetainPtr<CFURLRef> URL::createCFURL() const { // FIXME: What should this return for invalid URLs? // Currently it throws away the high bytes of the characters in the string in that case, // which is clearly wrong. URLCharBuffer buffer; copyToBuffer(buffer); return createCFURLFromBuffer(buffer.data(), buffer.size()); }
void encode(ArgumentEncoder& encoder, CFURLRef url) { CFURLRef baseURL = CFURLGetBaseURL(url); encoder << static_cast<bool>(baseURL); if (baseURL) encode(encoder, baseURL); URLCharBuffer urlBytes; getURLBytes(url, urlBytes); IPC::DataReference dataReference(reinterpret_cast<const uint8_t*>(urlBytes.data()), urlBytes.size()); encoder << dataReference; }