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

Unified Diff: webkit/tools/test_shell/test_shell_win.cc

Issue 18186: generate test_shell.pak and hook up loading net resources from (Closed)
Patch Set: Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/test_shell/test_shell_win.cc
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc
index dd6682aaf781b62119c71bc24326ff28808263af..a6ba57179ea23f59394a7e6881d3f08ec2d054dd 100644
--- a/webkit/tools/test_shell/test_shell_win.cc
+++ b/webkit/tools/test_shell/test_shell_win.cc
@@ -17,6 +17,7 @@
#include "base/path_service.h"
#include "base/resource_util.h"
#include "base/stack_container.h"
+#include "base/string_piece.h"
#include "base/string_util.h"
#include "base/trace_event.h"
#include "base/win_util.h"
@@ -111,6 +112,14 @@ bool MinidumpCallback(const wchar_t *dumpPath,
return false;
}
+StringPiece GetRawDataResource(HMODULE module, int resource_id) {
+ void* data_ptr;
+ size_t data_size;
+ return base::GetDataResourceFromModule(module, resource_id, &data_ptr,
+ &data_size) ?
+ StringPiece(static_cast<char*>(data_ptr), data_size) : StringPiece();
+}
+
} // namespace
// Initialize static member variable
@@ -690,6 +699,12 @@ void TestShell::ShowStartupDebuggingDialog() {
MessageBox(NULL, L"attach to me?", L"test_shell", MB_OK);
}
+// static
+StringPiece TestShell::NetResourceProvider(int key) {
+ return GetRawDataResource(::GetModuleHandle(NULL), key);
+}
+
+
/////////////////////////////////////////////////////////////////////////////
// WebKit glue functions
« webkit/tools/test_shell/test_shell_mac.mm ('K') | « webkit/tools/test_shell/test_shell_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698