blob: f889f32740c741f1068ca4c0ca06c763e04b866a [file] [log] [blame]
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_TRUSTED_CDN_H_
#define CHROME_BROWSER_ANDROID_TRUSTED_CDN_H_
#include "base/android/scoped_java_ref.h"
#include "base/memory/raw_ptr.h"
#include "content/public/browser/web_contents.h"
// Native part of Trusted CDN publisher URL provider. Managed by Java layer.
class TrustedCdn {
public:
TrustedCdn(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
~TrustedCdn();
void SetWebContents(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& jweb_contents);
void ResetWebContents(JNIEnv* env);
void OnDestroyed(JNIEnv* env);
base::android::ScopedJavaLocalRef<jobject> GetPublisherUrl(JNIEnv* env);
private:
base::android::ScopedJavaGlobalRef<jobject> jobj_;
raw_ptr<content::WebContents> web_contents_;
};
#endif // CHROME_BROWSER_ANDROID_TRUSTED_CDN_H_