| 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 "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Experimental: Launch ephemeral apps from search results. | 262 // Experimental: Launch ephemeral apps from search results. |
| 263 content::ResourceThrottle* ephemeral_app_throttle = | 263 content::ResourceThrottle* ephemeral_app_throttle = |
| 264 EphemeralAppThrottle::MaybeCreateThrottleForLaunch( | 264 EphemeralAppThrottle::MaybeCreateThrottleForLaunch( |
| 265 request, io_data); | 265 request, io_data); |
| 266 if (ephemeral_app_throttle) | 266 if (ephemeral_app_throttle) |
| 267 throttles->push_back(ephemeral_app_throttle); | 267 throttles->push_back(ephemeral_app_throttle); |
| 268 #endif | 268 #endif |
| 269 } | 269 } |
| 270 | 270 |
| 271 #if defined(OS_CHROMEOS) | 271 #if defined(OS_CHROMEOS) |
| 272 if (resource_type == ResourceType::MAIN_FRAME) { | 272 if (resource_type == ResourceType::MAIN_FRAME || |
| 273 resource_type == ResourceType::XHR) { |
| 273 // We check offline first, then check safe browsing so that we still can | 274 // We check offline first, then check safe browsing so that we still can |
| 274 // block unsafe site after we remove offline page. | 275 // block unsafe site after we remove offline page. |
| 275 throttles->push_back(new OfflineResourceThrottle(request, | 276 throttles->push_back(new OfflineResourceThrottle(request, |
| 276 appcache_service)); | 277 appcache_service)); |
| 277 // Add interstitial page while merge session process (cookie | 278 // Add interstitial page while merge session process (cookie |
| 278 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in | 279 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in |
| 279 // progress while we are attempting to load a google property. | 280 // progress while we are attempting to load a google property. |
| 280 if (!MergeSessionThrottle::AreAllSessionMergedAlready() && | 281 if (!MergeSessionThrottle::AreAllSessionMergedAlready() && |
| 281 request->url().SchemeIsHTTPOrHTTPS()) { | 282 request->url().SchemeIsHTTPOrHTTPS()) { |
| 282 throttles->push_back(new MergeSessionThrottle(request)); | 283 throttles->push_back(new MergeSessionThrottle(request, resource_type)); |
| 283 } | 284 } |
| 284 } | 285 } |
| 285 #endif | 286 #endif |
| 286 | 287 |
| 287 // Don't attempt to append headers to requests that have already started. | 288 // Don't attempt to append headers to requests that have already started. |
| 288 // TODO(stevet): Remove this once the request ordering issues are resolved | 289 // TODO(stevet): Remove this once the request ordering issues are resolved |
| 289 // in crbug.com/128048. | 290 // in crbug.com/128048. |
| 290 if (!request->is_pending()) { | 291 if (!request->is_pending()) { |
| 291 net::HttpRequestHeaders headers; | 292 net::HttpRequestHeaders headers; |
| 292 headers.CopyFrom(request->extra_request_headers()); | 293 headers.CopyFrom(request->extra_request_headers()); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 // exception is requests from gaia webview, since the native profile | 659 // exception is requests from gaia webview, since the native profile |
| 659 // management UI is built on top of it. | 660 // management UI is built on top of it. |
| 660 signin::AppendMirrorRequestHeaderIfPossible(request, redirect_url, io_data, | 661 signin::AppendMirrorRequestHeaderIfPossible(request, redirect_url, io_data, |
| 661 info->GetChildID(), info->GetRouteID()); | 662 info->GetChildID(), info->GetRouteID()); |
| 662 | 663 |
| 663 if (io_data->resource_prefetch_predictor_observer()) { | 664 if (io_data->resource_prefetch_predictor_observer()) { |
| 664 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( | 665 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( |
| 665 redirect_url, request); | 666 redirect_url, request); |
| 666 } | 667 } |
| 667 } | 668 } |
| OLD | NEW |