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

Side by Side Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 13907007: Replace merge-ui-and-compositor-threads flag with no-merge-ui-and-compositor-threads flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add flag for test Created 7 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/lib/main/aw_main_delegate.h" 5 #include "android_webview/lib/main/aw_main_delegate.h"
6 6
7 #include "android_webview/browser/aw_content_browser_client.h" 7 #include "android_webview/browser/aw_content_browser_client.h"
8 #include "android_webview/common/aw_switches.h" 8 #include "android_webview/common/aw_switches.h"
9 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" 9 #include "android_webview/lib/aw_browser_dependency_factory_impl.h"
10 #include "android_webview/native/aw_geolocation_permission_context.h" 10 #include "android_webview/native/aw_geolocation_permission_context.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 logging::CloseLogFile(); 69 logging::CloseLogFile();
70 } 70 }
71 71
72 content::ContentBrowserClient* 72 content::ContentBrowserClient*
73 AwMainDelegate::CreateContentBrowserClient() { 73 AwMainDelegate::CreateContentBrowserClient() {
74 content_browser_client_.reset(new AwContentBrowserClient(this)); 74 content_browser_client_.reset(new AwContentBrowserClient(this));
75 return content_browser_client_.get(); 75 return content_browser_client_.get();
76 } 76 }
77 77
78 namespace { 78 namespace {
79 bool UIAndRendererCompositorThreadsMerged() { 79 bool UIAndRendererCompositorThreadsNotMerged() {
80 return CommandLine::ForCurrentProcess()->HasSwitch( 80 return CommandLine::ForCurrentProcess()->HasSwitch(
81 switches::kMergeUIAndRendererCompositorThreads); 81 switches::kNoMergeUIAndRendererCompositorThreads);
82 } 82 }
83 83
84 MessageLoop* GetRendererCompositorThreadOverrideLoop() { 84 MessageLoop* GetRendererCompositorThreadOverrideLoop() {
85 if (!UIAndRendererCompositorThreadsMerged()) 85 if (UIAndRendererCompositorThreadsNotMerged())
86 return NULL; 86 return NULL;
87 87
88 MessageLoop* rv = content::BrowserThread::UnsafeGetMessageLoopForThread( 88 MessageLoop* rv = content::BrowserThread::UnsafeGetMessageLoopForThread(
89 content::BrowserThread::UI); 89 content::BrowserThread::UI);
90 DCHECK(rv); 90 DCHECK(rv);
91 return rv; 91 return rv;
92 } 92 }
93 } 93 }
94 94
95 content::ContentRendererClient* 95 content::ContentRendererClient*
96 AwMainDelegate::CreateContentRendererClient() { 96 AwMainDelegate::CreateContentRendererClient() {
97 // Compositor input handling will be performed by the renderer host 97 // Compositor input handling will be performed by the renderer host
98 // when UI and compositor threads are merged, so we disable client compositor 98 // when UI and compositor threads are merged, so we disable client compositor
99 // input handling in this case. 99 // input handling in this case.
100 const bool enable_client_compositor_input_handling = 100 const bool enable_client_compositor_input_handling =
101 !UIAndRendererCompositorThreadsMerged(); 101 UIAndRendererCompositorThreadsNotMerged();
102 content_renderer_client_.reset( 102 content_renderer_client_.reset(
103 new AwContentRendererClient(&GetRendererCompositorThreadOverrideLoop, 103 new AwContentRendererClient(&GetRendererCompositorThreadOverrideLoop,
104 enable_client_compositor_input_handling)); 104 enable_client_compositor_input_handling));
105 return content_renderer_client_.get(); 105 return content_renderer_client_.get();
106 } 106 }
107 107
108 AwQuotaManagerBridge* AwMainDelegate::CreateAwQuotaManagerBridge( 108 AwQuotaManagerBridge* AwMainDelegate::CreateAwQuotaManagerBridge(
109 AwBrowserContext* browser_context) { 109 AwBrowserContext* browser_context) {
110 return new AwQuotaManagerBridgeImpl(browser_context); 110 return new AwQuotaManagerBridgeImpl(browser_context);
111 } 111 }
112 112
113 content::GeolocationPermissionContext* 113 content::GeolocationPermissionContext*
114 AwMainDelegate::CreateGeolocationPermission( 114 AwMainDelegate::CreateGeolocationPermission(
115 AwBrowserContext* browser_context) { 115 AwBrowserContext* browser_context) {
116 return AwGeolocationPermissionContext::Create(browser_context); 116 return AwGeolocationPermissionContext::Create(browser_context);
117 } 117 }
118 118
119 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate( 119 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate(
120 content::WebContents* web_contents) { 120 content::WebContents* web_contents) {
121 return AwWebContentsViewDelegate::Create(web_contents); 121 return AwWebContentsViewDelegate::Create(web_contents);
122 } 122 }
123 123
124 } // namespace android_webview 124 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698