OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains an implementation of the ResourceLoaderBridge class. | 5 // This file contains an implementation of the ResourceLoaderBridge class. |
6 // The class is implemented using net::URLRequest, meaning it is a "simple" | 6 // The class is implemented using net::URLRequest, meaning it is a "simple" |
7 // version that directly issues requests. The more complicated one used in the | 7 // version that directly issues requests. The more complicated one used in the |
8 // browser uses IPC. | 8 // browser uses IPC. |
9 // | 9 // |
10 // Because net::URLRequest only provides an asynchronous resource loading API, | 10 // Because net::URLRequest only provides an asynchronous resource loading API, |
(...skipping 711 matching lines...) Loading... |
722 response->url = params_->url; | 722 response->url = params_->url; |
723 | 723 |
724 proxy_ = new SyncRequestProxy(response); | 724 proxy_ = new SyncRequestProxy(response); |
725 proxy_->AddRef(); | 725 proxy_->AddRef(); |
726 | 726 |
727 proxy_->Start(NULL, params_.release()); | 727 proxy_->Start(NULL, params_.release()); |
728 | 728 |
729 static_cast<SyncRequestProxy*>(proxy_)->WaitForCompletion(); | 729 static_cast<SyncRequestProxy*>(proxy_)->WaitForCompletion(); |
730 } | 730 } |
731 | 731 |
| 732 virtual void UpdateRoutingId(int new_routing_id) { } |
| 733 |
732 private: | 734 private: |
733 // Ownership of params_ is transfered to the proxy when the proxy is created. | 735 // Ownership of params_ is transfered to the proxy when the proxy is created. |
734 scoped_ptr<RequestParams> params_; | 736 scoped_ptr<RequestParams> params_; |
735 | 737 |
736 // The request proxy is allocated when we start the request, and then it | 738 // The request proxy is allocated when we start the request, and then it |
737 // sticks around until this ResourceLoaderBridge is destroyed. | 739 // sticks around until this ResourceLoaderBridge is destroyed. |
738 RequestProxy* proxy_; | 740 RequestProxy* proxy_; |
739 }; | 741 }; |
740 | 742 |
741 //----------------------------------------------------------------------------- | 743 //----------------------------------------------------------------------------- |
(...skipping 175 matching lines...) Loading... |
917 | 919 |
918 // static | 920 // static |
919 scoped_refptr<base::MessageLoopProxy> | 921 scoped_refptr<base::MessageLoopProxy> |
920 SimpleResourceLoaderBridge::GetIoThread() { | 922 SimpleResourceLoaderBridge::GetIoThread() { |
921 if (!EnsureIOThread()) { | 923 if (!EnsureIOThread()) { |
922 LOG(DFATAL) << "Failed to create IO thread."; | 924 LOG(DFATAL) << "Failed to create IO thread."; |
923 return NULL; | 925 return NULL; |
924 } | 926 } |
925 return g_io_thread->message_loop_proxy(); | 927 return g_io_thread->message_loop_proxy(); |
926 } | 928 } |
OLD | NEW |