Commit 2a4039f8 authored by Vikas Soni's avatar Vikas Soni Committed by Commit Bot

Disable oopr debug crash dumps for webview.

We have crash dumps to diagnose regressions in remote font analysis
or cc serialization errors but most of their utility is in
identifying URLs where the regression occurs. This info is not
available for webview so there isn't much point in having the crash
dumps there.

Adding a command line flag that webview sets to disable these crash
dumps.

Bug: 1096208
Change-Id: Ic6fda847aa0e8c66b64cad01044e7dd934dff0b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310829Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790919}
parent a3c88b58
......@@ -133,6 +133,12 @@ bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
// removed entirely. See: http://crbug.com/582750
cl->AppendSwitch(switches::kAppCacheForceEnabled);
// We have crash dumps to diagnose regressions in remote font analysis or cc
// serialization errors but most of their utility is in identifying URLs where
// the regression occurs. This info is not available for webview so there
// isn't much point in having the crash dumps there.
cl->AppendSwitch(switches::kDisableOoprDebugCrashDump);
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) {
// Browser process (no type specified).
......
......@@ -132,7 +132,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FontSupport font_support;
scoped_refptr<gpu::ServiceFontManager> font_manager(
new gpu::ServiceFontManager(&font_support));
new gpu::ServiceFontManager(&font_support,
false /* disable_oopr_debug_crash_dump */));
cc::ServicePaintCache paint_cache;
std::vector<SkDiscardableHandleId> locked_handles;
if (bytes_for_fonts > 0u) {
......
......@@ -123,6 +123,11 @@ const gpu::GpuPreferences GetGpuPreferencesFromCommandLine() {
switches::kPlatformDisallowsChromeOSDirectVideoDecoder);
#endif
#if defined(OS_ANDROID)
gpu_preferences.disable_oopr_debug_crash_dump =
command_line->HasSwitch(switches::kDisableOoprDebugCrashDump);
#endif
// Some of these preferences are set or adjusted in
// GpuDataManagerImplPrivate::AppendGpuCommandLine.
return gpu_preferences;
......
......@@ -966,6 +966,9 @@ const char kRemoteDebuggingSocketName[] = "remote-debugging-socket-name";
// Block ChildProcessMain thread of the renderer's ChildProcessService until a
// Java debugger is attached.
const char kRendererWaitForJavaDebugger[] = "renderer-wait-for-java-debugger";
// Disables debug crash dumps for OOPR.
const char kDisableOoprDebugCrashDump[] = "disable-oopr-debug-crash-dump";
#endif
// Enable the experimental Accessibility Object Model APIs in development.
......
......@@ -256,6 +256,7 @@ CONTENT_EXPORT extern const char kWebXrRuntimeWMR[];
#if defined(OS_ANDROID)
CONTENT_EXPORT extern const char kDisableMediaSessionAPI[];
CONTENT_EXPORT extern const char kDisableOoprDebugCrashDump[];
CONTENT_EXPORT extern const char kDisableOverscrollEdgeEffect[];
CONTENT_EXPORT extern const char kDisablePullToRefreshEffect[];
CONTENT_EXPORT extern const char kDisableScreenOrientationLock[];
......
......@@ -882,7 +882,9 @@ RasterDecoderImpl::RasterDecoderImpl(
memory_tracker),
gpu_decoder_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(
TRACE_DISABLED_BY_DEFAULT("gpu.decoder"))),
font_manager_(base::MakeRefCounted<ServiceFontManager>(this)),
font_manager_(base::MakeRefCounted<ServiceFontManager>(
this,
gpu_preferences_.disable_oopr_debug_crash_dump)),
is_privileged_(is_privileged) {
DCHECK(shared_context_state_);
shared_context_state_->AddContextLostObserver(this);
......@@ -2975,7 +2977,8 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id,
&impl, paint_cache_.get(), font_manager_->strike_client(),
shared_context_state_->scratch_deserialization_buffer(), is_privileged_,
paint_op_shared_image_provider_.get());
options.crash_dump_on_failure = true;
options.crash_dump_on_failure =
!gpu_preferences_.disable_oopr_debug_crash_dump;
size_t paint_buffer_size = raster_shm_size;
gl::ScopedProgressReporter report_progress(
......
......@@ -109,7 +109,8 @@ class ServiceFontManager::SkiaDiscardableManager
// it can be fixed.
NOTREACHED();
if (dump_count_ < kMaxDumps && base::RandInt(1, 100) == 1) {
if (dump_count_ < kMaxDumps && base::RandInt(1, 100) == 1 &&
!font_manager_->disable_oopr_debug_crash_dump()) {
++dump_count_;
base::debug::DumpWithoutCrashing();
}
......@@ -137,11 +138,13 @@ class ServiceFontManager::SkiaDiscardableManager
scoped_refptr<ServiceFontManager> font_manager_;
};
ServiceFontManager::ServiceFontManager(Client* client)
ServiceFontManager::ServiceFontManager(Client* client,
bool disable_oopr_debug_crash_dump)
: client_(client),
client_thread_id_(base::PlatformThread::CurrentId()),
strike_client_(std::make_unique<SkStrikeClient>(
sk_make_sp<SkiaDiscardableManager>(this))) {}
sk_make_sp<SkiaDiscardableManager>(this))),
disable_oopr_debug_crash_dump_(disable_oopr_debug_crash_dump) {}
ServiceFontManager::~ServiceFontManager() {
DCHECK(destroyed_);
......
......@@ -26,7 +26,7 @@ class GPU_GLES2_EXPORT ServiceFontManager
virtual void ReportProgress() = 0;
};
ServiceFontManager(Client* client);
ServiceFontManager(Client* client, bool disable_oopr_debug_crash_dump);
void Destroy();
bool Deserialize(const volatile char* memory,
......@@ -34,6 +34,9 @@ class GPU_GLES2_EXPORT ServiceFontManager
std::vector<SkDiscardableHandleId>* locked_handles);
bool Unlock(const std::vector<SkDiscardableHandleId>& handles);
SkStrikeClient* strike_client() { return strike_client_.get(); }
bool disable_oopr_debug_crash_dump() const {
return disable_oopr_debug_crash_dump_;
}
private:
friend class base::RefCountedThreadSafe<ServiceFontManager>;
......@@ -53,6 +56,7 @@ class GPU_GLES2_EXPORT ServiceFontManager
base::flat_map<SkDiscardableHandleId, ServiceDiscardableHandle>
discardable_handle_map_;
bool destroyed_ = false;
const bool disable_oopr_debug_crash_dump_;
};
} // namespace gpu
......
......@@ -266,6 +266,9 @@ struct GPU_EXPORT GpuPreferences {
bool platform_disallows_chromeos_direct_video_decoder = false;
#endif
// Disables oppr debug crash dumps.
bool disable_oopr_debug_crash_dump = false;
// Please update gpu_preferences_unittest.cc when making additions or
// changes to this struct.
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment