| OLD | NEW |
| 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/browser/aw_browser_main_parts.h" | 5 #include "android_webview/browser/aw_browser_main_parts.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "android_webview/browser/aw_result_codes.h" | 8 #include "android_webview/browser/aw_result_codes.h" |
| 9 #include "android_webview/common/aw_switches.h" |
| 9 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| 10 #include "base/android/memory_pressure_listener_android.h" | 11 #include "base/android/memory_pressure_listener_android.h" |
| 11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 14 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
| 15 #include "content/public/common/content_client.h" | 16 #include "content/public/common/content_client.h" |
| 16 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
| 17 #include "content/public/common/result_codes.h" | 18 #include "content/public/common/result_codes.h" |
| 18 #include "content/public/common/url_utils.h" | 19 #include "content/public/common/url_utils.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 pak_path.AppendASCII("webviewchromium.pak"), | 56 pak_path.AppendASCII("webviewchromium.pak"), |
| 56 ui::SCALE_FACTOR_NONE); | 57 ui::SCALE_FACTOR_NONE); |
| 57 | 58 |
| 58 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback( | 59 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback( |
| 59 base::android::AttachCurrentThread()); | 60 base::android::AttachCurrentThread()); |
| 60 | 61 |
| 61 return content::RESULT_CODE_NORMAL_EXIT; | 62 return content::RESULT_CODE_NORMAL_EXIT; |
| 62 } | 63 } |
| 63 | 64 |
| 64 void AwBrowserMainParts::PreMainMessageLoopRun() { | 65 void AwBrowserMainParts::PreMainMessageLoopRun() { |
| 65 if (!gpu::gles2::MailboxSynchronizer::Initialize()) { | 66 // TODO(boliu): Can't support accelerated 2d canvas and WebGL with ubercomp |
| 66 CommandLine::ForCurrentProcess()->AppendSwitch( | 67 // yet: crbug.com/352424. |
| 67 switches::kDisableAccelerated2dCanvas); | 68 if (!switches::UbercompEnabled() && |
| 69 !gpu::gles2::MailboxSynchronizer::Initialize()) { |
| 70 CommandLine* cl = CommandLine::ForCurrentProcess(); |
| 71 cl->AppendSwitch(switches::kDisableAccelerated2dCanvas); |
| 72 cl->AppendSwitch(switches::kDisableExperimentalWebGL); |
| 68 } | 73 } |
| 69 | 74 |
| 70 browser_context_->PreMainMessageLoopRun(); | 75 browser_context_->PreMainMessageLoopRun(); |
| 71 // This is needed for WebView Classic backwards compatibility | 76 // This is needed for WebView Classic backwards compatibility |
| 72 // See crbug.com/298495 | 77 // See crbug.com/298495 |
| 73 content::SetMaxURLChars(20 * 1024 * 1024); | 78 content::SetMaxURLChars(20 * 1024 * 1024); |
| 74 } | 79 } |
| 75 | 80 |
| 76 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 81 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 77 // Android WebView does not use default MessageLoop. It has its own | 82 // Android WebView does not use default MessageLoop. It has its own |
| 78 // Android specific MessageLoop. | 83 // Android specific MessageLoop. |
| 79 return true; | 84 return true; |
| 80 } | 85 } |
| 81 | 86 |
| 82 } // namespace android_webview | 87 } // namespace android_webview |
| OLD | NEW |