Waveguide resonator with an integrated phase modulator for second harmonic generation.