LOS ANGELES — Just days after a 22-year-old killed six college students and himself near the campus of the University of California, Santa Barbara, state lawmakers are championing legislation that would permit law enforcement officials and private individuals to seek a restraining order from a judge that would keep people with a potential propensity for violence from buying or owning a gun. The process would be similar to the one currently used for restraining orders in cases of domestic violence.

The legislation is being introduced this week in response to the attack on Friday by Elliot O. Rodger, who was able to buy three guns and go on a rampage despite warnings from his family and mental health professionals that he was unstable and possibly dangerous. It is unclear, however, if the measures contained in the bills could have prevented his actions if they had been law.

Although mass shootings have not translated into stricter gun control laws nationally, they have prompted changes on the state level — largely limiting access to guns, but in some cases loosening existing laws, which gun advocates say give people more leeway to arm themselves against criminals. After a mass shooting at a school in Newtown, Conn., Connecticut and New York passed bans on assault rifles and created stricter background checks.

But California, which already has some of the strictest gun control laws in the country, could go even further. The legislation, known as a gun violence restraining order, would allow people to notify courts or law enforcement officials if they are concerned that a family member or friend is at risk of committing violence. Gun control advocates have recently started pushing for such restraining orders in statehouses across the nation, expanding on similar laws that have passed in Connecticut, Indiana and Texas.