getProfileHook() {
    // Capture the current profileIds table so that if we get clearAndDrop()
    // then the data from here is effectively discarded.
    const profileIds = this.profileIds_;

    if (this.isEnabled_) {
      return goog.bind(function(profileId) {
        // This profile is never removed, so it gets a reference count of
        // Infinity. 1 would be equally good, but this allows us to distinguish
        // which kind of profile it is later.
        profileIds[profileId] = Infinity;
        this.throttledRefresh_.start();
      }, this);
    } else {
      return null;
    }
  }
Returns a value suitable as the argument to ee.data.withProfiling (i.e. a
function or null, depending on enabled state).
@return {?function(string):undefined}