CONDENSED CONSOLIDATED STATEMENTS OF MEZZANIE EQUITY AND EQUITY (DEFICIT) - USD ($) $ in Millions | Total | Series G Redeemable Convertible Preferred Stock | Redeemable Non-Controlling Interest | Redeemable Convertible Preferred Stock | Redeemable Convertible Preferred StockSeries G Redeemable Convertible Preferred Stock | Common Stock | Additional Paid-In Capital | Additional Paid-In CapitalSeries G Redeemable Convertible Preferred Stock | Accumulated Other Comprehensive Loss | Accumulated Deficit | Non-Redeemable Non-Controlling Interests |
Mezzanine Equity, Amount at Dec. 31, 2017 | | | $ 0 | $ 12,210 | | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2017 | | | | 863,305,000 | | | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | | |
Issuance of Series G redeemable convertible preferred stock, net of issuance costs | | | | $ 1,500 | | | | | | | |
Issuance of Series G redeemable convertible preferred stock, net of issuance costs (in shares) | | | | 30,755,000 | | | | | | | |
Mezzanine Equity, Amount at Mar. 31, 2018 | | | 0 | $ 13,710 | | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2018 | | | | 894,060,000 | | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2017 | $ (8,557) | | | | | $ 0 | $ 320 | | $ (3) | $ (8,874) | |
Shares, outstanding at Dec. 31, 2017 | | | | | | 443,394,000 | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Exercise of common stock warrants | 1 | | | | | | 1 | | | | |
Exercise of common stock warrants (in shares) | | | | | | 31,000 | | | | | |
Repurchase of outstanding shares | 5 | | | | | | | | | 5 | |
Repurchase of outstanding stock (in shares) | | | | | | (1,707,000) | | | | | |
Issuance of common stock from stock option exercise and restricted stock awards | 15 | | | | | | 15 | | | | |
Issuance of common stock from stock option exercise and restricted stock awards (in shares) | | | | | | 7,689,000 | | | | | |
Repurchase of unvested early-exercised stock options | 0 | | | | | | | | | | |
Repurchase of unvested early-exercised stock options (in shares) | | | | | | (1,000) | | | | | |
Reclassification of early-exercised stock options from liability, net | 1 | | | | | | 1 | | | | |
Stock-based compensation | 17 | | | | | | 17 | | | | |
Issuance and repayment of employee loans collateralized by outstanding common stock | (1) | | | | | | | | | (1) | |
Issuance of common stock as consideration for investment and acquisition | 52 | | | | | | 52 | | | | |
Issuance of common stock as consideration for investment and acquisition (in shares) | | | | | | 1,528,000 | | | | | |
Foreign currency translation adjustment | (7) | | | | | | | | (7) | | |
Net income (loss) | 3,748 | | | | | | | | | 3,748 | |
Stockholders' equity, ending balance at Mar. 31, 2018 | (4,726) | | | | | $ 0 | 406 | | (10) | (5,122) | |
Shares, outstanding at Mar. 31, 2018 | | | | | | 450,934,000 | | | | | |
Mezzanine Equity, Amount at Dec. 31, 2017 | | | 0 | $ 12,210 | | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2017 | | | | 863,305,000 | | | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | | |
Mezzanine equity, net income (loss) | | | (10) | | | | | | | | |
Mezzanine Equity, Amount at Sep. 30, 2018 | | | 0 | $ 13,676 | | | | | | | |
Mezzanine Equity, Shares at Sep. 30, 2018 | | | | 893,354,000 | | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2017 | (8,557) | | | | | $ 0 | 320 | | (3) | (8,874) | |
Shares, outstanding at Dec. 31, 2017 | | | | | | 443,394,000 | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Unrealized gain (loss) on available-for-sale securities | 42 | | | | | | | | | | |
Foreign currency translation adjustment | (219) | | | | | | | | | | |
Stockholders' equity, ending balance at Sep. 30, 2018 | (6,542) | | | | | $ 0 | 617 | | (180) | (6,979) | |
Shares, outstanding at Sep. 30, 2018 | | | | | | 456,455,000 | | | | | |
Mezzanine Equity, Amount at Mar. 31, 2018 | | | 0 | $ 13,710 | | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2018 | | | | 894,060,000 | | | | | | | |
Mezzanine Equity, Amount at Jun. 30, 2018 | | | 0 | $ 13,673 | | | | | | | |
Mezzanine Equity, Shares at Jun. 30, 2018 | | | | 893,301,000 | | | | | | | |
Stockholders' equity, beginning balance at Mar. 31, 2018 | (4,726) | | | | | $ 0 | 406 | | (10) | (5,122) | |
Shares, outstanding at Mar. 31, 2018 | | | | | | 450,934,000 | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Repurchase of outstanding shares | 7 | $ 4 | | $ 0 | $ (37) | | | $ 4 | | 7 | |
Repurchase of outstanding stock (in shares) | | | | (5,000) | (754,000) | (287,000) | | | | | |
Exercise of stock options | 0 | | | | | | | | | | |
Exercise of stock options (in shares) | | | | | | 129,000 | | | | | |
Repurchase of unvested early-exercised stock options | 0 | | | | | | | | | | |
Repurchase of unvested early-exercised stock options (in shares) | | | | | | (129,000) | | | | | |
Reclassification of early-exercised stock options from liability, net | 1 | | | | | | 1 | | | | |
Stock-based compensation | 11 | | | | | | 11 | | | | |
Issuance and repayment of employee loans collateralized by outstanding common stock | (1) | | | | | | (1) | | | | |
Issuance of common stock as consideration for investment and acquisition | 93 | | | | | | 93 | | | | |
Issuance of common stock as consideration for investment and acquisition (in shares) | | | | | | 2,605,000 | | | | | |
Unrealized gain (loss) on available-for-sale securities | 39 | | | | | | | | 39 | | |
Foreign currency translation adjustment | (58) | | | | | | | | (58) | | |
Net income (loss) | (878) | | | | | | | | | (878) | |
Stockholders' equity, ending balance at Jun. 30, 2018 | (5,508) | | | | | $ 0 | 514 | | (29) | (5,993) | |
Shares, outstanding at Jun. 30, 2018 | | | | | | 453,252,000 | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | | |
Issuance of non-controlling interests | | | 10 | | | | | | | | |
Mezzanine Equity, Amount at Sep. 30, 2018 | | | 0 | $ 13,676 | | | | | | | |
Mezzanine Equity, Shares at Sep. 30, 2018 | | | | 893,354,000 | | | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Exercise of common stock warrants | 0 | | | $ 2 | | | | | | | |
Exercise of common stock warrants (in shares) | | | | 53,000 | | | | | | | |
Lapsing of repurchase option related to Series E redeemable convertible preferred stock issued to a non-employee service provider | 0 | | | $ 1 | | | | | | | |
Repurchase of outstanding shares | 0 | | | | | | | | | | |
Repurchase of outstanding stock (in shares) | | | | | | (489,000) | | | | | |
Exercise of stock options | 11 | | | | | | 11 | | | | |
Exercise of stock options (in shares) | | | | | | 3,696,000 | | | | | |
Repurchase of unvested early-exercised stock options | 0 | | | | | | | | | | |
Repurchase of unvested early-exercised stock options (in shares) | | | | | | (4,000) | | | | | |
Stock-based compensation | 74 | | | | | | 74 | | | | |
Issuance and repayment of employee loans collateralized by outstanding common stock | (2) | | | | | | (2) | | | | |
Issuance of non-controlling interests | | | 10 | | | | | | | | |
Issuance of non-controlling interest | (10) | | | | | | (10) | | | | |
Deferred tax benefit arising from acquisition of non-controlling interest in partnership | 26 | | | | | | 26 | | | | |
Unrealized gain (loss) on available-for-sale securities | 3 | | | | | | | | 3 | | |
Foreign currency translation adjustment | (154) | | | | | | | | (154) | | |
Net income (loss) | (986) | | | | | | | | | (986) | |
Stockholders' equity, ending balance at Sep. 30, 2018 | $ (6,542) | | | | | $ 0 | 617 | | (180) | (6,979) | |
Shares, outstanding at Sep. 30, 2018 | | | | | | 456,455,000 | | | | | |
Mezzanine Equity, Amount at Dec. 31, 2018 | | | 0 | $ 14,177 | | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2018 | 903,607,000 | | | 903,607,000 | | | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | | |
Mezzanine equity, net income (loss) | | | (4) | | | | | | | | |
Mezzanine Equity, Amount at Mar. 31, 2019 | | | (4) | $ 14,224 | | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2019 | | | | 904,530,000 | | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2018 | $ (7,385) | | | | | $ 0 | 668 | | (188) | (7,865) | $ 0 |
Shares, outstanding at Dec. 31, 2018 | 457,189,000 | | | | | 457,189,000 | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Exercise of common stock warrants | | | | $ 45 | | | | | | | |
Exercise of common stock warrants (in shares) | | | | 923,000 | | | | | | | |
Lapsing of repurchase option related to Series E redeemable convertible preferred stock issued to a non-employee service provider | | | | $ 2 | | | | | | | |
Lapsing of repurchase option related to Series E redeemable convertible preferred stock issued to a non-employee service provider (in shares) | | | | 0 | | | | | | | |
Repurchase of outstanding shares | $ 0 | | | | | | | | | | |
Repurchase of outstanding stock (in shares) | | | | | | (1,000) | | | | | |
Exercise of stock options | 4 | | | | | | 4 | | | | |
Exercise of stock options (in shares) | | | | | | 677,000 | | | | | |
Repurchase of unvested early-exercised stock options | 0 | | | | | | | | | | |
Repurchase of unvested early-exercised stock options (in shares) | | | | | | (32,000) | | | | | |
Stock-based compensation | 10 | | | | | | 10 | | | | |
Unrealized gain (loss) on available-for-sale securities | (4) | | | | | | | | (4) | | |
Foreign currency translation adjustment | (54) | | | | | | | | (54) | | |
Net income (loss) | (1,012) | | | | | | | | | (1,012) | |
Stockholders' equity, ending balance at Mar. 31, 2019 | $ (8,432) | | | | | $ 0 | 682 | | (246) | (8,868) | 0 |
Shares, outstanding at Mar. 31, 2019 | | | | | | 457,833,000 | | | | | |
Mezzanine Equity, Amount at Dec. 31, 2018 | | | 0 | $ 14,177 | | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2018 | 903,607,000 | | | 903,607,000 | | | | | | | |
Mezzanine Equity, Amount at Sep. 30, 2019 | | | 309 | $ 0 | | | | | | | |
Mezzanine Equity, Shares at Sep. 30, 2019 | 0 | | | 0 | | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2018 | $ (7,385) | | | | | $ 0 | 668 | | (188) | (7,865) | 0 |
Shares, outstanding at Dec. 31, 2018 | 457,189,000 | | | | | 457,189,000 | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Unrealized gain (loss) on available-for-sale securities | $ 0 | | | | | | | | | | |
Foreign currency translation adjustment | 3 | | | | | | | | | | |
Stockholders' equity, ending balance at Sep. 30, 2019 | $ 15,742 | | | | | $ 0 | 30,513 | | (185) | (15,266) | 680 |
Shares, outstanding at Sep. 30, 2019 | 1,703,630,000 | | | | | 1,703,629,000 | | | | | |
Mezzanine Equity, Amount at Mar. 31, 2019 | | | (4) | $ 14,224 | | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2019 | | | | 904,530,000 | | | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | | |
Mezzanine equity, net income (loss) | | | (10) | | | | | | | | |
Mezzanine Equity, Amount at Jun. 30, 2019 | | | (14) | $ 0 | | | | | | | |
Mezzanine Equity, Shares at Jun. 30, 2019 | | | | 0 | | | | | | | |
Stockholders' equity, beginning balance at Mar. 31, 2019 | $ (8,432) | | | | | $ 0 | 682 | | (246) | (8,868) | 0 |
Shares, outstanding at Mar. 31, 2019 | | | | | | 457,833,000 | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Lapsing of repurchase option related to common stock issued to a non-employee service provider | 3 | | | | | | 3 | | | | |
Conversion of warrant to common stock in connection with initial public offering (in shares) | | | | | | 150,000 | | | | | |
Conversion of warrant to common stock in connection with initial public offering | 6 | | | | | | 6 | | | | |
Conversion of Convertible Notes to common stock in connection with initial public offering (in shares) | | | | | | 93,978,000 | | | | | |
Conversion of convertible notes to common stock in connection with initial public offering | 4,229 | | | | | | 4,229 | | | | |
Exercise of stock options | 1 | | | | | | 1 | | | | |
Exercise of stock options (in shares) | | | | | | 501,000 | | | | | |
Stock-based compensation | 3,943 | | | | | | 3,943 | | | | |
Unrealized gain (loss) on available-for-sale securities | 8 | | | | | | | | 8 | | |
Foreign currency translation adjustment | 71 | | | | | | | | 71 | | |
Issuance of common stock in connection with initial public offering, net of offering costs | 7,973 | | | | | | 7,973 | | | | |
Issuance of common stock in connection with initial public offering, net of offering cost (in shares) | | | | | | 180,000,000 | | | | | |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering | 14,224 | | | $ (14,224) | | | 14,224 | | | | |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering (in shares) | | | | (904,530,000) | | 904,530,000 | | | | | |
Issuance of common stock related to private placement | 500 | | | | | | 500 | | | | |
Issuance of common stock related to private placement (in shares) | | | | | | 11,111,000 | | | | | |
Issuance of common stock for settlement of RSUs | 0 | | | | | | | | | | |
Issuance of common stock for settlement of restricted stock units (RSUs) (in shares) | | | | | | 80,015,000 | | | | | |
Shares withheld related to net share settlement | (1,368) | | | | | | (1,368) | | | | |
Shares withheld related to net share settlement (in shares) | | | | | | (30,504,000) | | | | | |
Net income (loss) | (5,236) | | | | | | | | | (5,236) | |
Stockholders' equity, ending balance at Jun. 30, 2019 | 15,922 | | | | | $ 0 | 30,193 | | (167) | (14,104) | 0 |
Shares, outstanding at Jun. 30, 2019 | | | | | | 1,697,614,000 | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | | |
Issuance of non-controlling interests | $ 667 | | 333 | | | | | | | | 667 |
Mezzanine equity, net income (loss) | | | (10) | | | | | | | | |
Mezzanine Equity, Amount at Sep. 30, 2019 | | | 309 | $ 0 | | | | | | | |
Mezzanine Equity, Shares at Sep. 30, 2019 | 0 | | | 0 | | | | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | | |
Lapsing of repurchase option related to common stock issued to a non-employee service provider | $ 2 | | | | | | 2 | | | | |
Exercise of stock options | 0 | | | | | | | | | | |
Exercise of stock options (in shares) | | | | | | 94,000 | | | | | |
Issuance of common stock from stock option exercise and restricted stock awards | 0 | | | | | | | | | | |
Issuance of common stock from stock option exercise and restricted stock awards (in shares) | | | | | | 9,553,000 | | | | | |
Stock-based compensation | 426 | | | | | | 426 | | | | |
Reclassification of share-based award liability to additional paid-in capital | 20 | | | | | | 20 | | | | |
Issuance and repayment of employee loans collateralized by outstanding common stock | 10 | | | | | | 10 | | | | |
Issuance of common stock as consideration for investment and acquisition | 9 | | | | | | 9 | | | | |
Issuance of common stock as consideration for investment and acquisition (in shares) | | | | | | 188,000 | | | | | |
Issuance of non-controlling interests | 667 | | $ 333 | | | | | | | | 667 |
Unrealized gain (loss) on available-for-sale securities | (4) | | | | | | | | (4) | | |
Foreign currency translation adjustment | (14) | | | | | | | | (14) | | |
Shares withheld related to net share settlement | (147) | | | | | | (147) | | | | |
Shares withheld related to net share settlement (in shares) | | | | | | (3,820,000) | | | | | |
Net income (loss) | (1,149) | | | | | | | | | (1,162) | 13 |
Stockholders' equity, ending balance at Sep. 30, 2019 | $ 15,742 | | | | | $ 0 | $ 30,513 | | $ (185) | $ (15,266) | $ 680 |
Shares, outstanding at Sep. 30, 2019 | 1,703,630,000 | | | | | 1,703,629,000 | | | | | |