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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 // WebView does not (yet) save Chromium data during shutdown, so add setting | 111 // WebView does not (yet) save Chromium data during shutdown, so add setting |
112 // for Chrome to aggressively persist DOM Storage to minimize data loss. | 112 // for Chrome to aggressively persist DOM Storage to minimize data loss. |
113 // http://crbug.com/479767 | 113 // http://crbug.com/479767 |
114 cl->AppendSwitch(switches::kEnableAggressiveDOMStorageFlushing); | 114 cl->AppendSwitch(switches::kEnableAggressiveDOMStorageFlushing); |
115 | 115 |
116 // Webview does not currently support the Presentation API, see | 116 // Webview does not currently support the Presentation API, see |
117 // https://crbug.com/521319 | 117 // https://crbug.com/521319 |
118 cl->AppendSwitch(switches::kDisablePresentationAPI); | 118 cl->AppendSwitch(switches::kDisablePresentationAPI); |
119 | 119 |
| 120 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
120 if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) { | 121 if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) { |
121 // Browser process (no type specified). | 122 // Browser process (no type specified). |
122 | 123 |
123 base::android::RegisterApkAssetWithGlobalDescriptors( | 124 base::android::RegisterApkAssetWithGlobalDescriptors( |
124 kV8NativesDataDescriptor, | 125 kV8NativesDataDescriptor, |
125 gin::V8Initializer::GetNativesFilePath().AsUTF8Unsafe()); | 126 gin::V8Initializer::GetNativesFilePath().AsUTF8Unsafe()); |
126 base::android::RegisterApkAssetWithGlobalDescriptors( | 127 base::android::RegisterApkAssetWithGlobalDescriptors( |
127 kV8SnapshotDataDescriptor32, | 128 kV8SnapshotDataDescriptor32, |
128 gin::V8Initializer::GetSnapshotFilePath(true).AsUTF8Unsafe()); | 129 gin::V8Initializer::GetSnapshotFilePath(true).AsUTF8Unsafe()); |
129 base::android::RegisterApkAssetWithGlobalDescriptors( | 130 base::android::RegisterApkAssetWithGlobalDescriptors( |
130 kV8SnapshotDataDescriptor64, | 131 kV8SnapshotDataDescriptor64, |
131 gin::V8Initializer::GetSnapshotFilePath(false).AsUTF8Unsafe()); | 132 gin::V8Initializer::GetSnapshotFilePath(false).AsUTF8Unsafe()); |
132 } | 133 } |
| 134 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
133 | 135 |
134 if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) { | 136 if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) { |
135 cl->AppendSwitch(switches::kInProcessGPU); | 137 cl->AppendSwitch(switches::kInProcessGPU); |
136 cl->AppendSwitchASCII(switches::kRendererProcessLimit, "1"); | 138 cl->AppendSwitchASCII(switches::kRendererProcessLimit, "1"); |
137 cl->AppendSwitch(switches::kDisableRendererBackgrounding); | 139 cl->AppendSwitch(switches::kDisableRendererBackgrounding); |
138 } | 140 } |
139 | 141 |
140 return false; | 142 return false; |
141 } | 143 } |
142 | 144 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 #if defined(VIDEO_HOLE) | 261 #if defined(VIDEO_HOLE) |
260 content::ExternalVideoSurfaceContainer* | 262 content::ExternalVideoSurfaceContainer* |
261 AwMainDelegate::CreateExternalVideoSurfaceContainer( | 263 AwMainDelegate::CreateExternalVideoSurfaceContainer( |
262 content::WebContents* web_contents) { | 264 content::WebContents* web_contents) { |
263 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( | 265 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( |
264 web_contents); | 266 web_contents); |
265 } | 267 } |
266 #endif | 268 #endif |
267 | 269 |
268 } // namespace android_webview | 270 } // namespace android_webview |
OLD | NEW |