| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 request_id, | 414 request_id, |
| 415 status, | 415 status, |
| 416 std::string())); // No security info needed, connection was not | 416 std::string())); // No security info needed, connection was not |
| 417 // established. | 417 // established. |
| 418 } | 418 } |
| 419 return; | 419 return; |
| 420 } | 420 } |
| 421 std::string url = request_data.url.spec(); | 421 std::string url = request_data.url.spec(); |
| 422 | 422 |
| 423 // Note that context can still be NULL here when running unit tests. | 423 // Note that context can still be NULL here when running unit tests. |
| 424 Blacklist::Match* match = context && context->blacklist() ? | 424 Blacklist::Match* match = context && context->GetBlacklist() ? |
| 425 context->blacklist()->findMatch(request_data.url) : NULL; | 425 context->GetBlacklist()->findMatch(request_data.url) : NULL; |
| 426 if (match && match->IsBlocked(request_data.url)) { | 426 if (match && match->IsBlocked(request_data.url)) { |
| 427 // This is a special path where calling happens without the URLRequest | 427 // This is a special path where calling happens without the URLRequest |
| 428 // being created, so we must delete the match ourselves. Ensures this | 428 // being created, so we must delete the match ourselves. Ensures this |
| 429 // happens by using a scoped pointer. | 429 // happens by using a scoped pointer. |
| 430 scoped_ptr<Blacklist::Match> match_scope(match); | 430 scoped_ptr<Blacklist::Match> match_scope(match); |
| 431 | 431 |
| 432 URLRequestStatus status(URLRequestStatus::SUCCESS, 0); | 432 URLRequestStatus status(URLRequestStatus::SUCCESS, 0); |
| 433 std::string data = | 433 std::string data = |
| 434 request_data.resource_type != ResourceType::SUB_RESOURCE ? | 434 request_data.resource_type != ResourceType::SUB_RESOURCE ? |
| 435 blocked_.GetHTML(url, match) : blocked_.GetImage(match); | 435 blocked_.GetHTML(url, match) : blocked_.GetImage(match); |
| (...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 case ViewHostMsg_UploadProgress_ACK::ID: | 1812 case ViewHostMsg_UploadProgress_ACK::ID: |
| 1813 case ViewHostMsg_SyncLoad::ID: | 1813 case ViewHostMsg_SyncLoad::ID: |
| 1814 return true; | 1814 return true; |
| 1815 | 1815 |
| 1816 default: | 1816 default: |
| 1817 break; | 1817 break; |
| 1818 } | 1818 } |
| 1819 | 1819 |
| 1820 return false; | 1820 return false; |
| 1821 } | 1821 } |
| OLD | NEW |