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

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

Issue 55049: Add the ability to specify a default MIME type when loading a resource. We'l... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 9 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 // Make extra info and read footer (contains request ID). 389 // Make extra info and read footer (contains request ID).
390 ExtraRequestInfo* extra_info = 390 ExtraRequestInfo* extra_info =
391 new ExtraRequestInfo(handler, 391 new ExtraRequestInfo(handler,
392 process_type, 392 process_type,
393 process_id, 393 process_id,
394 route_id, 394 route_id,
395 request_id, 395 request_id,
396 request_data.frame_origin, 396 request_data.frame_origin,
397 request_data.main_frame_origin, 397 request_data.main_frame_origin,
398 request_data.default_mime_type,
wtc 2009/03/28 00:45:35 Just curious: how do we decide if a piece of data
abarth-chromium 2009/03/28 07:10:45 In this case the decision is easy because URLReque
wtc 2009/03/30 18:29:46 Thanks for the answer. I also figured this out on
398 request_data.resource_type, 399 request_data.resource_type,
399 upload_size); 400 upload_size);
400 extra_info->allow_download = 401 extra_info->allow_download =
401 ResourceType::IsFrame(request_data.resource_type); 402 ResourceType::IsFrame(request_data.resource_type);
402 request->set_user_data(extra_info); // takes pointer ownership 403 request->set_user_data(extra_info); // takes pointer ownership
403 404
404 BeginRequestInternal(request); 405 BeginRequestInternal(request);
405 } 406 }
406 407
407 void ResourceDispatcherHost::OnDataReceivedACK(int request_id) { 408 void ResourceDispatcherHost::OnDataReceivedACK(int request_id) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 request->set_context(request_context); 525 request->set_context(request_context);
525 526
526 ExtraRequestInfo* extra_info = 527 ExtraRequestInfo* extra_info =
527 new ExtraRequestInfo(handler, 528 new ExtraRequestInfo(handler,
528 ChildProcessInfo::RENDER_PROCESS, 529 ChildProcessInfo::RENDER_PROCESS,
529 process_id, 530 process_id,
530 route_id, 531 route_id,
531 request_id_, 532 request_id_,
532 "null", // frame_origin 533 "null", // frame_origin
533 "null", // main_frame_origin 534 "null", // main_frame_origin
535 "", // default_mime_type
534 ResourceType::SUB_RESOURCE, 536 ResourceType::SUB_RESOURCE,
535 0 /* upload_size */); 537 0 /* upload_size */);
536 extra_info->allow_download = true; 538 extra_info->allow_download = true;
537 extra_info->is_download = true; 539 extra_info->is_download = true;
538 request->set_user_data(extra_info); // Takes pointer ownership. 540 request->set_user_data(extra_info); // Takes pointer ownership.
539 541
540 BeginRequestInternal(request); 542 BeginRequestInternal(request);
541 } 543 }
542 544
543 // This function is only used for saving feature. 545 // This function is only used for saving feature.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 request->set_context(request_context); 580 request->set_context(request_context);
579 581
580 ExtraRequestInfo* extra_info = 582 ExtraRequestInfo* extra_info =
581 new ExtraRequestInfo(handler, 583 new ExtraRequestInfo(handler,
582 ChildProcessInfo::RENDER_PROCESS, 584 ChildProcessInfo::RENDER_PROCESS,
583 process_id, 585 process_id,
584 route_id, 586 route_id,
585 request_id_, 587 request_id_,
586 "null", // frame_origin 588 "null", // frame_origin
587 "null", // main_frame_origin 589 "null", // main_frame_origin
590 "", // default_mime_type
588 ResourceType::SUB_RESOURCE, 591 ResourceType::SUB_RESOURCE,
589 0 /* upload_size */); 592 0 /* upload_size */);
590 // Just saving some resources we need, disallow downloading. 593 // Just saving some resources we need, disallow downloading.
591 extra_info->allow_download = false; 594 extra_info->allow_download = false;
592 extra_info->is_download = false; 595 extra_info->is_download = false;
593 request->set_user_data(extra_info); // Takes pointer ownership. 596 request->set_user_data(extra_info); // Takes pointer ownership.
594 597
595 BeginRequestInternal(request); 598 BeginRequestInternal(request);
596 } 599 }
597 600
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 case ViewHostMsg_UploadProgress_ACK::ID: 1551 case ViewHostMsg_UploadProgress_ACK::ID:
1549 case ViewHostMsg_SyncLoad::ID: 1552 case ViewHostMsg_SyncLoad::ID:
1550 return true; 1553 return true;
1551 1554
1552 default: 1555 default:
1553 break; 1556 break;
1554 } 1557 }
1555 1558
1556 return false; 1559 return false;
1557 } 1560 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698