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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10310124: Implement a ResourceThrottle for URL overriding in Chrome on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed chromeos build issue + rebase Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 content::RenderViewHost* render_view_host, 1775 content::RenderViewHost* render_view_host,
1776 int64 frame_id, 1776 int64 frame_id,
1777 bool is_main_frame, 1777 bool is_main_frame,
1778 const GURL& opener_url, 1778 const GURL& opener_url,
1779 const GURL& url) { 1779 const GURL& url) {
1780 bool is_error_page = (url.spec() == content::kUnreachableWebDataURL); 1780 bool is_error_page = (url.spec() == content::kUnreachableWebDataURL);
1781 GURL validated_url(url); 1781 GURL validated_url(url);
1782 GURL validated_opener_url(opener_url); 1782 GURL validated_opener_url(opener_url);
1783 content::RenderProcessHost* render_process_host = 1783 content::RenderProcessHost* render_process_host =
1784 render_view_host->GetProcess(); 1784 render_view_host->GetProcess();
1785 RenderViewHostImpl::FilterURL( 1785 RenderViewHost::FilterURL(
1786 ChildProcessSecurityPolicyImpl::GetInstance(),
1787 render_process_host->GetID(), 1786 render_process_host->GetID(),
1788 false, 1787 false,
1789 &validated_url); 1788 &validated_url);
1790 RenderViewHostImpl::FilterURL( 1789 RenderViewHost::FilterURL(
1791 ChildProcessSecurityPolicyImpl::GetInstance(),
1792 render_process_host->GetID(), 1790 render_process_host->GetID(),
1793 true, 1791 true,
1794 &validated_opener_url); 1792 &validated_opener_url);
1795 1793
1796 // Notify observers about the start of the provisional load. 1794 // Notify observers about the start of the provisional load.
1797 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 1795 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1798 DidStartProvisionalLoadForFrame(frame_id, is_main_frame, 1796 DidStartProvisionalLoadForFrame(frame_id, is_main_frame,
1799 validated_url, is_error_page, render_view_host)); 1797 validated_url, is_error_page, render_view_host));
1800 } 1798 }
1801 1799
1802 void WebContentsImpl::DidFailProvisionalLoadWithError( 1800 void WebContentsImpl::DidFailProvisionalLoadWithError(
1803 content::RenderViewHost* render_view_host, 1801 content::RenderViewHost* render_view_host,
1804 const ViewHostMsg_DidFailProvisionalLoadWithError_Params& params) { 1802 const ViewHostMsg_DidFailProvisionalLoadWithError_Params& params) {
1805 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() 1803 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec()
1806 << ", error_code: " << params.error_code 1804 << ", error_code: " << params.error_code
1807 << ", error_description: " << params.error_description 1805 << ", error_description: " << params.error_description
1808 << ", is_main_frame: " << params.is_main_frame 1806 << ", is_main_frame: " << params.is_main_frame
1809 << ", showing_repost_interstitial: " << 1807 << ", showing_repost_interstitial: " <<
1810 params.showing_repost_interstitial 1808 params.showing_repost_interstitial
1811 << ", frame_id: " << params.frame_id; 1809 << ", frame_id: " << params.frame_id;
1812 GURL validated_url(params.url); 1810 GURL validated_url(params.url);
1813 content::RenderProcessHost* render_process_host = 1811 content::RenderProcessHost* render_process_host =
1814 render_view_host->GetProcess(); 1812 render_view_host->GetProcess();
1815 RenderViewHostImpl::FilterURL( 1813 RenderViewHost::FilterURL(
1816 ChildProcessSecurityPolicyImpl::GetInstance(),
1817 render_process_host->GetID(), 1814 render_process_host->GetID(),
1818 false, 1815 false,
1819 &validated_url); 1816 &validated_url);
1820 1817
1821 if (net::ERR_ABORTED == params.error_code) { 1818 if (net::ERR_ABORTED == params.error_code) {
1822 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials. 1819 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials.
1823 // This means that the interstitial won't be torn down properly, which is 1820 // This means that the interstitial won't be torn down properly, which is
1824 // bad. But if we have an interstitial, go back to another tab type, and 1821 // bad. But if we have an interstitial, go back to another tab type, and
1825 // then load the same interstitial again, we could end up getting the first 1822 // then load the same interstitial again, we could end up getting the first
1826 // interstitial's "failed" message (as a result of the cancel) when we're on 1823 // interstitial's "failed" message (as a result of the cancel) when we're on
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
3036 browser_plugin_host()->embedder_render_process_host(); 3033 browser_plugin_host()->embedder_render_process_host();
3037 *embedder_container_id = browser_plugin_host()->instance_id(); 3034 *embedder_container_id = browser_plugin_host()->instance_id();
3038 int embedder_process_id = 3035 int embedder_process_id =
3039 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3036 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3040 if (embedder_process_id != -1) { 3037 if (embedder_process_id != -1) {
3041 *embedder_channel_name = 3038 *embedder_channel_name =
3042 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3039 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3043 embedder_process_id); 3040 embedder_process_id);
3044 } 3041 }
3045 } 3042 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698