| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 std::move(config), std::move(loading_task_runner)); | 93 std::move(config), std::move(loading_task_runner)); |
| 94 return background_parser->weak_factory_.CreateWeakPtr(); | 94 return background_parser->weak_factory_.CreateWeakPtr(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void BackgroundHTMLParser::Init( | 97 void BackgroundHTMLParser::Init( |
| 98 const KURL& document_url, | 98 const KURL& document_url, |
| 99 std::unique_ptr<CachedDocumentParameters> cached_document_parameters, | 99 std::unique_ptr<CachedDocumentParameters> cached_document_parameters, |
| 100 const MediaValuesCached::MediaValuesCachedData& media_values_cached_data) { | 100 const MediaValuesCached::MediaValuesCachedData& media_values_cached_data) { |
| 101 preload_scanner_.reset(new TokenPreloadScanner( | 101 preload_scanner_.reset(new TokenPreloadScanner( |
| 102 document_url, std::move(cached_document_parameters), | 102 document_url, std::move(cached_document_parameters), |
| 103 media_values_cached_data)); | 103 media_values_cached_data, |
| 104 TokenPreloadScanner::ScannerType::kMainDocument)); |
| 104 } | 105 } |
| 105 | 106 |
| 106 BackgroundHTMLParser::Configuration::Configuration() | 107 BackgroundHTMLParser::Configuration::Configuration() |
| 107 : outstanding_token_limit(kDefaultOutstandingTokenLimit), | 108 : outstanding_token_limit(kDefaultOutstandingTokenLimit), |
| 108 pending_token_limit(kDefaultPendingTokenLimit), | 109 pending_token_limit(kDefaultPendingTokenLimit), |
| 109 should_coalesce_chunks(false) {} | 110 should_coalesce_chunks(false) {} |
| 110 | 111 |
| 111 BackgroundHTMLParser::BackgroundHTMLParser( | 112 BackgroundHTMLParser::BackgroundHTMLParser( |
| 112 std::unique_ptr<Configuration> config, | 113 std::unique_ptr<Configuration> config, |
| 113 RefPtr<WebTaskRunner> loading_task_runner) | 114 RefPtr<WebTaskRunner> loading_task_runner) |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 if (IsMainThread()) { | 380 if (IsMainThread()) { |
| 380 (*WTF::Bind(function, std::forward<Ps>(parameters)...))(); | 381 (*WTF::Bind(function, std::forward<Ps>(parameters)...))(); |
| 381 } else { | 382 } else { |
| 382 loading_task_runner_->PostTask( | 383 loading_task_runner_->PostTask( |
| 383 BLINK_FROM_HERE, | 384 BLINK_FROM_HERE, |
| 384 CrossThreadBind(function, std::forward<Ps>(parameters)...)); | 385 CrossThreadBind(function, std::forward<Ps>(parameters)...)); |
| 385 } | 386 } |
| 386 } | 387 } |
| 387 | 388 |
| 388 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |