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

Side by Side Diff: android_webview/browser/aw_browser_main_parts.cc

Issue 1812883003: Enable features API for content shell and webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: do not override dummy instance Created 4 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
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/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_dev_tools_discovery_provider.h" 8 #include "android_webview/browser/aw_dev_tools_discovery_provider.h"
9 #include "android_webview/browser/aw_media_client_android.h" 9 #include "android_webview/browser/aw_media_client_android.h"
10 #include "android_webview/browser/aw_result_codes.h" 10 #include "android_webview/browser/aw_result_codes.h"
11 #include "android_webview/browser/deferred_gpu_command_service.h" 11 #include "android_webview/browser/deferred_gpu_command_service.h"
12 #include "android_webview/browser/net/aw_network_change_notifier_factory.h" 12 #include "android_webview/browser/net/aw_network_change_notifier_factory.h"
13 #include "android_webview/common/aw_resource.h" 13 #include "android_webview/common/aw_resource.h"
14 #include "android_webview/common/aw_switches.h" 14 #include "android_webview/common/aw_switches.h"
15 #include "base/android/apk_assets.h" 15 #include "base/android/apk_assets.h"
16 #include "base/android/build_info.h" 16 #include "base/android/build_info.h"
17 #include "base/android/locale_utils.h" 17 #include "base/android/locale_utils.h"
18 #include "base/android/memory_pressure_listener_android.h" 18 #include "base/android/memory_pressure_listener_android.h"
19 #include "base/command_line.h" 19 #include "base/command_line.h"
20 #include "base/feature_list.h"
20 #include "base/files/file_path.h" 21 #include "base/files/file_path.h"
21 #include "base/i18n/rtl.h" 22 #include "base/i18n/rtl.h"
22 #include "base/path_service.h" 23 #include "base/path_service.h"
23 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" 24 #include "components/crash/content/browser/crash_micro_dump_manager_android.h"
24 #include "content/public/browser/android/synchronous_compositor.h" 25 #include "content/public/browser/android/synchronous_compositor.h"
25 #include "content/public/browser/render_frame_host.h" 26 #include "content/public/browser/render_frame_host.h"
26 #include "content/public/browser/render_process_host.h" 27 #include "content/public/browser/render_process_host.h"
27 #include "content/public/common/content_client.h" 28 #include "content/public/common/content_client.h"
28 #include "content/public/common/content_switches.h" 29 #include "content/public/common/content_switches.h"
29 #include "content/public/common/result_codes.h" 30 #include "content/public/common/result_codes.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Try to directly mmap the webviewchromium.pak from the apk. Fall back to 72 // Try to directly mmap the webviewchromium.pak from the apk. Fall back to
72 // load from file, using PATH_SERVICE, otherwise. 73 // load from file, using PATH_SERVICE, otherwise.
73 base::FilePath pak_file_path; 74 base::FilePath pak_file_path;
74 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_file_path); 75 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_file_path);
75 pak_file_path = pak_file_path.AppendASCII("webviewchromium.pak"); 76 pak_file_path = pak_file_path.AppendASCII("webviewchromium.pak");
76 ui::LoadMainAndroidPackFile("assets/webviewchromium.pak", pak_file_path); 77 ui::LoadMainAndroidPackFile("assets/webviewchromium.pak", pak_file_path);
77 78
78 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback( 79 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback(
79 base::android::AttachCurrentThread()); 80 base::android::AttachCurrentThread());
80 DeferredGpuCommandService::SetInstance(); 81 DeferredGpuCommandService::SetInstance();
81 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 82
82 switches::kSingleProcess)) { 83 const base::CommandLine* command_line =
84 base::CommandLine::ForCurrentProcess();
85
86 if (!command_line->HasSwitch(switches::kSingleProcess)) {
83 // Create the renderers crash manager on the UI thread. 87 // Create the renderers crash manager on the UI thread.
84 breakpad::CrashMicroDumpManager::GetInstance(); 88 breakpad::CrashMicroDumpManager::GetInstance();
85 } 89 }
86 90
91 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
92 feature_list->InitializeFromCommandLine(
93 command_line->GetSwitchValueASCII(switches::kEnableFeatures),
94 command_line->GetSwitchValueASCII(switches::kDisableFeatures));
95 base::FeatureList::SetInstance(std::move(feature_list));
96
87 return content::RESULT_CODE_NORMAL_EXIT; 97 return content::RESULT_CODE_NORMAL_EXIT;
88 } 98 }
89 99
90 void AwBrowserMainParts::PreMainMessageLoopRun() { 100 void AwBrowserMainParts::PreMainMessageLoopRun() {
91 browser_context_->PreMainMessageLoopRun(); 101 browser_context_->PreMainMessageLoopRun();
92 102
93 AwDevToolsDiscoveryProvider::Install(); 103 AwDevToolsDiscoveryProvider::Install();
94 104
95 media::SetMediaClientAndroid( 105 media::SetMediaClientAndroid(
96 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); 106 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping()));
97 107
98 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); 108 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView();
99 } 109 }
100 110
101 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { 111 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) {
102 // Android WebView does not use default MessageLoop. It has its own 112 // Android WebView does not use default MessageLoop. It has its own
103 // Android specific MessageLoop. 113 // Android specific MessageLoop.
104 return true; 114 return true;
105 } 115 }
106 116
107 } // namespace android_webview 117 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chromecast/browser/cast_browser_main_parts.cc » ('j') | content/shell/browser/shell_browser_main_parts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698