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

Side by Side Diff: content/browser/renderer_host/buffered_resource_handler.cc

Issue 9369009: Make content::ResourceContext be a real interface like the rest of the Content API (i.e. don't ha... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 10 months 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 "content/browser/renderer_host/buffered_resource_handler.h" 5 #include "content/browser/renderer_host/buffered_resource_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // of check is scattered throughout our codebase. 300 // of check is scattered throughout our codebase.
301 request_->SimulateError(net::ERR_FILE_NOT_FOUND); 301 request_->SimulateError(net::ERR_FILE_NOT_FOUND);
302 return false; 302 return false;
303 } 303 }
304 304
305 info->set_is_download(true); 305 info->set_is_download(true);
306 306
307 scoped_refptr<ResourceHandler> handler( 307 scoped_refptr<ResourceHandler> handler(
308 host_->CreateResourceHandlerForDownload( 308 host_->CreateResourceHandlerForDownload(
309 request_, 309 request_,
310 *info->context(), 310 info->context(),
311 info->child_id(), 311 info->child_id(),
312 info->route_id(), 312 info->route_id(),
313 info->request_id(), 313 info->request_id(),
314 DownloadSaveInfo(), 314 DownloadSaveInfo(),
315 DownloadResourceHandler::OnStartedCallback())); 315 DownloadResourceHandler::OnStartedCallback()));
316 316
317 if (!UseAlternateResourceHandler(request_id, handler)) 317 if (!UseAlternateResourceHandler(request_id, handler))
318 return false; 318 return false;
319 } 319 }
320 320
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 if (net::IsSupportedMimeType(type)) 364 if (net::IsSupportedMimeType(type))
365 return false; 365 return false;
366 366
367 // Finally, check the plugin list. 367 // Finally, check the plugin list.
368 bool allow_wildcard = false; 368 bool allow_wildcard = false;
369 ResourceDispatcherHostRequestInfo* info = 369 ResourceDispatcherHostRequestInfo* info =
370 ResourceDispatcherHost::InfoForRequest(request_); 370 ResourceDispatcherHost::InfoForRequest(request_);
371 bool stale = false; 371 bool stale = false;
372 webkit::WebPluginInfo plugin; 372 webkit::WebPluginInfo plugin;
373 bool found = PluginServiceImpl::GetInstance()->GetPluginInfo( 373 bool found = PluginServiceImpl::GetInstance()->GetPluginInfo(
374 info->child_id(), info->route_id(), *info->context(), 374 info->child_id(), info->route_id(), info->context(),
375 request_->url(), GURL(), type, allow_wildcard, 375 request_->url(), GURL(), type, allow_wildcard,
376 &stale, &plugin, NULL); 376 &stale, &plugin, NULL);
377 377
378 if (need_plugin_list) { 378 if (need_plugin_list) {
379 if (stale) { 379 if (stale) {
380 *need_plugin_list = true; 380 *need_plugin_list = true;
381 return true; 381 return true;
382 } 382 }
383 } else { 383 } else {
384 DCHECK(!stale); 384 DCHECK(!stale);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 return; 461 return;
462 462
463 ResourceDispatcherHostRequestInfo* info = 463 ResourceDispatcherHostRequestInfo* info =
464 ResourceDispatcherHost::InfoForRequest(request_); 464 ResourceDispatcherHost::InfoForRequest(request_);
465 host_->PauseRequest(info->child_id(), info->request_id(), false); 465 host_->PauseRequest(info->child_id(), info->request_id(), false);
466 if (!CompleteResponseStarted(info->request_id())) 466 if (!CompleteResponseStarted(info->request_id()))
467 host_->CancelRequest(info->child_id(), info->request_id(), false); 467 host_->CancelRequest(info->child_id(), info->request_id(), false);
468 } 468 }
469 469
470 } // namespace content 470 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698