Index: webkit/support/platform_support_gtk.cc |
diff --git a/webkit/support/platform_support_gtk.cc b/webkit/support/platform_support_gtk.cc |
index 2ab96275c67f979c21a0a04c973cdf2d748147a1..4defd312de0ad1fe8c8f8470a2fd57d604968580 100644 |
--- a/webkit/support/platform_support_gtk.cc |
+++ b/webkit/support/platform_support_gtk.cc |
@@ -11,6 +11,7 @@ |
#include "base/path_service.h" |
#include "base/string16.h" |
#include "base/string_piece.h" |
+#include "gfx/gfx_module.h" |
#include "grit/webkit_resources.h" |
namespace { |
@@ -18,6 +19,13 @@ namespace { |
// Data resources on linux. This is a pointer to the mmapped resources file. |
app::DataPack* g_resource_data_pack = NULL; |
+base::StringPiece TestResourceProvider(int resource_id) { |
+ base::StringPiece res; |
+ if (g_resource_data_pack) |
+ g_resource_data_pack->GetStringPiece(resource_id, &res); |
+ return res; |
+} |
+ |
} |
namespace webkit_support { |
@@ -37,6 +45,9 @@ void AfterInitialize(bool unit_test_mode) { |
data_path = data_path.Append("DumpRenderTree.pak"); |
if (!g_resource_data_pack->Load(data_path)) |
LOG(FATAL) << "failed to load DumpRenderTree.pak"; |
+ |
+ // Config the modules that need access to a limited set of resources. |
+ gfx::GfxModule::SetResourceProvider(TestResourceProvider); |
} |
void BeforeShutdown() { |