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

Side by Side Diff: chromecast/browser/cast_content_browser_client.cc

Issue 1868763002: Remove URLRequest::IsHandledProtocol and IsHandledURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace some hardcoded strings Created 4 years, 8 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 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 "chromecast/browser/cast_content_browser_client.h" 5 #include "chromecast/browser/cast_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 new network_hints::NetworkHintsMessageFilter( 189 new network_hints::NetworkHintsMessageFilter(
190 url_request_context_factory_->host_resolver())); 190 url_request_context_factory_->host_resolver()));
191 host->AddFilter(network_hints_message_filter.get()); 191 host->AddFilter(network_hints_message_filter.get());
192 } 192 }
193 193
194 bool CastContentBrowserClient::IsHandledURL(const GURL& url) { 194 bool CastContentBrowserClient::IsHandledURL(const GURL& url) {
195 if (!url.is_valid()) 195 if (!url.is_valid())
196 return false; 196 return false;
197 197
198 static const char* const kProtocolList[] = { 198 static const char* const kProtocolList[] = {
199 content::kChromeUIScheme, 199 content::kChromeUIScheme, content::kChromeDevToolsScheme,
200 content::kChromeDevToolsScheme, 200 kChromeResourceScheme, url::kBlobScheme,
201 kChromeResourceScheme, 201 url::kDataScheme, url::kFileSystemScheme,
202 url::kBlobScheme, 202 url::kHttpScheme, url::kHttpsScheme,
203 url::kDataScheme, 203 url::kWsScheme, url::kWssScheme,
204 url::kFileSystemScheme,
205 }; 204 };
206 205
207 const std::string& scheme = url.scheme(); 206 const std::string& scheme = url.scheme();
208 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { 207 for (size_t i = 0; i < arraysize(kProtocolList); ++i) {
209 if (scheme == kProtocolList[i]) 208 if (scheme == kProtocolList[i])
210 return true; 209 return true;
211 } 210 }
212 211
213 if (scheme == url::kFileScheme) { 212 if (scheme == url::kFileScheme) {
214 return base::CommandLine::ForCurrentProcess()->HasSwitch( 213 return base::CommandLine::ForCurrentProcess()->HasSwitch(
215 switches::kEnableLocalFileAccesses); 214 switches::kEnableLocalFileAccesses);
216 } 215 }
217 216
218 return false; 217 return false;
mmenke 2016/04/21 18:24:19 I guess this didn't noticeably break anything beca
mgersh 2016/04/21 19:04:45 Looks like it. I guess it's never been called anyw
219 } 218 }
220 219
221 void CastContentBrowserClient::AppendExtraCommandLineSwitches( 220 void CastContentBrowserClient::AppendExtraCommandLineSwitches(
222 base::CommandLine* command_line, 221 base::CommandLine* command_line,
223 int child_process_id) { 222 int child_process_id) {
224 std::string process_type = 223 std::string process_type =
225 command_line->GetSwitchValueNative(switches::kProcessType); 224 command_line->GetSwitchValueNative(switches::kProcessType);
226 base::CommandLine* browser_command_line = 225 base::CommandLine* browser_command_line =
227 base::CommandLine::ForCurrentProcess(); 226 base::CommandLine::ForCurrentProcess();
228 227
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 process_type, dumps_path, false /* upload */); 490 process_type, dumps_path, false /* upload */);
492 // StartUploaderThread() even though upload is diferred. 491 // StartUploaderThread() even though upload is diferred.
493 // Breakpad-related memory is freed in the uploader thread. 492 // Breakpad-related memory is freed in the uploader thread.
494 crash_handler->StartUploaderThread(); 493 crash_handler->StartUploaderThread();
495 return crash_handler; 494 return crash_handler;
496 } 495 }
497 #endif // !defined(OS_ANDROID) 496 #endif // !defined(OS_ANDROID)
498 497
499 } // namespace shell 498 } // namespace shell
500 } // namespace chromecast 499 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698