[Feed Internals] Add JNI bridge and Feed Fetch URL
This internals page is used to surface debugging information useful to
developers of the NTP Interest Feed.
This CL introduces a dedicated JNI bridge for debugging data. Initially,
it is only providing access to a single property (the Feed Fetch URL),
but will be used for other debugging information from the Java-side in
future CLs.
https://screenshot.googleplex.com/MXAY2vPNYLL
Bug: 913126
Change-Id: I6578a87ea0892d1741f2b71e9e37c35aef231b0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1510299
Reviewed-by: Tom Sepez <[email protected]>
Reviewed-by: Sky Malice <[email protected]>
Reviewed-by: Theresa <[email protected]>
Commit-Queue: Natalie Chouinard <[email protected]>
Cr-Commit-Position: refs/heads/master@{#639622}
diff --git a/chrome/browser/android/feed/feed_debugging_bridge.cc b/chrome/browser/android/feed/feed_debugging_bridge.cc
new file mode 100644
index 0000000..41fd1b2ed
--- /dev/null
+++ b/chrome/browser/android/feed/feed_debugging_bridge.cc
@@ -0,0 +1,20 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/feed/feed_debugging_bridge.h"
+
+#include "base/android/jni_string.h"
+#include "jni/FeedDebuggingBridge_jni.h"
+#include "url/gurl.h"
+
+namespace feed {
+
+GURL GetFeedFetchUrlForDebugging() {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ base::android::ScopedJavaLocalRef<jstring> j_string =
+ Java_FeedDebuggingBridge_getFeedFetchUrl(env);
+ return GURL(ConvertJavaStringToUTF8(env, j_string));
+}
+
+} // namespace feed