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

Side by Side Diff: content/browser/browser_url_handler_impl.cc

Issue 418733002: Prevent duplicate navigation to debug URLs from Telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstate DebugURLHandler. Remove IsDebugURL(). Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/frame_host/debug_urls.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser_url_handler_impl.h" 5 #include "content/browser/browser_url_handler_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
Ken Russell (switch to Gerrit) 2014/07/23 23:53:58 No longer needed.
vmiura 2014/07/24 23:40:38 Done.
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "cc/base/switches.h" 9 #include "cc/base/switches.h"
Ken Russell (switch to Gerrit) 2014/07/23 23:53:57 No longer needed.
vmiura 2014/07/24 23:40:38 Done.
10 #include "content/browser/frame_host/debug_urls.h" 10 #include "content/browser/frame_host/debug_urls.h"
11 #include "content/browser/webui/web_ui_impl.h" 11 #include "content/browser/webui/web_ui_impl.h"
12 #include "content/public/browser/content_browser_client.h" 12 #include "content/public/browser/content_browser_client.h"
13 #include "content/public/common/url_constants.h" 13 #include "content/public/common/url_constants.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 // Handles rewriting view-source URLs for what we'll actually load. 18 // Handles rewriting view-source URLs for what we'll actually load.
19 static bool HandleViewSource(GURL* url, BrowserContext* browser_context) { 19 static bool HandleViewSource(GURL* url, BrowserContext* browser_context) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 url::Replacements<char> repl; 68 url::Replacements<char> repl;
69 repl.SetScheme(kViewSourceScheme, 69 repl.SetScheme(kViewSourceScheme,
70 url::Component(0, strlen(kViewSourceScheme))); 70 url::Component(0, strlen(kViewSourceScheme)));
71 repl.SetPath(url->spec().c_str(), url::Component(0, url->spec().size())); 71 repl.SetPath(url->spec().c_str(), url::Component(0, url->spec().size()));
72 *url = url->ReplaceComponents(repl); 72 *url = url->ReplaceComponents(repl);
73 return true; 73 return true;
74 } 74 }
75 75
76 static bool DebugURLHandler(GURL* url, BrowserContext* browser_context) { 76 static bool DebugURLHandler(GURL* url, BrowserContext* browser_context) {
77 // If running inside the Telemetry test harness, allow automated
78 // navigations to access browser-side debug URLs. They must use the
79 // chrome:// scheme, since the about: scheme won't be rewritten in
80 // this code path.
81 if (CommandLine::ForCurrentProcess()->HasSwitch(
82 cc::switches::kEnableGpuBenchmarking)) {
83 if (HandleDebugURL(*url, PAGE_TRANSITION_FROM_ADDRESS_BAR)) {
84 return true;
85 }
86 }
87
88 // Circumvent processing URLs that the renderer process will handle. 77 // Circumvent processing URLs that the renderer process will handle.
89 return IsRendererDebugURL(*url); 78 return IsRendererDebugURL(*url);
90 } 79 }
91 80
92 // static 81 // static
93 BrowserURLHandler* BrowserURLHandler::GetInstance() { 82 BrowserURLHandler* BrowserURLHandler::GetInstance() {
94 return BrowserURLHandlerImpl::GetInstance(); 83 return BrowserURLHandlerImpl::GetInstance();
95 } 84 }
96 85
97 // static 86 // static
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return true; 136 return true;
148 } else if (handler(&test_url, browser_context)) { 137 } else if (handler(&test_url, browser_context)) {
149 return reverse_rewriter(url, browser_context); 138 return reverse_rewriter(url, browser_context);
150 } 139 }
151 } 140 }
152 } 141 }
153 return false; 142 return false;
154 } 143 }
155 144
156 } // namespace content 145 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/debug_urls.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698