# File lib/http/cookie_jar/mozilla_store.rb, line 443
    def cleanup(session = false)
      synchronize {
        break if @gc_index == 0

        @stmt[:delete_expired].execute({ 'expiry' => Time.now.to_i })

        @stmt[:overusing_domains].execute({
            'count' => HTTP::Cookie::MAX_COOKIES_PER_DOMAIN
          }).each { |row|
          domain, count = row['domain'], row['count']

          @stmt[:delete_per_domain_overuse].execute({
              'domain' => domain,
              'limit' => count - HTTP::Cookie::MAX_COOKIES_PER_DOMAIN,
            })
        }

        overrun = count - HTTP::Cookie::MAX_COOKIES_TOTAL

        if overrun > 0
          @stmt[:delete_total_overuse].execute({ 'limit' => overrun })
        end

        @gc_index = 0
      }
      self
    end