OLD | NEW |
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 "content/common/navigation_params.h" | 5 #include "content/common/navigation_params.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/common/service_worker/service_worker_types.h" | 9 #include "content/common/service_worker/service_worker_types.h" |
10 #include "content/public/common/appcache_info.h" | 10 #include "content/public/common/appcache_info.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 if (url.SchemeIs(url::kJavaScriptScheme) || url.is_empty() || | 25 if (url.SchemeIs(url::kJavaScriptScheme) || url.is_empty() || |
26 url.SchemeIs(url::kContentIDScheme) || url == content::kAboutSrcDocURL) { | 26 url.SchemeIs(url::kContentIDScheme) || url == content::kAboutSrcDocURL) { |
27 return false; | 27 return false; |
28 } | 28 } |
29 | 29 |
30 for (const auto& scheme : url::GetEmptyDocumentSchemes()) { | 30 for (const auto& scheme : url::GetEmptyDocumentSchemes()) { |
31 if (url.SchemeIs(scheme)) | 31 if (url.SchemeIs(scheme)) |
32 return false; | 32 return false; |
33 } | 33 } |
34 | 34 |
| 35 // For you information, even though a "data:" url doesn't generate actual |
| 36 // network requests, it is handled by the network stack and so must return |
| 37 // true. The reason is that a few "data:" urls can't be handled locally. For |
| 38 // instance: |
| 39 // - the ones that result in downloads. |
| 40 // - the ones that are invalid. An error page must be served instead. |
| 41 // - the ones that have an unsupported MIME type. |
| 42 // - the ones that target the top-level frame on Android. |
| 43 |
35 return true; | 44 return true; |
36 } | 45 } |
37 | 46 |
38 SourceLocation::SourceLocation() : line_number(0), column_number(0) {} | 47 SourceLocation::SourceLocation() : line_number(0), column_number(0) {} |
39 | 48 |
40 SourceLocation::SourceLocation(const std::string& url, | 49 SourceLocation::SourceLocation(const std::string& url, |
41 unsigned int line_number, | 50 unsigned int line_number, |
42 unsigned int column_number) | 51 unsigned int column_number) |
43 : url(url), line_number(line_number), column_number(column_number) {} | 52 : url(url), line_number(line_number), column_number(column_number) {} |
44 | 53 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 const RequestNavigationParams& request_params) | 230 const RequestNavigationParams& request_params) |
222 : common_params(common_params), | 231 : common_params(common_params), |
223 start_params(start_params), | 232 start_params(start_params), |
224 request_params(request_params) { | 233 request_params(request_params) { |
225 } | 234 } |
226 | 235 |
227 NavigationParams::~NavigationParams() { | 236 NavigationParams::~NavigationParams() { |
228 } | 237 } |
229 | 238 |
230 } // namespace content | 239 } // namespace content |
OLD | NEW |