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

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

Issue 12356002: [NOT FOR COMMIT] Hacks to merge render compositor thread with UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remaining hacks Created 7 years, 9 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 15 matching lines...) Expand all
26 AwMainDelegate::~AwMainDelegate() { 26 AwMainDelegate::~AwMainDelegate() {
27 } 27 }
28 28
29 bool AwMainDelegate::BasicStartupComplete(int* exit_code) { 29 bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
30 content::SetContentClient(&content_client_); 30 content::SetContentClient(&content_client_);
31 31
32 CommandLine* command_line = CommandLine::ForCurrentProcess(); 32 CommandLine* command_line = CommandLine::ForCurrentProcess();
33 // Set the command line to enable synchronous API compatibility. 33 // Set the command line to enable synchronous API compatibility.
34 command_line->AppendSwitch(switches::kEnableWebViewSynchronousAPIs); 34 command_line->AppendSwitch(switches::kEnableWebViewSynchronousAPIs);
35 35
36 // Merge browser UI and renderer compositor threads.
37 command_line->AppendSwitch(switches::kMergeUIAndRendererCompositorThreads);
38
36 return false; 39 return false;
37 } 40 }
38 41
39 void AwMainDelegate::PreSandboxStartup() { 42 void AwMainDelegate::PreSandboxStartup() {
40 // TODO(torne): When we have a separate renderer process, we need to handle 43 // TODO(torne): When we have a separate renderer process, we need to handle
41 // being passed open FDs for the resource paks here. 44 // being passed open FDs for the resource paks here.
42 } 45 }
43 46
44 void AwMainDelegate::SandboxInitialized(const std::string& process_type) { 47 void AwMainDelegate::SandboxInitialized(const std::string& process_type) {
45 // TODO(torne): Adjust linux OOM score here. 48 // TODO(torne): Adjust linux OOM score here.
(...skipping 29 matching lines...) Expand all
75 return content_browser_client_.get(); 78 return content_browser_client_.get();
76 } 79 }
77 80
78 content::ContentRendererClient* 81 content::ContentRendererClient*
79 AwMainDelegate::CreateContentRendererClient() { 82 AwMainDelegate::CreateContentRendererClient() {
80 MessageLoop* renderer_compositor_loop = NULL; 83 MessageLoop* renderer_compositor_loop = NULL;
81 84
82 CommandLine* command_line = CommandLine::ForCurrentProcess(); 85 CommandLine* command_line = CommandLine::ForCurrentProcess();
83 if (command_line->HasSwitch(switches::kMergeUIAndRendererCompositorThreads)) { 86 if (command_line->HasSwitch(switches::kMergeUIAndRendererCompositorThreads)) {
84 renderer_compositor_loop = 87 renderer_compositor_loop =
85 content::BrowserThread::UnsafeGetMessageLoopForThread( 88 content::BrowserThread::UnsafeGetMessageLoopForThread(
boliu 2013/03/07 18:28:26 Just realized this has been returning null since c
boliu 2013/03/07 19:04:45 Fix here: crrev.com/12639002
86 content::BrowserThread::UI); 89 content::BrowserThread::UI);
87 } 90 }
88 91
89 content_renderer_client_.reset( 92 content_renderer_client_.reset(
90 new AwContentRendererClient(renderer_compositor_loop)); 93 new AwContentRendererClient(renderer_compositor_loop));
91 return content_renderer_client_.get(); 94 return content_renderer_client_.get();
92 } 95 }
93 96
94 AwQuotaManagerBridge* AwMainDelegate::CreateAwQuotaManagerBridge( 97 AwQuotaManagerBridge* AwMainDelegate::CreateAwQuotaManagerBridge(
95 AwBrowserContext* browser_context) { 98 AwBrowserContext* browser_context) {
96 return new AwQuotaManagerBridgeImpl(browser_context); 99 return new AwQuotaManagerBridgeImpl(browser_context);
97 } 100 }
98 101
99 content::GeolocationPermissionContext* 102 content::GeolocationPermissionContext*
100 AwMainDelegate::CreateGeolocationPermission( 103 AwMainDelegate::CreateGeolocationPermission(
101 AwBrowserContext* browser_context) { 104 AwBrowserContext* browser_context) {
102 return AwGeolocationPermissionContext::Create(browser_context); 105 return AwGeolocationPermissionContext::Create(browser_context);
103 } 106 }
104 107
105 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate( 108 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate(
106 content::WebContents* web_contents) { 109 content::WebContents* web_contents) {
107 return AwWebContentsViewDelegate::Create(web_contents); 110 return AwWebContentsViewDelegate::Create(web_contents);
108 } 111 }
109 112
110 } // namespace android_webview 113 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/renderer_host/view_renderer_host.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698