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

Side by Side Diff: components/dom_distiller/content/renderer/distillability_agent.cc

Issue 2469803002: Only send distillability message on valid pipe (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/metrics/histogram.h" 5 #include "base/metrics/histogram.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 7
8 #include "components/dom_distiller/content/common/distillability_service.mojom.h " 8 #include "components/dom_distiller/content/common/distillability_service.mojom.h "
9 #include "components/dom_distiller/content/renderer/distillability_agent.h" 9 #include "components/dom_distiller/content/renderer/distillability_agent.h"
10 #include "components/dom_distiller/core/distillable_page_detector.h" 10 #include "components/dom_distiller/core/distillable_page_detector.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 bool is_loaded = layout_type == WebMeaningfulLayout::FinishedLoading; 197 bool is_loaded = layout_type == WebMeaningfulLayout::FinishedLoading;
198 if (!NeedToUpdate(is_loaded)) return; 198 if (!NeedToUpdate(is_loaded)) return;
199 199
200 bool is_last = IsLast(is_loaded); 200 bool is_last = IsLast(is_loaded);
201 // Connect to Mojo service on browser to notify page distillability. 201 // Connect to Mojo service on browser to notify page distillability.
202 mojom::DistillabilityServicePtr distillability_service; 202 mojom::DistillabilityServicePtr distillability_service;
203 render_frame()->GetRemoteInterfaces()->GetInterface( 203 render_frame()->GetRemoteInterfaces()->GetInterface(
204 &distillability_service); 204 &distillability_service);
205 DCHECK(distillability_service); 205 DCHECK(distillability_service);
206 if (!distillability_service.is_bound()) return;
206 distillability_service->NotifyIsDistillable( 207 distillability_service->NotifyIsDistillable(
207 IsDistillablePage(doc, is_last), is_last); 208 IsDistillablePage(doc, is_last), is_last);
208 } 209 }
209 210
210 DistillabilityAgent::~DistillabilityAgent() {} 211 DistillabilityAgent::~DistillabilityAgent() {}
211 212
212 void DistillabilityAgent::OnDestruct() { 213 void DistillabilityAgent::OnDestruct() {
213 delete this; 214 delete this;
214 } 215 }
215 216
216 } // namespace dom_distiller 217 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698