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

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

Issue 112053002: Allow the max url length to be overridden (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually using the new API in AWV Created 7 years 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 | Annotate | Revision Log
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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "content/public/browser/user_metrics.h" 70 #include "content/public/browser/user_metrics.h"
71 #include "content/public/browser/web_contents_delegate.h" 71 #include "content/public/browser/web_contents_delegate.h"
72 #include "content/public/browser/web_contents_observer.h" 72 #include "content/public/browser/web_contents_observer.h"
73 #include "content/public/browser/web_contents_view.h" 73 #include "content/public/browser/web_contents_view.h"
74 #include "content/public/common/bindings_policy.h" 74 #include "content/public/common/bindings_policy.h"
75 #include "content/public/common/content_constants.h" 75 #include "content/public/common/content_constants.h"
76 #include "content/public/common/content_switches.h" 76 #include "content/public/common/content_switches.h"
77 #include "content/public/common/page_zoom.h" 77 #include "content/public/common/page_zoom.h"
78 #include "content/public/common/result_codes.h" 78 #include "content/public/common/result_codes.h"
79 #include "content/public/common/url_constants.h" 79 #include "content/public/common/url_constants.h"
80 #include "content/public/common/url_utils.h"
80 #include "net/base/mime_util.h" 81 #include "net/base/mime_util.h"
81 #include "net/base/net_util.h" 82 #include "net/base/net_util.h"
82 #include "net/http/http_cache.h" 83 #include "net/http/http_cache.h"
83 #include "net/http/http_transaction_factory.h" 84 #include "net/http/http_transaction_factory.h"
84 #include "net/url_request/url_request_context.h" 85 #include "net/url_request/url_request_context.h"
85 #include "net/url_request/url_request_context_getter.h" 86 #include "net/url_request/url_request_context_getter.h"
86 #include "ui/base/layout.h" 87 #include "ui/base/layout.h"
87 #include "ui/gfx/display.h" 88 #include "ui/gfx/display.h"
88 #include "ui/gfx/screen.h" 89 #include "ui/gfx/screen.h"
89 #include "ui/gl/gl_switches.h" 90 #include "ui/gl/gl_switches.h"
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 DidDetachInterstitialPage()); 1668 DidDetachInterstitialPage());
1668 } 1669 }
1669 1670
1670 bool WebContentsImpl::NavigateToEntry( 1671 bool WebContentsImpl::NavigateToEntry(
1671 const NavigationEntryImpl& entry, 1672 const NavigationEntryImpl& entry,
1672 NavigationController::ReloadType reload_type) { 1673 NavigationController::ReloadType reload_type) {
1673 TRACE_EVENT0("browser", "WebContentsImpl::NavigateToEntry"); 1674 TRACE_EVENT0("browser", "WebContentsImpl::NavigateToEntry");
1674 1675
1675 // The renderer will reject IPC messages with URLs longer than 1676 // The renderer will reject IPC messages with URLs longer than
1676 // this limit, so don't attempt to navigate with a longer URL. 1677 // this limit, so don't attempt to navigate with a longer URL.
1677 if (entry.GetURL().spec().size() > kMaxURLChars) { 1678 if (entry.GetURL().spec().size() > MaxURLChars()) {
1678 LOG(WARNING) << "Refusing to load URL as it exceeds " << kMaxURLChars 1679 LOG(WARNING) << "Refusing to load URL as it exceeds " << MaxURLChars()
1679 << " characters."; 1680 << " characters.";
1680 return false; 1681 return false;
1681 } 1682 }
1682 1683
1683 // TODO(creis): Use entry->frame_tree_node_id() to pick which 1684 // TODO(creis): Use entry->frame_tree_node_id() to pick which
1684 // RenderFrameHostManager to use. 1685 // RenderFrameHostManager to use.
1685 RenderViewHostImpl* dest_render_view_host = 1686 RenderViewHostImpl* dest_render_view_host =
1686 static_cast<RenderViewHostImpl*>(GetRenderManager()->Navigate(entry)); 1687 static_cast<RenderViewHostImpl*>(GetRenderManager()->Navigate(entry));
1687 if (!dest_render_view_host) 1688 if (!dest_render_view_host)
1688 return false; // Unable to create the desired render view host. 1689 return false; // Unable to create the desired render view host.
(...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after
3775 } 3776 }
3776 3777
3777 void WebContentsImpl::OnFrameRemoved( 3778 void WebContentsImpl::OnFrameRemoved(
3778 RenderViewHostImpl* render_view_host, 3779 RenderViewHostImpl* render_view_host,
3779 int64 frame_id) { 3780 int64 frame_id) {
3780 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3781 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3781 FrameDetached(render_view_host, frame_id)); 3782 FrameDetached(render_view_host, frame_id));
3782 } 3783 }
3783 3784
3784 } // namespace content 3785 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698