| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 static net::URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request, | 97 static net::URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request, |
| 98 const std::string& scheme) { | 98 const std::string& scheme) { |
| 99 webkit_blob::BlobStorageController* blob_storage_controller = | 99 webkit_blob::BlobStorageController* blob_storage_controller = |
| 100 static_cast<TestShellRequestContext*>(request->context())-> | 100 static_cast<TestShellRequestContext*>(request->context())-> |
| 101 blob_storage_controller(); | 101 blob_storage_controller(); |
| 102 return new webkit_blob::BlobURLRequestJob( | 102 return new webkit_blob::BlobURLRequestJob( |
| 103 request, | 103 request, |
| 104 blob_storage_controller->GetBlobDataFromUrl(request->url()), | 104 blob_storage_controller->GetBlobDataFromUrl(request->url()), |
| 105 NULL); | 105 SimpleResourceLoaderBridge::GetIoThread()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 TestShellRequestContextParams* g_request_context_params = NULL; | 108 TestShellRequestContextParams* g_request_context_params = NULL; |
| 109 TestShellRequestContext* g_request_context = NULL; | 109 TestShellRequestContext* g_request_context = NULL; |
| 110 base::Thread* g_cache_thread = NULL; | 110 base::Thread* g_cache_thread = NULL; |
| 111 | 111 |
| 112 //----------------------------------------------------------------------------- | 112 //----------------------------------------------------------------------------- |
| 113 | 113 |
| 114 class IOThread : public base::Thread { | 114 class IOThread : public base::Thread { |
| 115 public: | 115 public: |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 | 915 |
| 916 // static | 916 // static |
| 917 scoped_refptr<base::MessageLoopProxy> | 917 scoped_refptr<base::MessageLoopProxy> |
| 918 SimpleResourceLoaderBridge::GetIoThread() { | 918 SimpleResourceLoaderBridge::GetIoThread() { |
| 919 if (!EnsureIOThread()) { | 919 if (!EnsureIOThread()) { |
| 920 LOG(DFATAL) << "Failed to create IO thread."; | 920 LOG(DFATAL) << "Failed to create IO thread."; |
| 921 return NULL; | 921 return NULL; |
| 922 } | 922 } |
| 923 return g_io_thread->message_loop_proxy(); | 923 return g_io_thread->message_loop_proxy(); |
| 924 } | 924 } |
| OLD | NEW |