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

Side by Side Diff: content/browser/webui/url_data_manager_backend.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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/webui/url_data_manager_backend.h" 5 #include "content/browser/webui/url_data_manager_backend.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 if (request->url().SchemeIs(kChromeUIScheme) && 562 if (request->url().SchemeIs(kChromeUIScheme) &&
563 request->url().host_piece() == kChromeUIHistogramHost) { 563 request->url().host_piece() == kChromeUIHistogramHost) {
564 return new HistogramInternalsRequestJob(request, network_delegate); 564 return new HistogramInternalsRequestJob(request, network_delegate);
565 } 565 }
566 566
567 // Check for chrome://network-error/, which uses its own job type. 567 // Check for chrome://network-error/, which uses its own job type.
568 if (request->url().SchemeIs(kChromeUIScheme) && 568 if (request->url().SchemeIs(kChromeUIScheme) &&
569 request->url().host_piece() == kChromeUINetworkErrorHost) { 569 request->url().host_piece() == kChromeUINetworkErrorHost) {
570 // Get the error code passed in via the request URL path. 570 // Get the error code passed in via the request URL path.
571 std::basic_string<char> error_code_string = 571 std::basic_string<char> error_code_string =
572 request->url().path().substr(1); 572 request->url().path().substr(1).as_string();
573 573
574 int error_code; 574 int error_code;
575 if (base::StringToInt(error_code_string, &error_code)) { 575 if (base::StringToInt(error_code_string, &error_code)) {
576 // Check for a valid error code. 576 // Check for a valid error code.
577 if (IsValidNetworkErrorCode(error_code) && 577 if (IsValidNetworkErrorCode(error_code) &&
578 error_code != net::Error::ERR_IO_PENDING) { 578 error_code != net::Error::ERR_IO_PENDING) {
579 return new net::URLRequestErrorJob(request, network_delegate, 579 return new net::URLRequestErrorJob(request, network_delegate,
580 error_code); 580 error_code);
581 } 581 }
582 } 582 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 849
850 } // namespace 850 } // namespace
851 851
852 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( 852 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler(
853 ResourceContext* resource_context, 853 ResourceContext* resource_context,
854 bool is_incognito) { 854 bool is_incognito) {
855 return new DevToolsJobFactory(resource_context, is_incognito); 855 return new DevToolsJobFactory(resource_context, is_incognito);
856 } 856 }
857 857
858 } // namespace content 858 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698