summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorananta <ananta@chromium.org>2015-05-04 11:50:57 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-04 18:51:45 +0000
commitcef8cfb15b65361aa256f9ec37029fd5f11bcaf8 (patch)
tree9bc8ecd4f44bfdfbaa4cd97fd7404cb081ce6df0 /extensions
parent58869145d30e8a7d11dc9bb654b81a2e3245ff5b (diff)
downloadchromium_src-cef8cfb15b65361aa256f9ec37029fd5f11bcaf8.zip
chromium_src-cef8cfb15b65361aa256f9ec37029fd5f11bcaf8.tar.gz
chromium_src-cef8cfb15b65361aa256f9ec37029fd5f11bcaf8.tar.bz2
Revert of Ensure that the DirectWrite font cache works in Chrome canary on Windows 8+ with AppContainer proteā€¦ (patchset #14 id:260001 of https://codereview.chromium.org/1105763004/)
Reason for revert: This patch causes a perf regression bug during renderer startup which is triggered when the cache is not available. Will send out a new patch which addresses both issues. The perf bug is here:- https://code.google.com/p/chromium/issues/detail?id=483443 Original issue's description: > Ensure that the DirectWrite font cache works in Chrome canary on Windows 8+ with AppContainer protection. > > The DirectWrite font cache is mapped as a shared section by the renderer processes. The browser creates > the section. On Windows 8+ with AppContainer protection the renderers are unable to open this shared section > as the BaseNamedObjects object directory is virtualized to \Sessions\SessionId\AppContainerNamedObjects. > > This effectively means that the renderers now fallback to the old method of enumerating all fonts while DirectWrite > builds up its font cache. This hurts performance. > > Proposed fix is as below :- > 1. When the renderer process is launched we get notified in the RenderProcessHost::OnProcessLaunched method. > We send a control IPC message here ViewMsg_FontCacheSectionHandle which contains the duplicated font cache > section handle. > > 2. The ViewMsg_FontCacheSectionHandle message is handled by RenderThreadImpl. It ensures that the shared handle > is set by calling a helper function SetFontCacheSectionHandle. This function then triggers the setting of the > DirectWrite font factory in skia. > > 3. Some of the code in the WarmupDirectWrite function is no longer needed like the code to create the font factory > and create some fonts to warm up DirectWrite. This is because DirectWrite in the renderer now uses the custom > font collection which means that most of the code now can run in the sandbox. The only parts which need to run > outside the sandbox are the loading of the dwrite.dll and the code in the FontCollectionLoader which reads fonts > from the registry. > > 4. The GetPreSandboxWarmupFontMgr helper function has been renamed to GetDirectWriteFontManager. > > The UMA metric DirectWrite.Fonts.LoadTime.Cached should be available if the font cache is loaded in the renderer. > > BUG=481285 > R=cpu > > Committed: https://crrev.com/bbca53aa082320e13909d995a9af66bed7de69a8 > Cr-Commit-Position: refs/heads/master@{#327804} TBR=cpu@chromium.org,scottmg@chromium.org,shrikant@chromium.org,scheib@chromium.org,palmer@chromium.org,piman@chromium.org,creis@chromium.org,avi@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=481285 Review URL: https://codereview.chromium.org/1127673002 Cr-Commit-Position: refs/heads/master@{#328160}
Diffstat (limited to 'extensions')
-rw-r--r--extensions/DEPS2
-rw-r--r--extensions/shell/browser/shell_content_browser_client.cc36
-rw-r--r--extensions/shell/browser/shell_content_browser_client.h5
3 files changed, 0 insertions, 43 deletions
diff --git a/extensions/DEPS b/extensions/DEPS
index 61251ff..285b7d3 100644
--- a/extensions/DEPS
+++ b/extensions/DEPS
@@ -13,8 +13,6 @@ include_rules = [
"+grit/extensions_renderer_resources.h",
"+grit/extensions_resources.h",
"+testing",
- "+sandbox/win/src/sandbox.h",
- "+sandbox/win/src/sandbox_policy.h",
"+third_party/mojo/src/mojo/public",
"+third_party/skia/include",
diff --git a/extensions/shell/browser/shell_content_browser_client.cc b/extensions/shell/browser/shell_content_browser_client.cc
index c5a8c07..4aba570 100644
--- a/extensions/shell/browser/shell_content_browser_client.cc
+++ b/extensions/shell/browser/shell_content_browser_client.cc
@@ -40,12 +40,6 @@
#include "content/public/browser/child_process_data.h"
#endif
-#if defined(OS_WIN)
-#include "base/path_service.h"
-#include "sandbox/win/src/sandbox_policy.h"
-#include "ui/gfx/win/direct_write.h"
-#endif
-
using base::CommandLine;
using content::BrowserContext;
using content::BrowserThread;
@@ -280,36 +274,6 @@ ShellContentBrowserClient::GetDevToolsManagerDelegate() {
return new content::ShellDevToolsManagerDelegate(GetBrowserContext());
}
-#if defined(OS_WIN)
-// TODO(ananta)
-// Consolidate the policy code below with similar code in
-// content/shell/browser/shell_content_browser_client.h.
-void ShellContentBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy,
- bool* success) {
- // If DirectWrite is enabled then we need to grant access to the
- // Windows National Language support directory :-
- // c:\windows\globalization\sorting. Not having access to this folder
- // causes DirectWrite font cache setup to fail.
- if (gfx::win::ShouldUseDirectWrite()) {
- base::FilePath windows_root;
- PathService::Get(base::DIR_WINDOWS, &windows_root);
- base::string16 globalization_path = windows_root.value();
- globalization_path += L"\\Globalization\\Sorting";
-
- policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
- sandbox::TargetPolicy::FILES_ALLOW_READONLY,
- globalization_path.c_str());
-
- // We need to grant access to subdirectories and files within the
- // globalization directory.
- globalization_path += L"\\*";
- policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
- sandbox::TargetPolicy::FILES_ALLOW_READONLY,
- globalization_path.c_str());
- }
-}
-#endif
-
ShellBrowserMainParts* ShellContentBrowserClient::CreateShellBrowserMainParts(
const content::MainFunctionParams& parameters,
ShellBrowserMainDelegate* browser_main_delegate) {
diff --git a/extensions/shell/browser/shell_content_browser_client.h b/extensions/shell/browser/shell_content_browser_client.h
index 44d1113..f9d813f 100644
--- a/extensions/shell/browser/shell_content_browser_client.h
+++ b/extensions/shell/browser/shell_content_browser_client.h
@@ -67,11 +67,6 @@ class ShellContentBrowserClient : public content::ContentBrowserClient {
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
-#if defined(OS_WIN)
- void PreSpawnRenderer(sandbox::TargetPolicy* policy,
- bool* success) override;
-#endif
-
protected:
// Subclasses may wish to provide their own ShellBrowserMainParts.
virtual ShellBrowserMainParts* CreateShellBrowserMainParts(