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

Unified Diff: components/dom_distiller/core/dom_distiller_service.cc

Issue 1575473002: Improve syncing between dom distiller and the print preview request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making the new operation (AddViewRequestDelegate) less intrusive on the DomDistillerService's inter… Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/core/dom_distiller_service.cc
diff --git a/components/dom_distiller/core/dom_distiller_service.cc b/components/dom_distiller/core/dom_distiller_service.cc
index 47d4f06d62986afcde2b3d376989f3a1380f3fc8..d7f12d467c9f9ae70efd7491a94b1cac9064aede 100644
--- a/components/dom_distiller/core/dom_distiller_service.cc
+++ b/components/dom_distiller/core/dom_distiller_service.cc
@@ -189,6 +189,17 @@ scoped_ptr<ViewerHandle> DomDistillerService::ViewUrl(
return viewer_handle;
}
+scoped_ptr<ViewerHandle> DomDistillerService::AddViewRequestDelegate(
+ ViewRequestDelegate* delegate,
+ const GURL& url) {
+ TaskTracker* task_tracker = GetTaskTrackerForUrl(url);
+ if (task_tracker) {
+ return task_tracker->AddViewer(delegate);
+ } else {
nyquist 2016/02/11 15:57:53 Nit: There's a return-statement in the if-block, s
mvendramini_hp 2016/02/11 19:00:46 Done.
+ return nullptr;
+ }
+}
+
bool DomDistillerService::GetOrCreateTaskTrackerForUrl(
const GURL& url,
TaskTracker** task_tracker) {

Powered by Google App Engine
This is Rietveld 408576698