diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 21:22:37 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 21:22:37 +0000 |
commit | 559fd2cc6db35d5dd473849836e5b31396936a73 (patch) | |
tree | e0cde62d5b6f120f64e1861299f8ae857278190c /webkit/tools/test_shell/test_shell_win.cc | |
parent | 2306bbd5843b30f4e78a9342b60d580dce083794 (diff) | |
download | chromium_src-559fd2cc6db35d5dd473849836e5b31396936a73.zip chromium_src-559fd2cc6db35d5dd473849836e5b31396936a73.tar.gz chromium_src-559fd2cc6db35d5dd473849836e5b31396936a73.tar.bz2 |
generate test_shell.pak and hook up loading net resources from
test_shell.pak. Move the net resource loading into the platform
specific files (still a stub on osx).
Review URL: http://codereview.chromium.org/18186
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell_win.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell_win.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc index dd6682a..a6ba571 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 |