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

Side by Side Diff: components/dom_distiller/content/browser/dom_distiller_viewer_source.cc

Issue 2369923003: Fix assert with distiller code caused by r419635. (Closed)
Patch Set: Created 4 years, 2 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 | « 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 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 "components/dom_distiller/content/browser/dom_distiller_viewer_source.h " 5 #include "components/dom_distiller/content/browser/dom_distiller_viewer_source.h "
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } else { 125 } else {
126 DCHECK(buffer_.empty()); 126 DCHECK(buffer_.empty());
127 if (web_contents()) { 127 if (web_contents()) {
128 RunIsolatedJavaScript(web_contents()->GetMainFrame(), buffer); 128 RunIsolatedJavaScript(web_contents()->GetMainFrame(), buffer);
129 } 129 }
130 } 130 }
131 } 131 }
132 132
133 void DomDistillerViewerSource::RequestViewerHandle::DidFinishNavigation( 133 void DomDistillerViewerSource::RequestViewerHandle::DidFinishNavigation(
134 content::NavigationHandle* navigation_handle) { 134 content::NavigationHandle* navigation_handle) {
135 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
136 return;
137
135 const GURL& navigation = navigation_handle->GetURL(); 138 const GURL& navigation = navigation_handle->GetURL();
136 bool expected_main_view_request = 139 bool expected_main_view_request =
137 navigation.SchemeIs(expected_scheme_.c_str()) && 140 navigation.SchemeIs(expected_scheme_.c_str()) &&
138 expected_request_path_ == navigation.query(); 141 expected_request_path_ == navigation.query();
139 if (navigation_handle->IsSamePage() || expected_main_view_request) { 142 if (navigation_handle->IsSamePage() || expected_main_view_request) {
140 // In-page navigations, as well as the main view request can be ignored. 143 // In-page navigations, as well as the main view request can be ignored.
141 if (expected_main_view_request) { 144 if (expected_main_view_request) {
142 content::RenderFrameHost* render_frame_host = 145 content::RenderFrameHost* render_frame_host =
143 navigation_handle->GetRenderFrameHost(); 146 navigation_handle->GetRenderFrameHost();
144 content::RenderViewHost* render_view_host = 147 content::RenderViewHost* render_view_host =
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc() 304 std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc()
302 const { 305 const {
303 return "style-src 'self' https://fonts.googleapis.com;"; 306 return "style-src 'self' https://fonts.googleapis.com;";
304 } 307 }
305 308
306 std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() const { 309 std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() const {
307 return "child-src *;"; 310 return "child-src *;";
308 } 311 }
309 312
310 } // namespace dom_distiller 313 } // 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