Skip to content

Commit

Permalink
Do not initialize gestureconfiguration in renderer process
Browse files Browse the repository at this point in the history
When multiprocess is enabled for webview, do not initialize
gesture configuration in renderer process as this eventually
leads to accessing Window Manager Service.

BUG=640379

Bug: b/31045266
Review-Url: https://codereview.chromium.org/2272703008
Cr-Commit-Position: refs/heads/master@{#414445}
  • Loading branch information
sgurun authored and Commit bot committed Aug 25, 2016
1 parent c6bc15d commit 2fc863f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
19 changes: 9 additions & 10 deletions android_webview/lib/main/aw_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ AwMainDelegate::~AwMainDelegate() {
bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
content::SetContentClient(&content_client_);

content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor());

BrowserViewRenderer::CalculateTileMemoryPolicy();

// WebView apps can override WebView#computeScroll to achieve custom
// scroll/fling. As a result, fling animations may not be ticked, potentially
// confusing the tap suppression controller. Simply disable it for WebView.
ui::GestureConfiguration::GetInstance()
->set_fling_touchscreen_tap_suppression_enabled(false);

base::CommandLine* cl = base::CommandLine::ForCurrentProcess();

// WebView uses the Android system's scrollbars and overscroll glow.
Expand Down Expand Up @@ -121,6 +111,15 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) {
// Browser process (no type specified).

content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor());
BrowserViewRenderer::CalculateTileMemoryPolicy();
// WebView apps can override WebView#computeScroll to achieve custom
// scroll/fling. As a result, fling animations may not be ticked,
// potentially
// confusing the tap suppression controller. Simply disable it for WebView
ui::GestureConfiguration::GetInstance()
->set_fling_touchscreen_tap_suppression_enabled(false);

base::android::RegisterApkAssetWithGlobalDescriptors(
kV8NativesDataDescriptor,
gin::V8Initializer::GetNativesFilePath().AsUTF8Unsafe());
Expand Down
5 changes: 4 additions & 1 deletion android_webview/lib/main/aw_main_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class AwContentBrowserClient;
class AwContentGpuClient;
class AwContentRendererClient;

// Android WebView implementation of ContentMainDelegate.
// Android WebView implementation of ContentMainDelegate. The methods in
// this class runs per process, (browser and renderer) so when making changes
// make sure to properly conditionalize for browser vs. renderer wherever
// needed.
class AwMainDelegate : public content::ContentMainDelegate,
public JniDependencyFactory {
public:
Expand Down

0 comments on commit 2fc863f

Please sign in to comment.