| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 return requests; | 300 return requests; |
| 301 } | 301 } |
| 302 | 302 |
| 303 private: | 303 private: |
| 304 ContentExtractionRequest(const GURL& url) : url_(url) {} | 304 ContentExtractionRequest(const GURL& url) : url_(url) {} |
| 305 | 305 |
| 306 void OnArticleUpdated(ArticleDistillationUpdate article_update) override {} | 306 void OnArticleUpdated(ArticleDistillationUpdate article_update) override {} |
| 307 | 307 |
| 308 void OnArticleReady(const DistilledArticleProto* article_proto) override { | 308 void OnArticleReady(const DistilledArticleProto* article_proto) override { |
| 309 article_proto_ = article_proto; | 309 article_proto_ = article_proto; |
| 310 CHECK(article_proto->pages_size()) << "Failed extracting " << url_; | 310 // Failed extracting |url_|. |
| 311 CHECK(article_proto->pages_size()); |
| 311 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 312 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 312 finished_callback_); | 313 finished_callback_); |
| 313 } | 314 } |
| 314 | 315 |
| 315 const DistilledArticleProto* article_proto_; | 316 const DistilledArticleProto* article_proto_; |
| 316 std::unique_ptr<ViewerHandle> viewer_handle_; | 317 std::unique_ptr<ViewerHandle> viewer_handle_; |
| 317 GURL url_; | 318 GURL url_; |
| 318 base::Closure finished_callback_; | 319 base::Closure finished_callback_; |
| 319 }; | 320 }; |
| 320 | 321 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 protobuf_output_stream_; | 439 protobuf_output_stream_; |
| 439 }; | 440 }; |
| 440 | 441 |
| 441 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { | 442 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { |
| 442 SetDistillerJavaScriptWorldId(content::ISOLATED_WORLD_ID_CONTENT_END); | 443 SetDistillerJavaScriptWorldId(content::ISOLATED_WORLD_ID_CONTENT_END); |
| 443 Start(); | 444 Start(); |
| 444 base::RunLoop().Run(); | 445 base::RunLoop().Run(); |
| 445 } | 446 } |
| 446 | 447 |
| 447 } // namespace dom_distiller | 448 } // namespace dom_distiller |
| OLD | NEW |