1 // Copyright 2018 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.base; 6 7 /** 8 * Interface to be implemented by the classes make themselves attacheable to 9 * a host class that holds {@link UserDataHost}. 10 */ 11 public interface UserData { 12 /** 13 * Called when {@link UserData} object needs to be destroyed. 14 * 15 * <pre> 16 * WARNING: This method is not guaranteed to be called. Each host class should 17 * call {@link UserDataHost#destroy()} explicitly at the end of its 18 * lifetime to have all of its {@link UserData#destroy()} get invoked. 19 * </pre> 20 */ destroy()21 default void destroy() {} 22 } 23