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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 8566026: Implement skia sandbox callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use bungeman's change on Skia Created 9 years, 1 month 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: chrome/renderer/print_web_view_helper.cc
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 1b4008a97bcaa5d503a430d14b999bc5e1d91754..cfa6e62d642020b1dd86edf8f06c0f78f77db959 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -45,6 +45,9 @@
#include "skia/ext/vector_canvas.h"
#include "skia/ext/vector_platform_device_skia.h"
#include "third_party/skia/include/core/SkTypeface.h"
+#if defined (OS_WIN)
+#include "content/common/child_process_messages.h"
+#endif
#elif defined(OS_MACOSX)
#include <CoreGraphics/CGContext.h>
@@ -442,9 +445,20 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view)
is_print_ready_metafile_sent_(false),
user_cancelled_scripted_print_count_(0),
notify_browser_of_print_failure_(true) {
+#if defined(OS_WIN) && defined(USE_SKIA)
+ if (!g_SandboxSupport) {
+ g_SandboxSupport = this;
+ }
+#endif
}
-PrintWebViewHelper::~PrintWebViewHelper() {}
+PrintWebViewHelper::~PrintWebViewHelper() {
+#if defined(OS_WIN) && defined(USE_SKIA)
+ if (g_SandboxSupport == this) {
+ g_SandboxSupport = NULL;
+ }
+#endif
+}
// Prints |frame| which called window.print().
void PrintWebViewHelper::PrintPage(WebKit::WebFrame* frame) {
@@ -1569,3 +1583,10 @@ void PrintWebViewHelper::PrintPreviewContext::ClearContext() {
pages_to_render_.clear();
error_ = PREVIEW_ERROR_NONE;
}
+
+#if defined(OS_WIN) && defined(USE_SKIA)
+void PrintWebViewHelper::EnsureFontLoad(LOGFONT logfont) {
+ // This is a synchronized IPC message, will block caller thread.
+ Send(new ChildProcessHostMsg_PreCacheFont(logfont));
+}
+#endif

Powered by Google App Engine
This is Rietveld 408576698