| 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 private: | 199 private: |
| 200 ContentExtractionRequest(const GURL& url) : url_(url) {} | 200 ContentExtractionRequest(const GURL& url) : url_(url) {} |
| 201 | 201 |
| 202 virtual void OnArticleUpdated(ArticleDistillationUpdate article_update) | 202 virtual void OnArticleUpdated(ArticleDistillationUpdate article_update) |
| 203 OVERRIDE {} | 203 OVERRIDE {} |
| 204 | 204 |
| 205 virtual void OnArticleReady(const DistilledArticleProto* article_proto) | 205 virtual void OnArticleReady(const DistilledArticleProto* article_proto) |
| 206 OVERRIDE { | 206 OVERRIDE { |
| 207 article_proto_ = article_proto; | 207 article_proto_ = article_proto; |
| 208 CHECK(article_proto->pages_size()) << "Failed extracting " << url_; |
| 208 base::MessageLoop::current()->PostTask( | 209 base::MessageLoop::current()->PostTask( |
| 209 FROM_HERE, | 210 FROM_HERE, |
| 210 finished_callback_); | 211 finished_callback_); |
| 211 } | 212 } |
| 212 | 213 |
| 213 const DistilledArticleProto* article_proto_; | 214 const DistilledArticleProto* article_proto_; |
| 214 scoped_ptr<ViewerHandle> viewer_handle_; | 215 scoped_ptr<ViewerHandle> viewer_handle_; |
| 215 GURL url_; | 216 GURL url_; |
| 216 base::Closure finished_callback_; | 217 base::Closure finished_callback_; |
| 217 }; | 218 }; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 std::string output_data_; | 332 std::string output_data_; |
| 332 scoped_ptr<google::protobuf::io::StringOutputStream> protobuf_output_stream_; | 333 scoped_ptr<google::protobuf::io::StringOutputStream> protobuf_output_stream_; |
| 333 }; | 334 }; |
| 334 | 335 |
| 335 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { | 336 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { |
| 336 Start(); | 337 Start(); |
| 337 base::RunLoop().Run(); | 338 base::RunLoop().Run(); |
| 338 } | 339 } |
| 339 | 340 |
| 340 } // namespace dom_distiller | 341 } // namespace dom_distiller |
| OLD | NEW |