| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains an implementation of the ResourceLoaderBridge class. | 5 // This file contains an implementation of the ResourceLoaderBridge class. |
| 6 // The class is implemented using net::URLRequest, meaning it is a "simple" | 6 // The class is implemented using net::URLRequest, meaning it is a "simple" |
| 7 // version that directly issues requests. The more complicated one used in the | 7 // version that directly issues requests. The more complicated one used in the |
| 8 // browser uses IPC. | 8 // browser uses IPC. |
| 9 // | 9 // |
| 10 // Because net::URLRequest only provides an asynchronous resource loading API, | 10 // Because net::URLRequest only provides an asynchronous resource loading API, |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 OnReceivedResponse(info); | 452 OnReceivedResponse(info); |
| 453 AsyncReadData(); // start reading | 453 AsyncReadData(); // start reading |
| 454 } | 454 } |
| 455 } else { | 455 } else { |
| 456 Done(); | 456 Done(); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 virtual void OnSSLCertificateError(net::URLRequest* request, | 460 virtual void OnSSLCertificateError(net::URLRequest* request, |
| 461 int cert_error, | 461 int cert_error, |
| 462 net::X509Certificate* cert) OVERRIDE { | 462 const SSLInfo& ssl_info, |
| 463 bool must_be_fatal) OVERRIDE { |
| 463 // Allow all certificate errors. | 464 // Allow all certificate errors. |
| 464 request->ContinueDespiteLastError(); | 465 request->ContinueDespiteLastError(); |
| 465 } | 466 } |
| 466 | 467 |
| 467 virtual bool CanGetCookies( | 468 virtual bool CanGetCookies( |
| 468 const net::URLRequest* request, | 469 const net::URLRequest* request, |
| 469 const net::CookieList& cookie_list) const OVERRIDE { | 470 const net::CookieList& cookie_list) const OVERRIDE { |
| 470 StaticCookiePolicy::Type policy_type = g_accept_all_cookies ? | 471 StaticCookiePolicy::Type policy_type = g_accept_all_cookies ? |
| 471 StaticCookiePolicy::ALLOW_ALL_COOKIES : | 472 StaticCookiePolicy::ALLOW_ALL_COOKIES : |
| 472 StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; | 473 StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 | 1033 |
| 1033 // static | 1034 // static |
| 1034 void SimpleResourceLoaderBridge::AllowFileOverHTTP( | 1035 void SimpleResourceLoaderBridge::AllowFileOverHTTP( |
| 1035 const std::string& file_path_template, const GURL& http_prefix) { | 1036 const std::string& file_path_template, const GURL& http_prefix) { |
| 1036 DCHECK(!file_path_template.empty()); | 1037 DCHECK(!file_path_template.empty()); |
| 1037 DCHECK(http_prefix.is_valid() && | 1038 DCHECK(http_prefix.is_valid() && |
| 1038 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); | 1039 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); |
| 1039 g_file_over_http_params = new FileOverHTTPParams(file_path_template, | 1040 g_file_over_http_params = new FileOverHTTPParams(file_path_template, |
| 1040 http_prefix); | 1041 http_prefix); |
| 1041 } | 1042 } |
| OLD | NEW |