blob: 89a455fcfc20b7a49fb83560cb62f799d92d3e64 [file] [log] [blame]
Natalie Chouinard8f550d972019-03-11 20:28:051// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/android/feed/feed_debugging_bridge.h"
6
7#include "base/android/jni_string.h"
8#include "jni/FeedDebuggingBridge_jni.h"
9#include "url/gurl.h"
10
11namespace feed {
12
13GURL GetFeedFetchUrlForDebugging() {
14 JNIEnv* env = base::android::AttachCurrentThread();
15 base::android::ScopedJavaLocalRef<jstring> j_string =
16 Java_FeedDebuggingBridge_getFeedFetchUrl(env);
17 return GURL(ConvertJavaStringToUTF8(env, j_string));
18}
19
Natalie Chouinardb9529ab2019-03-12 16:46:0820std::string GetFeedProcessScopeDumpForDebugging() {
21 JNIEnv* env = base::android::AttachCurrentThread();
22 base::android::ScopedJavaLocalRef<jstring> j_string =
23 Java_FeedDebuggingBridge_getFeedProcessScopeDump(env);
24 return ConvertJavaStringToUTF8(env, j_string);
25}
26
Natalie Chouinarda8eec112019-03-20 23:23:1627void TriggerRefreshForDebugging() {
28 JNIEnv* env = base::android::AttachCurrentThread();
29 Java_FeedDebuggingBridge_triggerRefresh(env);
30}
31
Natalie Chouinard8f550d972019-03-11 20:28:0532} // namespace feed