mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix decoding of resources (fixes issue #2966)
Use LoadDataResourceString instead of GetDataResource. It will perform decoding if necessary.
This commit is contained in:
@ -158,14 +158,15 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
|
||||
action.mime_type = GetMimeType(url.path());
|
||||
|
||||
if (!action.bytes && action.resource_id >= 0) {
|
||||
action.bytes =
|
||||
CefAppManager::Get()->GetContentClient()->GetDataResourceBytes(
|
||||
std::string str =
|
||||
ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
|
||||
action.resource_id);
|
||||
if (!action.bytes) {
|
||||
if (str.empty()) {
|
||||
NOTREACHED() << "Failed to load internal resource for id: "
|
||||
<< action.resource_id << " URL: " << url.spec().c_str();
|
||||
return nullptr;
|
||||
}
|
||||
action.bytes = base::RefCountedString::TakeString(&str);
|
||||
}
|
||||
|
||||
if (action.bytes) {
|
||||
|
Reference in New Issue
Block a user