Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: components/dom_distiller/standalone/content_extractor.cc

Issue 575883002: Fix handling of failed distillation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/dom_distiller/core/task_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/dom_distiller/core/task_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698