summaryrefslogtreecommitdiffstats
path: root/android_webview/lib
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 12:30:36 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 12:30:36 +0000
commitea5f70a488fe91f363e591e820f6af4f77f3bc4f (patch)
treeef83d136c80f805dab63b47a3bc287e87a9bdfbf /android_webview/lib
parentd1630ac3b8f7a6087a50758e2125a4a8b1f1f662 (diff)
downloadchromium_src-ea5f70a488fe91f363e591e820f6af4f77f3bc4f.zip
chromium_src-ea5f70a488fe91f363e591e820f6af4f77f3bc4f.tar.gz
chromium_src-ea5f70a488fe91f363e591e820f6af4f77f3bc4f.tar.bz2
Allow renderer compositor message loop to be set by content embedder
Accomplished by adding a override method to ContentRendererClient to return a MessageLoop, which if not null, is used as the renderer compositor thread. In the process, make the ownership of the compositor thread into RenderThreadImpl and rename CompositorThread to InputHandlerManager. Added a thread merge command line switch to control this in android_webview. BUG=179436 Review URL: https://chromiumcodereview.appspot.com/12383056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186682 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/lib')
-rw-r--r--android_webview/lib/main/aw_main_delegate.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/android_webview/lib/main/aw_main_delegate.cc b/android_webview/lib/main/aw_main_delegate.cc
index aa220ea..99a4b0d 100644
--- a/android_webview/lib/main/aw_main_delegate.cc
+++ b/android_webview/lib/main/aw_main_delegate.cc
@@ -5,6 +5,7 @@
#include "android_webview/lib/main/aw_main_delegate.h"
#include "android_webview/browser/aw_content_browser_client.h"
+#include "android_webview/common/aw_switches.h"
#include "android_webview/lib/aw_browser_dependency_factory_impl.h"
#include "android_webview/native/aw_geolocation_permission_context.h"
#include "android_webview/native/aw_quota_manager_bridge_impl.h"
@@ -13,8 +14,8 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "cc/switches.h"
#include "content/public/browser/browser_main_runner.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
namespace android_webview {
@@ -76,7 +77,17 @@ content::ContentBrowserClient*
content::ContentRendererClient*
AwMainDelegate::CreateContentRendererClient() {
- content_renderer_client_.reset(new AwContentRendererClient());
+ MessageLoop* renderer_compositor_loop = NULL;
+
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kMergeUIAndRendererCompositorThreads)) {
+ renderer_compositor_loop =
+ content::BrowserThread::UnsafeGetMessageLoopForThread(
+ content::BrowserThread::UI);
+ }
+
+ content_renderer_client_.reset(
+ new AwContentRendererClient(renderer_compositor_loop));
return content_renderer_client_.get();
}