diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-06 20:36:33 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-06 20:36:33 +0000 |
commit | be645db8f6309a1e9a2670e3a23c7b2d7b403519 (patch) | |
tree | 2f8b2408bdba3c970074ec5bb2f027e7b78776e3 /webkit | |
parent | da90ffdff909ac442444c6d7b8ec9a2a15d8f01a (diff) | |
download | chromium_src-be645db8f6309a1e9a2670e3a23c7b2d7b403519.zip chromium_src-be645db8f6309a1e9a2670e3a23c7b2d7b403519.tar.gz chromium_src-be645db8f6309a1e9a2670e3a23c7b2d7b403519.tar.bz2 |
Reference and create a RenderView when needed.
This initiates the landslide of linker hell in Chromium.app,
bringing in webkit, v8, and the kitchen sink.
Review URL: http://codereview.chromium.org/21123
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webkit_glue.h | 31 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_shell.cc | 27 |
2 files changed, 41 insertions, 17 deletions
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index ca30d3a..3ef990c 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -45,10 +45,24 @@ class Frame; class SkBitmap; #if defined(OS_MACOSX) +// TODO(port): +// When the code (that got compiled) only used SkBitmap*, it was OK to +// make a GlueBitmap be a SkBitmap* or CGImageRef. However, lots of +// other chrome files that need to be brought in (such as +// chrome/viewas/tree_model.h) uses SkBitmap (as a non-pointer). +// Although *(GlueBitmap) makes sense as *(SkBitmap*), it does not +// make sense as *(CGImageRef). typedef struct CGImage* CGImageRef; -typedef CGImageRef GlueBitmap; +class GlueBitmap { + public: + explicit GlueBitmap(CGImageRef ref) : ref_(ref) { } + GlueBitmap() : ref_(0) { } + operator CGImageRef() { return ref_; } + private: + CGImageRef ref_; +}; #else -typedef SkBitmap* GlueBitmap; +typedef SkBitmap GlueBitmap; #endif namespace webkit_glue { @@ -128,7 +142,7 @@ bool DecodeImage(const std::string& image_data, SkBitmap* image); //----------------------------------------------------------------------------- // Functions implemented by the embedder, called by WebKit: -// This function is called from WebCore::MediaPlayerPrivate, +// This function is called from WebCore::MediaPlayerPrivate, // Returns true if media player is available and can be created. bool IsMediaPlayerAvailable(); @@ -137,7 +151,7 @@ bool IsMediaPlayerAvailable(); void PrefetchDns(const std::string& hostname); // This function is called to request a prefetch of the entire URL, loading it -// into our cache for (expected) future needs. The given URL may NOT be in +// into our cache for (expected) future needs. The given URL may NOT be in // canonical form and it will NOT be null-terminated; use the length instead. void PrecacheUrl(const char16* url, int url_length); @@ -148,7 +162,7 @@ void AppendToLog(const char* filename, int line, const char* message); // Returns true if a corresponding mime type exists. bool GetMimeTypeFromExtension(const std::wstring& ext, std::string* mime_type); -// Get the mime type (if any) that is associated with the given file. +// Get the mime type (if any) that is associated with the given file. // Returns true if a corresponding mime type exists. bool GetMimeTypeFromFile(const std::wstring& file_path, std::string* mime_type); @@ -186,7 +200,12 @@ std::string GetDataResource(int resource_id); // Returns a GlueBitmap for a resource. This resource must have been // specified as BINDATA in the relevant .rc file. -GlueBitmap GetBitmapResource(int resource_id); +#if defined(OS_MACOSX) +// TODO(port) +SkBitmap* GetBitmapResource(int resource_id); +#else +GlueBitmap* GetBitmapResource(int resource_id); +#endif #if defined(OS_WIN) // Loads and returns a cursor. diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index ceeb6e6..e6455a8 100755 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -63,7 +63,7 @@ class URLRequestTestShellFileJob : public URLRequestFileJob { public: virtual ~URLRequestTestShellFileJob() { } - static URLRequestJob* InspectorFactory(URLRequest* request, + static URLRequestJob* InspectorFactory(URLRequest* request, const std::string& scheme) { std::wstring path; PathService::Get(base::DIR_EXE, &path); @@ -90,7 +90,7 @@ WebPreferences* TestShell::web_prefs_ = NULL; bool TestShell::layout_test_mode_ = false; int TestShell::file_test_timeout_ms_ = kDefaultFileTestTimeoutMillisecs; -TestShell::TestShell() +TestShell::TestShell() : m_mainWnd(NULL), m_editWnd(NULL), m_webViewHost(NULL), @@ -111,7 +111,7 @@ TestShell::TestShell() navigation_controller_.reset(new TestNavigationController(this)); URLRequestFilter* filter = URLRequestFilter::GetInstance(); - filter->AddHostnameHandler("test-shell-resource", "inspector", + filter->AddHostnameHandler("test-shell-resource", "inspector", &URLRequestTestShellFileJob::InspectorFactory); url_util::AddStandardScheme("test-shell-resource"); } @@ -220,7 +220,7 @@ void TestShell::Dump(TestShell* shell) { printf("%s", WideToUTF8(bfDump).c_str()); } } - + if (params->dump_pixels && !should_dump_as_text) { // Image output: we write the image data to the file given on the // command line (for the dump pixels argument), and the MD5 sum to @@ -288,7 +288,7 @@ void TestShell::InitLogging(bool suppress_error_dialogs, SEM_NOOPENFILEERRORBOX; if (!enable_gp_fault_error_box) new_flags |= SEM_NOGPFAULTERRORBOX; - + // Preserve existing error mode, as discussed at // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx UINT existing_flags = SetErrorMode(new_flags); @@ -298,7 +298,7 @@ void TestShell::InitLogging(bool suppress_error_dialogs, // Only log to a file if we're running layout tests. This prevents debugging // output from disrupting whether or not we pass. - logging::LoggingDestination destination = + logging::LoggingDestination destination = logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG; if (layout_test_mode) destination = logging::LOG_ONLY_TO_FILE; @@ -353,10 +353,10 @@ void TestShell::ResetWebPreferences() { // These two fonts are picked from the intersection of // Win XP font list and Vista font list : - // http://www.microsoft.com/typography/fonts/winxp.htm + // http://www.microsoft.com/typography/fonts/winxp.htm // http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx // Some of them are installed only with CJK and complex script - // support enabled on Windows XP and are out of consideration here. + // support enabled on Windows XP and are out of consideration here. // (although we enabled both on our buildbots.) // They (especially Impact for fantasy) are not typical cursive // and fantasy fonts, but it should not matter for layout tests @@ -405,7 +405,7 @@ void TestShell::Show(WebView* webview, WindowOpenDisposition disposition) { void TestShell::BindJSObjectsToWindow(WebFrame* frame) { // Only bind the test classes if we're running tests. if (layout_test_mode_) { - layout_test_controller_->BindToJavascript(frame, + layout_test_controller_->BindToJavascript(frame, L"layoutTestController"); event_sending_controller_->BindToJavascript(frame, L"eventSender"); @@ -462,7 +462,7 @@ bool TestShell::Navigate(const TestNavigationEntry& entry, bool reload) { // Otherwise, we give it the state to navigate to. if (!reload) request->SetHistoryState(entry.GetContentState()); - + request->SetExtraData( new TestShellExtraRequestData(entry.GetPageID())); @@ -567,7 +567,12 @@ bool GetPreferredExtensionForMimeType(const std::string& mime_type, return net::GetPreferredExtensionForMimeType(mime_type, ext); } -GlueBitmap GetBitmapResource(int resource_id) { +#if defined(OS_MACOSX) +SkBitmap* +#else +GlueBitmap* +#endif +GetBitmapResource(int resource_id) { return NULL; } |