| OLD | NEW |
| 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 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return false; | 76 return false; |
| 77 } | 77 } |
| 78 | 78 |
| 79 return true; | 79 return true; |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Parse |url| to get the path which will be used to resolve the request. The | 82 // Parse |url| to get the path which will be used to resolve the request. The |
| 83 // path is the remaining portion after the scheme and hostname. | 83 // path is the remaining portion after the scheme and hostname. |
| 84 void URLToRequestPath(const GURL& url, std::string* path) { | 84 void URLToRequestPath(const GURL& url, std::string* path) { |
| 85 const std::string& spec = url.possibly_invalid_spec(); | 85 const std::string& spec = url.possibly_invalid_spec(); |
| 86 const url_parse::Parsed& parsed = url.parsed_for_possibly_invalid_spec(); | 86 const url::Parsed& parsed = url.parsed_for_possibly_invalid_spec(); |
| 87 // + 1 to skip the slash at the beginning of the path. | 87 // + 1 to skip the slash at the beginning of the path. |
| 88 int offset = parsed.CountCharactersBefore(url_parse::Parsed::PATH, false) + 1; | 88 int offset = parsed.CountCharactersBefore(url::Parsed::PATH, false) + 1; |
| 89 | 89 |
| 90 if (offset < static_cast<int>(spec.size())) | 90 if (offset < static_cast<int>(spec.size())) |
| 91 path->assign(spec.substr(offset)); | 91 path->assign(spec.substr(offset)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| 95 | 95 |
| 96 // URLRequestChromeJob is a net::URLRequestJob that manages running | 96 // URLRequestChromeJob is a net::URLRequestJob that manages running |
| 97 // chrome-internal resource requests asynchronously. | 97 // chrome-internal resource requests asynchronously. |
| 98 // It hands off URL requests to ChromeURLDataManager, which asynchronously | 98 // It hands off URL requests to ChromeURLDataManager, which asynchronously |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 | 726 |
| 727 } // namespace | 727 } // namespace |
| 728 | 728 |
| 729 net::URLRequestJobFactory::ProtocolHandler* | 729 net::URLRequestJobFactory::ProtocolHandler* |
| 730 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 730 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| 731 bool is_incognito) { | 731 bool is_incognito) { |
| 732 return new DevToolsJobFactory(resource_context, is_incognito); | 732 return new DevToolsJobFactory(resource_context, is_incognito); |
| 733 } | 733 } |
| 734 | 734 |
| 735 } // namespace content | 735 } // namespace content |
| OLD | NEW |