Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 118733002: Added merge session request throttle for XHR requests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // Redirect some navigations to apps that have registered matching URL 254 // Redirect some navigations to apps that have registered matching URL
255 // handlers ('url_handlers' in the manifest). 255 // handlers ('url_handlers' in the manifest).
256 content::ResourceThrottle* url_to_app_throttle = 256 content::ResourceThrottle* url_to_app_throttle =
257 AppUrlRedirector::MaybeCreateThrottleFor(request, io_data); 257 AppUrlRedirector::MaybeCreateThrottleFor(request, io_data);
258 if (url_to_app_throttle) 258 if (url_to_app_throttle)
259 throttles->push_back(url_to_app_throttle); 259 throttles->push_back(url_to_app_throttle);
260 #endif 260 #endif
261 } 261 }
262 262
263 #if defined(OS_CHROMEOS) 263 #if defined(OS_CHROMEOS)
264 if (resource_type == ResourceType::MAIN_FRAME) { 264 if (resource_type == ResourceType::MAIN_FRAME ||
265 resource_type == ResourceType::XHR) {
265 // We check offline first, then check safe browsing so that we still can 266 // We check offline first, then check safe browsing so that we still can
266 // block unsafe site after we remove offline page. 267 // block unsafe site after we remove offline page.
267 throttles->push_back(new OfflineResourceThrottle(request, 268 throttles->push_back(new OfflineResourceThrottle(request,
268 appcache_service)); 269 appcache_service));
269 // Add interstitial page while merge session process (cookie 270 // Add interstitial page while merge session process (cookie
270 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in 271 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in
271 // progress while we are attempting to load a google property. 272 // progress while we are attempting to load a google property.
272 if (!MergeSessionThrottle::AreAllSessionMergedAlready() && 273 if (!MergeSessionThrottle::AreAllSessionMergedAlready() &&
273 request->url().SchemeIsHTTPOrHTTPS()) { 274 request->url().SchemeIsHTTPOrHTTPS()) {
274 throttles->push_back(new MergeSessionThrottle(request)); 275 throttles->push_back(new MergeSessionThrottle(request, resource_type));
275 } 276 }
276 } 277 }
277 #endif 278 #endif
278 279
279 // Don't attempt to append headers to requests that have already started. 280 // Don't attempt to append headers to requests that have already started.
280 // TODO(stevet): Remove this once the request ordering issues are resolved 281 // TODO(stevet): Remove this once the request ordering issues are resolved
281 // in crbug.com/128048. 282 // in crbug.com/128048.
282 if (!request->is_pending()) { 283 if (!request->is_pending()) {
283 net::HttpRequestHeaders headers; 284 net::HttpRequestHeaders headers;
284 headers.CopyFrom(request->extra_request_headers()); 285 headers.CopyFrom(request->extra_request_headers());
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 // exception is requests from gaia webview, since the native profile 651 // exception is requests from gaia webview, since the native profile
651 // management UI is built on top of it. 652 // management UI is built on top of it.
652 signin::AppendMirrorRequestHeaderIfPossible(request, redirect_url, io_data, 653 signin::AppendMirrorRequestHeaderIfPossible(request, redirect_url, io_data,
653 info->GetChildID(), info->GetRouteID()); 654 info->GetChildID(), info->GetRouteID());
654 655
655 if (io_data->resource_prefetch_predictor_observer()) { 656 if (io_data->resource_prefetch_predictor_observer()) {
656 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( 657 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected(
657 redirect_url, request); 658 redirect_url, request);
658 } 659 }
659 } 660 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698