summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 22:32:29 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 22:32:29 +0000
commite352f3558792e1dc0e3910b87ba7ad4ed68ce37d (patch)
tree2649b464b56ddb434766775e9079482fa63091c7
parent396c3b382ee3333fcbdfa2002520dc4df65e7c7c (diff)
downloadchromium_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
-rw-r--r--DEPS2
-rw-r--r--chrome/renderer/renderer_glue.cc8
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc26
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.h19
-rw-r--r--chrome/worker/worker_webkitclient_impl.cc20
-rw-r--r--chrome/worker/worker_webkitclient_impl.h5
-rw-r--r--webkit/build/WebKit/WebKit.vcproj4
-rw-r--r--webkit/glue/chromium_bridge_impl.cc8
-rw-r--r--webkit/glue/webkit_glue.h5
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h4
-rw-r--r--webkit/webkit.gyp1
11 files changed, 55 insertions, 47 deletions
diff --git a/DEPS b/DEPS
index 50f0dc6..5ddb7b5 100644
--- a/DEPS
+++ b/DEPS
@@ -19,7 +19,7 @@ deps = {
"http://googletest.googlecode.com/svn/trunk@167",
"src/third_party/WebKit":
- "/trunk/deps/third_party/WebKit@11552",
+ "/trunk/deps/third_party/WebKit@11576",
"src/third_party/icu38":
"/trunk/deps/third_party/icu38@11496",
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_
diff --git a/webkit/build/WebKit/WebKit.vcproj b/webkit/build/WebKit/WebKit.vcproj
index 14fe0c7..f484d55 100644
--- a/webkit/build/WebKit/WebKit.vcproj
+++ b/webkit/build/WebKit/WebKit.vcproj
@@ -183,6 +183,10 @@
Name="win"
>
<File
+ RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\win\WebSandboxSupport.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\win\WebThemeEngine.h"
>
</File>
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc
index db8c3d8..26d7bfb 100644
--- a/webkit/glue/chromium_bridge_impl.cc
+++ b/webkit/glue/chromium_bridge_impl.cc
@@ -78,14 +78,6 @@ ChromeClientImpl* ToChromeClient(WebCore::Widget* widget) {
namespace WebCore {
-// Font -----------------------------------------------------------------------
-
-#if defined(OS_WIN)
-bool ChromiumBridge::ensureFontLoaded(HFONT font) {
- return webkit_glue::EnsureFontLoaded(font);
-}
-#endif
-
// JavaScript -----------------------------------------------------------------
void ChromiumBridge::notifyJSOutOfMemory(Frame* frame) {
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 6db5680..acc9ce8 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -190,11 +190,6 @@ bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins);
// false otherwise.
bool IsPluginRunningInRendererProcess();
-#if defined(OS_WIN)
-// Asks the browser to load the font.
-bool EnsureFontLoaded(HFONT font);
-#endif
-
// Returns screen information corresponding to the given window.
ScreenInfo GetScreenInfo(gfx::NativeViewId window);
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index 5490f8d..4ca5ac1 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -42,6 +42,10 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
return &mime_registry_;
}
+ virtual WebKit::WebSandboxSupport* sandboxSupport() {
+ return NULL;
+ }
+
virtual uint64_t visitedLinkHash(const char* canonicalURL, size_t length) {
return 0;
}
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp
index 31c0cfd..8fa13d1 100644
--- a/webkit/webkit.gyp
+++ b/webkit/webkit.gyp
@@ -4120,6 +4120,7 @@
}],
['OS=="win"', {
'sources': [
+ '../third_party/WebKit/WebKit/chromium/public/win/WebSandboxSupport.h',
'../third_party/WebKit/WebKit/chromium/public/win/WebThemeEngine.h',
],
}],