diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 22:32:29 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 22:32:29 +0000 |
commit | e352f3558792e1dc0e3910b87ba7ad4ed68ce37d (patch) | |
tree | 2649b464b56ddb434766775e9079482fa63091c7 /chrome | |
parent | 396c3b382ee3333fcbdfa2002520dc4df65e7c7c (diff) | |
download | chromium_src-e352f3558792e1dc0e3910b87ba7ad4ed68ce37d.zip chromium_src-e352f3558792e1dc0e3910b87ba7ad4ed68ce37d.tar.gz chromium_src-e352f3558792e1dc0e3910b87ba7ad4ed68ce37d.tar.bz2 |
Implement WebSandboxSupport.
R=dglazkov
Review URL: http://codereview.chromium.org/42146
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 8 | ||||
-rw-r--r-- | chrome/renderer/renderer_webkitclient_impl.cc | 26 | ||||
-rw-r--r-- | chrome/renderer/renderer_webkitclient_impl.h | 19 | ||||
-rw-r--r-- | chrome/worker/worker_webkitclient_impl.cc | 20 | ||||
-rw-r--r-- | chrome/worker/worker_webkitclient_impl.h | 5 |
5 files changed, 45 insertions, 33 deletions
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index 117f625..3774d13 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -221,14 +221,6 @@ bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { new ViewHostMsg_GetPlugins(refresh, plugins)); } -#if defined(OS_WIN) -bool EnsureFontLoaded(HFONT font) { - LOGFONT logfont; - GetObject(font, sizeof(LOGFONT), &logfont); - return RenderThread::current()->Send(new ViewHostMsg_LoadFont(logfont)); -} -#endif - webkit_glue::ScreenInfo GetScreenInfo(gfx::NativeViewId window) { webkit_glue::ScreenInfo results; RenderThread::current()->Send( diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc index 9e34a7c..28d6f73 100644 --- a/chrome/renderer/renderer_webkitclient_impl.cc +++ b/chrome/renderer/renderer_webkitclient_impl.cc @@ -22,6 +22,18 @@ using WebKit::WebURL; //------------------------------------------------------------------------------ +WebKit::WebMimeRegistry* RendererWebKitClientImpl::mimeRegistry() { + return &mime_registry_; +} + +WebKit::WebSandboxSupport* RendererWebKitClientImpl::sandboxSupport() { +#if defined(OS_WIN) + return &sandbox_support_; +#else + return NULL; +#endif +} + uint64_t RendererWebKitClientImpl::visitedLinkHash(const char* canonical_url, size_t length) { return RenderThread::current()->visited_link_slave()->ComputeURLFingerprint( @@ -32,8 +44,6 @@ bool RendererWebKitClientImpl::isLinkVisited(uint64_t link_hash) { return RenderThread::current()->visited_link_slave()->IsVisited(link_hash); } -//------------------------------------------------------------------------------ - void RendererWebKitClientImpl::setCookies( const WebURL& url, const WebURL& policy_url, const WebString& value) { std::string value_utf8; @@ -107,3 +117,15 @@ WebString RendererWebKitClientImpl::MimeRegistry::preferredExtensionForMIMEType( &file_extension)); return webkit_glue::FilePathStringToWebString(file_extension); } + +//------------------------------------------------------------------------------ + +#if defined(OS_WIN) + +bool RendererWebKitClientImpl::SandboxSupport::ensureFontLoaded(HFONT font) { + LOGFONT logfont; + GetObject(font, sizeof(LOGFONT), &logfont); + return RenderThread::current()->Send(new ViewHostMsg_LoadFont(logfont)); +} + +#endif diff --git a/chrome/renderer/renderer_webkitclient_impl.h b/chrome/renderer/renderer_webkitclient_impl.h index 2ed397b..5eada2a 100644 --- a/chrome/renderer/renderer_webkitclient_impl.h +++ b/chrome/renderer/renderer_webkitclient_impl.h @@ -8,12 +8,15 @@ #include "webkit/glue/simple_webmimeregistry_impl.h" #include "webkit/glue/webkitclient_impl.h" +#if defined(OS_WIN) +#include "WebSandboxSupport.h" +#endif + class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { public: // WebKitClient methods: - virtual WebKit::WebMimeRegistry* mimeRegistry() { - return &mime_registry_; - } + virtual WebKit::WebMimeRegistry* mimeRegistry(); + virtual WebKit::WebSandboxSupport* sandboxSupport(); virtual uint64_t visitedLinkHash(const char* canonicalURL, size_t length); virtual bool isLinkVisited(uint64_t linkHash); virtual void setCookies( @@ -33,7 +36,17 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { const WebKit::WebString&); }; +#if defined(OS_WIN) + class SandboxSupport : public WebKit::WebSandboxSupport { + public: + virtual bool ensureFontLoaded(HFONT); + }; +#endif + MimeRegistry mime_registry_; +#if defined(OS_WIN) + SandboxSupport sandbox_support_; +#endif }; #endif // CHROME_RENDERER_WEBKIT_CLIENT_IMPL_H_ diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc index 980b417..94f71cf 100644 --- a/chrome/worker/worker_webkitclient_impl.cc +++ b/chrome/worker/worker_webkitclient_impl.cc @@ -11,6 +11,10 @@ WebKit::WebMimeRegistry* WorkerWebKitClientImpl::mimeRegistry() { return NULL; } +WebKit::WebSandboxSupport* WorkerWebKitClientImpl::sandboxSupport() { + return NULL; +} + uint64_t WorkerWebKitClientImpl::visitedLinkHash(const char* canonical_url, size_t length) { return 0; @@ -36,19 +40,3 @@ void WorkerWebKitClientImpl::prefetchHostName(const WebKit::WebString&) { WebKit::WebString WorkerWebKitClientImpl::defaultLocale() { return WebKit::WebString(); } - -void WorkerWebKitClientImpl::decrementStatsCounter(const char* name) { -} - -void WorkerWebKitClientImpl::incrementStatsCounter(const char* name) { -} - -void WorkerWebKitClientImpl::traceEventBegin(const char* name, - void* id, - const char* extra) { -} - -void WorkerWebKitClientImpl::traceEventEnd(const char* name, - void* id, - const char* extra) { -} diff --git a/chrome/worker/worker_webkitclient_impl.h b/chrome/worker/worker_webkitclient_impl.h index 0f3d754..d378909 100644 --- a/chrome/worker/worker_webkitclient_impl.h +++ b/chrome/worker/worker_webkitclient_impl.h @@ -11,6 +11,7 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl { public: // WebKitClient methods: virtual WebKit::WebMimeRegistry* mimeRegistry(); + virtual WebKit::WebSandboxSupport* sandboxSupport(); virtual uint64_t visitedLinkHash(const char* canonicalURL, size_t length); virtual bool isLinkVisited(uint64_t linkHash); virtual void setCookies(const WebKit::WebURL& url, @@ -20,10 +21,6 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl { const WebKit::WebURL& policy_url); virtual void prefetchHostName(const WebKit::WebString&); virtual WebKit::WebString defaultLocale(); - virtual void decrementStatsCounter(const char* name); - virtual void incrementStatsCounter(const char* name); - virtual void traceEventBegin(const char* name, void* id, const char* extra); - virtual void traceEventEnd(const char* name, void* id, const char* extra); }; #endif // CHROME_WORKER_WORKER_WEBKIT_CLIENT_IMPL_H_ |