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

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: moved back to src/chrome, not using WebContentsDelegate 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 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 content::RenderViewHost* render_view_host, 1773 content::RenderViewHost* render_view_host,
1774 int64 frame_id, 1774 int64 frame_id,
1775 bool is_main_frame, 1775 bool is_main_frame,
1776 const GURL& opener_url, 1776 const GURL& opener_url,
1777 const GURL& url) { 1777 const GURL& url) {
1778 bool is_error_page = (url.spec() == content::kUnreachableWebDataURL); 1778 bool is_error_page = (url.spec() == content::kUnreachableWebDataURL);
1779 GURL validated_url(url); 1779 GURL validated_url(url);
1780 GURL validated_opener_url(opener_url); 1780 GURL validated_opener_url(opener_url);
1781 content::RenderProcessHost* render_process_host = 1781 content::RenderProcessHost* render_process_host =
1782 render_view_host->GetProcess(); 1782 render_view_host->GetProcess();
1783 RenderViewHostImpl::FilterURL( 1783 RenderViewHost::FilterURL(
1784 ChildProcessSecurityPolicyImpl::GetInstance(),
1785 render_process_host->GetID(), 1784 render_process_host->GetID(),
1786 false, 1785 false,
1787 &validated_url); 1786 &validated_url);
1788 RenderViewHostImpl::FilterURL( 1787 RenderViewHost::FilterURL(
1789 ChildProcessSecurityPolicyImpl::GetInstance(),
1790 render_process_host->GetID(), 1788 render_process_host->GetID(),
1791 true, 1789 true,
1792 &validated_opener_url); 1790 &validated_opener_url);
1793 1791
1794 // Notify observers about the start of the provisional load. 1792 // Notify observers about the start of the provisional load.
1795 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 1793 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1796 DidStartProvisionalLoadForFrame(frame_id, is_main_frame, 1794 DidStartProvisionalLoadForFrame(frame_id, is_main_frame,
1797 validated_url, is_error_page, render_view_host)); 1795 validated_url, is_error_page, render_view_host));
1798 1796
1799 if (is_main_frame) { 1797 if (is_main_frame) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() 1855 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec()
1858 << ", error_code: " << params.error_code 1856 << ", error_code: " << params.error_code
1859 << ", error_description: " << params.error_description 1857 << ", error_description: " << params.error_description
1860 << ", is_main_frame: " << params.is_main_frame 1858 << ", is_main_frame: " << params.is_main_frame
1861 << ", showing_repost_interstitial: " << 1859 << ", showing_repost_interstitial: " <<
1862 params.showing_repost_interstitial 1860 params.showing_repost_interstitial
1863 << ", frame_id: " << params.frame_id; 1861 << ", frame_id: " << params.frame_id;
1864 GURL validated_url(params.url); 1862 GURL validated_url(params.url);
1865 content::RenderProcessHost* render_process_host = 1863 content::RenderProcessHost* render_process_host =
1866 render_view_host->GetProcess(); 1864 render_view_host->GetProcess();
1867 RenderViewHostImpl::FilterURL( 1865 RenderViewHost::FilterURL(
1868 ChildProcessSecurityPolicyImpl::GetInstance(),
1869 render_process_host->GetID(), 1866 render_process_host->GetID(),
1870 false, 1867 false,
1871 &validated_url); 1868 &validated_url);
1872 1869
1873 if (net::ERR_ABORTED == params.error_code) { 1870 if (net::ERR_ABORTED == params.error_code) {
1874 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials. 1871 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials.
1875 // This means that the interstitial won't be torn down properly, which is 1872 // This means that the interstitial won't be torn down properly, which is
1876 // bad. But if we have an interstitial, go back to another tab type, and 1873 // bad. But if we have an interstitial, go back to another tab type, and
1877 // then load the same interstitial again, we could end up getting the first 1874 // then load the same interstitial again, we could end up getting the first
1878 // interstitial's "failed" message (as a result of the cancel) when we're on 1875 // 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
3088 browser_plugin_host()->embedder_render_process_host(); 3085 browser_plugin_host()->embedder_render_process_host();
3089 *embedder_container_id = browser_plugin_host()->instance_id(); 3086 *embedder_container_id = browser_plugin_host()->instance_id();
3090 int embedder_process_id = 3087 int embedder_process_id =
3091 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3088 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3092 if (embedder_process_id != -1) { 3089 if (embedder_process_id != -1) {
3093 *embedder_channel_name = 3090 *embedder_channel_name =
3094 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3091 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3095 embedder_process_id); 3092 embedder_process_id);
3096 } 3093 }
3097 } 3094 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698