Commit 37ca7c98 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles) Committed by Commit Bot

webview: move TriggerMinidumpUploading to the right file.

aw_browser_terminator.cc was including the JNI header file for
AwBrowserProcess so that it can call TriggerMinidumpUploading, but this
prevents any native methods being added to AwBrowserProcess since each
JNI header can only be safely included by one source file.

Move the JNI header include to aw_browser_process.cc and expose a C++
function for AwBrowserTerminator to call instead of calling the Java
method directly.

Change-Id: If230bfc3d1fb8c3c1eeb7efa2f01b0b45c4d32a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2252282
Commit-Queue: Richard Coles <torne@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Auto-Submit: Richard Coles <torne@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780010}
parent 5bbf7a67
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "android_webview/browser/aw_browser_context.h" #include "android_webview/browser/aw_browser_context.h"
#include "android_webview/browser/lifecycle/aw_contents_lifecycle_notifier.h" #include "android_webview/browser/lifecycle/aw_contents_lifecycle_notifier.h"
#include "android_webview/browser/metrics/visibility_metrics_logger.h" #include "android_webview/browser/metrics/visibility_metrics_logger.h"
#include "android_webview/browser_jni_headers/AwBrowserProcess_jni.h"
#include "base/base_paths_posix.h" #include "base/base_paths_posix.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
...@@ -192,4 +193,10 @@ void AwBrowserProcess::OnAuthPrefsChanged() { ...@@ -192,4 +193,10 @@ void AwBrowserProcess::OnAuthPrefsChanged() {
CreateHttpAuthDynamicParams()); CreateHttpAuthDynamicParams());
} }
// static
void AwBrowserProcess::TriggerMinidumpUploading() {
Java_AwBrowserProcess_triggerMinidumpUploading(
base::android::AttachCurrentThread());
}
} // namespace android_webview } // namespace android_webview
...@@ -71,6 +71,8 @@ class AwBrowserProcess { ...@@ -71,6 +71,8 @@ class AwBrowserProcess {
void PreMainMessageLoopRun(); void PreMainMessageLoopRun();
static void TriggerMinidumpUploading();
private: private:
void CreateSafeBrowsingUIManager(); void CreateSafeBrowsingUIManager();
void CreateSafeBrowsingWhitelistManager(); void CreateSafeBrowsingWhitelistManager();
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include <unistd.h> #include <unistd.h>
#include <memory> #include <memory>
#include "android_webview/browser/aw_browser_process.h"
#include "android_webview/browser/aw_render_process_gone_delegate.h" #include "android_webview/browser/aw_render_process_gone_delegate.h"
#include "android_webview/browser_jni_headers/AwBrowserProcess_jni.h"
#include "android_webview/common/aw_descriptors.h" #include "android_webview/common/aw_descriptors.h"
#include "base/android/scoped_java_ref.h" #include "base/android/scoped_java_ref.h"
#include "base/logging.h" #include "base/logging.h"
...@@ -100,8 +100,7 @@ void OnRenderProcessGone( ...@@ -100,8 +100,7 @@ void OnRenderProcessGone(
// By this point we have moved the minidump to the crash directory, so it can // By this point we have moved the minidump to the crash directory, so it can
// now be copied and uploaded. // now be copied and uploaded.
Java_AwBrowserProcess_triggerMinidumpUploading( AwBrowserProcess::TriggerMinidumpUploading();
base::android::AttachCurrentThread());
} }
} // namespace } // namespace
......
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