A United Boeing 757-200, registration N587UA performing flight UA-351 from Boston,MA to San Francisco,CA (USA), was enroute at FL360 about 40nm southeast of Toronto,ON (Canada) when the crew reported they had a problem with the crew oxygen supply and needed to descend to 10,000 feet immediately. ATC cleared the flight to 10,000 feet, queried whether there was an emergency situation, after the crew affirmed ATC asked to squawk emergency. The crew subsequently advised they were able to maintain 14,000 feet, the cabin was fully pressurized, just the crew oxygen supply wasn't working. They wanted to divert to Chicago O'Hare,IL (USA). The aircraft was cleared to proceed to Chicago and landed safely at O'Hare Airport about 90 minutes after leaving FL360.