| 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/lib/main/aw_main_delegate.h" | 5 #include "android_webview/lib/main/aw_main_delegate.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_content_browser_client.h" | 9 #include "android_webview/browser/aw_content_browser_client.h" |
| 10 #include "android_webview/browser/browser_view_renderer.h" | 10 #include "android_webview/browser/browser_view_renderer.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "content/public/common/content_switches.h" | 39 #include "content/public/common/content_switches.h" |
| 40 #include "gin/public/isolate_holder.h" | 40 #include "gin/public/isolate_holder.h" |
| 41 #include "gin/v8_initializer.h" | 41 #include "gin/v8_initializer.h" |
| 42 #include "gpu/command_buffer/service/gpu_switches.h" | 42 #include "gpu/command_buffer/service/gpu_switches.h" |
| 43 #include "gpu/ipc/gl_in_process_context.h" | 43 #include "gpu/ipc/gl_in_process_context.h" |
| 44 #include "media/base/media_switches.h" | 44 #include "media/base/media_switches.h" |
| 45 #include "media/media_features.h" | 45 #include "media/media_features.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 47 #include "ui/events/gesture_detection/gesture_configuration.h" | 47 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 48 | 48 |
| 49 // These declarations just provide the addresses determined by the | |
| 50 // linker to this source file in order to determine the extent of the | |
| 51 // webview text section. The declared types are irrelevant - only the | |
| 52 // symbol names and the addresses they reference are important. | |
| 53 extern "C" { | |
| 54 extern char __executable_start; | |
| 55 extern char __etext; | |
| 56 } | |
| 57 | |
| 58 namespace android_webview { | 49 namespace android_webview { |
| 59 | 50 |
| 60 namespace { | 51 namespace { |
| 61 | 52 |
| 62 // TODO(boliu): Remove this global Allow once the underlying issues are | 53 // TODO(boliu): Remove this global Allow once the underlying issues are |
| 63 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. | 54 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. |
| 64 base::LazyInstance<std::unique_ptr<ScopedAllowWaitForLegacyWebViewApi>> | 55 base::LazyInstance<std::unique_ptr<ScopedAllowWaitForLegacyWebViewApi>> |
| 65 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; | 56 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; |
| 66 } | 57 } |
| 67 | 58 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 if (process_type.empty()) { | 202 if (process_type.empty()) { |
| 212 browser_runner_.reset(content::BrowserMainRunner::Create()); | 203 browser_runner_.reset(content::BrowserMainRunner::Create()); |
| 213 int exit_code = browser_runner_->Initialize(main_function_params); | 204 int exit_code = browser_runner_->Initialize(main_function_params); |
| 214 DCHECK_LT(exit_code, 0); | 205 DCHECK_LT(exit_code, 0); |
| 215 | 206 |
| 216 // At this point the content client has received the GPU info required | 207 // At this point the content client has received the GPU info required |
| 217 // to create a GPU fingerpring, and we can pass it to the microdump | 208 // to create a GPU fingerpring, and we can pass it to the microdump |
| 218 // crash handler on the same thread as the crash handler was initialized. | 209 // crash handler on the same thread as the crash handler was initialized. |
| 219 crash_reporter::AddGpuFingerprintToMicrodumpCrashHandler( | 210 crash_reporter::AddGpuFingerprintToMicrodumpCrashHandler( |
| 220 content_client_.gpu_fingerprint()); | 211 content_client_.gpu_fingerprint()); |
| 221 #if !defined(COMPONENT_BUILD) | 212 |
| 222 crash_reporter::SetWebViewTextAddrRange( | |
| 223 reinterpret_cast<uintptr_t>(&__executable_start), | |
| 224 reinterpret_cast<uintptr_t>(&__etext)); | |
| 225 #endif | |
| 226 g_allow_wait_in_ui_thread.Get().reset( | 213 g_allow_wait_in_ui_thread.Get().reset( |
| 227 new ScopedAllowWaitForLegacyWebViewApi); | 214 new ScopedAllowWaitForLegacyWebViewApi); |
| 228 | 215 |
| 229 // Return 0 so that we do NOT trigger the default behavior. On Android, the | 216 // Return 0 so that we do NOT trigger the default behavior. On Android, the |
| 230 // UI message loop is managed by the Java application. | 217 // UI message loop is managed by the Java application. |
| 231 return 0; | 218 return 0; |
| 232 } | 219 } |
| 233 | 220 |
| 234 return -1; | 221 return -1; |
| 235 } | 222 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 264 |
| 278 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() { | 265 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() { |
| 279 return new AwWebPreferencesPopulaterImpl(); | 266 return new AwWebPreferencesPopulaterImpl(); |
| 280 } | 267 } |
| 281 | 268 |
| 282 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() { | 269 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() { |
| 283 return new AwLocaleManagerImpl(); | 270 return new AwLocaleManagerImpl(); |
| 284 } | 271 } |
| 285 | 272 |
| 286 } // namespace android_webview | 273 } // namespace android_webview |
| OLD | NEW |