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 // 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 "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "content/browser/loader/resource_request_info_impl.h" | 39 #include "content/browser/loader/resource_request_info_impl.h" |
40 #include "content/browser/loader/stream_resource_handler.h" | 40 #include "content/browser/loader/stream_resource_handler.h" |
41 #include "content/browser/loader/sync_resource_handler.h" | 41 #include "content/browser/loader/sync_resource_handler.h" |
42 #include "content/browser/loader/throttling_resource_handler.h" | 42 #include "content/browser/loader/throttling_resource_handler.h" |
43 #include "content/browser/loader/transfer_navigation_resource_throttle.h" | 43 #include "content/browser/loader/transfer_navigation_resource_throttle.h" |
44 #include "content/browser/plugin_service_impl.h" | 44 #include "content/browser/plugin_service_impl.h" |
45 #include "content/browser/renderer_host/render_view_host_delegate.h" | 45 #include "content/browser/renderer_host/render_view_host_delegate.h" |
46 #include "content/browser/renderer_host/render_view_host_impl.h" | 46 #include "content/browser/renderer_host/render_view_host_impl.h" |
47 #include "content/browser/resource_context_impl.h" | 47 #include "content/browser/resource_context_impl.h" |
48 #include "content/browser/streams/stream.h" | 48 #include "content/browser/streams/stream.h" |
49 #include "content/browser/streams/stream_context.h" | |
50 #include "content/browser/streams/stream_registry.h" | 49 #include "content/browser/streams/stream_registry.h" |
51 #include "content/browser/worker_host/worker_service_impl.h" | 50 #include "content/browser/worker_host/worker_service_impl.h" |
52 #include "content/common/resource_messages.h" | 51 #include "content/common/resource_messages.h" |
53 #include "content/common/ssl_status_serialization.h" | 52 #include "content/common/ssl_status_serialization.h" |
54 #include "content/common/view_messages.h" | 53 #include "content/common/view_messages.h" |
55 #include "content/public/browser/browser_thread.h" | 54 #include "content/public/browser/browser_thread.h" |
56 #include "content/public/browser/content_browser_client.h" | 55 #include "content/public/browser/content_browser_client.h" |
57 #include "content/public/browser/download_manager.h" | 56 #include "content/public/browser/download_manager.h" |
58 #include "content/public/browser/global_request_id.h" | 57 #include "content/public/browser/global_request_id.h" |
59 #include "content/public/browser/notification_service.h" | 58 #include "content/public/browser/notification_service.h" |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 std::string target_id; | 580 std::string target_id; |
582 if (!delegate_ || | 581 if (!delegate_ || |
583 !delegate_->ShouldInterceptResourceAsStream(info->GetContext(), | 582 !delegate_->ShouldInterceptResourceAsStream(info->GetContext(), |
584 request->url(), | 583 request->url(), |
585 mime_type, | 584 mime_type, |
586 &security_origin, | 585 &security_origin, |
587 &target_id)) { | 586 &target_id)) { |
588 return scoped_ptr<ResourceHandler>(); | 587 return scoped_ptr<ResourceHandler>(); |
589 } | 588 } |
590 | 589 |
591 StreamContext* stream_context = | 590 ChromeBlobStorageContext* blob_storage_context = |
592 GetStreamContextForResourceContext(info->GetContext()); | 591 GetChromeBlobStorageContextForResourceContext(info->GetContext()); |
593 | |
594 | 592 |
595 scoped_ptr<StreamResourceHandler> handler( | 593 scoped_ptr<StreamResourceHandler> handler( |
596 new StreamResourceHandler(request, | 594 new StreamResourceHandler(request, |
597 stream_context->registry(), | 595 blob_storage_context->stream_registry(), |
598 security_origin)); | 596 security_origin)); |
599 | 597 |
600 info->set_is_stream(true); | 598 info->set_is_stream(true); |
601 delegate_->OnStreamCreated( | 599 delegate_->OnStreamCreated( |
602 info->GetContext(), | 600 info->GetContext(), |
603 info->GetChildID(), | 601 info->GetChildID(), |
604 info->GetRouteID(), | 602 info->GetRouteID(), |
605 target_id, | 603 target_id, |
606 handler->stream()->CreateHandle(request->url(), mime_type), | 604 handler->stream()->CreateHandle(request->url(), mime_type), |
607 request->GetExpectedContentSize()); | 605 request->GetExpectedContentSize()); |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1842 DelegateMap::iterator it = delegate_map_.find(id); | 1840 DelegateMap::iterator it = delegate_map_.find(id); |
1843 DCHECK(it->second->HasObserver(delegate)); | 1841 DCHECK(it->second->HasObserver(delegate)); |
1844 it->second->RemoveObserver(delegate); | 1842 it->second->RemoveObserver(delegate); |
1845 if (it->second->size() == 0) { | 1843 if (it->second->size() == 0) { |
1846 delete it->second; | 1844 delete it->second; |
1847 delegate_map_.erase(it); | 1845 delegate_map_.erase(it); |
1848 } | 1846 } |
1849 } | 1847 } |
1850 | 1848 |
1851 } // namespace content | 1849 } // namespace content |
OLD | NEW |