| 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 // 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 #include "net/url_request/url_request_job.h" | 61 #include "net/url_request/url_request_job.h" |
| 62 #include "webkit/appcache/appcache_interfaces.h" | 62 #include "webkit/appcache/appcache_interfaces.h" |
| 63 #include "webkit/blob/blob_storage_controller.h" | 63 #include "webkit/blob/blob_storage_controller.h" |
| 64 #include "webkit/blob/blob_url_request_job.h" | 64 #include "webkit/blob/blob_url_request_job.h" |
| 65 #include "webkit/blob/shareable_file_reference.h" | 65 #include "webkit/blob/shareable_file_reference.h" |
| 66 #include "webkit/fileapi/file_system_context.h" | 66 #include "webkit/fileapi/file_system_context.h" |
| 67 #include "webkit/fileapi/file_system_dir_url_request_job.h" | 67 #include "webkit/fileapi/file_system_dir_url_request_job.h" |
| 68 #include "webkit/fileapi/file_system_url_request_job.h" | 68 #include "webkit/fileapi/file_system_url_request_job.h" |
| 69 #include "webkit/glue/resource_loader_bridge.h" | 69 #include "webkit/glue/resource_loader_bridge.h" |
| 70 #include "webkit/tools/test_shell/simple_appcache_system.h" | 70 #include "webkit/tools/test_shell/simple_appcache_system.h" |
| 71 #include "webkit/tools/test_shell/simple_file_system.h" |
| 71 #include "webkit/tools/test_shell/simple_file_writer.h" | 72 #include "webkit/tools/test_shell/simple_file_writer.h" |
| 72 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h" | 73 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h" |
| 73 #include "webkit/tools/test_shell/test_shell_request_context.h" | 74 #include "webkit/tools/test_shell/test_shell_request_context.h" |
| 74 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" | 75 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" |
| 75 | 76 |
| 76 #if defined(OS_MACOSX) || defined(OS_WIN) | 77 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 77 #include "crypto/nss_util.h" | 78 #include "crypto/nss_util.h" |
| 78 #endif | 79 #endif |
| 79 | 80 |
| 80 using webkit_glue::ResourceLoaderBridge; | 81 using webkit_glue::ResourceLoaderBridge; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 g_request_context_params = NULL; | 137 g_request_context_params = NULL; |
| 137 } else { | 138 } else { |
| 138 g_request_context = new TestShellRequestContext(); | 139 g_request_context = new TestShellRequestContext(); |
| 139 } | 140 } |
| 140 | 141 |
| 141 g_request_context->AddRef(); | 142 g_request_context->AddRef(); |
| 142 | 143 |
| 143 SimpleAppCacheSystem::InitializeOnIOThread(g_request_context); | 144 SimpleAppCacheSystem::InitializeOnIOThread(g_request_context); |
| 144 SimpleSocketStreamBridge::InitializeOnIOThread(g_request_context); | 145 SimpleSocketStreamBridge::InitializeOnIOThread(g_request_context); |
| 145 SimpleFileWriter::InitializeOnIOThread(g_request_context); | 146 SimpleFileWriter::InitializeOnIOThread(g_request_context); |
| 147 SimpleFileSystem::InitializeOnIOThread( |
| 148 g_request_context->blob_storage_controller()); |
| 146 TestShellWebBlobRegistryImpl::InitializeOnIOThread( | 149 TestShellWebBlobRegistryImpl::InitializeOnIOThread( |
| 147 g_request_context->blob_storage_controller()); | 150 g_request_context->blob_storage_controller()); |
| 148 } | 151 } |
| 149 | 152 |
| 150 virtual void CleanUp() { | 153 virtual void CleanUp() { |
| 151 // In reverse order of initialization. | 154 // In reverse order of initialization. |
| 152 TestShellWebBlobRegistryImpl::Cleanup(); | 155 TestShellWebBlobRegistryImpl::Cleanup(); |
| 156 SimpleFileSystem::CleanupOnIOThread(); |
| 153 SimpleFileWriter::CleanupOnIOThread(); | 157 SimpleFileWriter::CleanupOnIOThread(); |
| 154 SimpleSocketStreamBridge::Cleanup(); | 158 SimpleSocketStreamBridge::Cleanup(); |
| 155 SimpleAppCacheSystem::CleanupOnIOThread(); | 159 SimpleAppCacheSystem::CleanupOnIOThread(); |
| 156 | 160 |
| 157 if (g_request_context) { | 161 if (g_request_context) { |
| 158 g_request_context->Release(); | 162 g_request_context->Release(); |
| 159 g_request_context = NULL; | 163 g_request_context = NULL; |
| 160 } | 164 } |
| 161 } | 165 } |
| 162 }; | 166 }; |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); | 1040 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); |
| 1037 g_file_over_http_params = new FileOverHTTPParams(file_path_template, | 1041 g_file_over_http_params = new FileOverHTTPParams(file_path_template, |
| 1038 http_prefix); | 1042 http_prefix); |
| 1039 } | 1043 } |
| 1040 | 1044 |
| 1041 // static | 1045 // static |
| 1042 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1046 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
| 1043 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1047 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 1044 return new ResourceLoaderBridgeImpl(request_info); | 1048 return new ResourceLoaderBridgeImpl(request_info); |
| 1045 } | 1049 } |
| OLD | NEW |