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

Unified Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 3397002: Move blob URL scheme registration from test_shell.cc to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/support/webkit_support.gypi ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_resource_loader_bridge.cc
===================================================================
--- webkit/tools/test_shell/simple_resource_loader_bridge.cc (revision 59384)
+++ webkit/tools/test_shell/simple_resource_loader_bridge.cc (working copy)
@@ -58,8 +58,10 @@
#include "net/socket/ssl_client_socket_nss_factory.h"
#endif
#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_job.h"
#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/blob/blob_storage_controller.h"
+#include "webkit/blob/blob_url_request_job.h"
#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/tools/test_shell/simple_appcache_system.h"
#include "webkit/tools/test_shell/simple_socket_stream_bridge.h"
@@ -88,6 +90,17 @@
bool accept_all_cookies;
};
+static URLRequestJob* BlobURLRequestJobFactory(URLRequest* request,
+ const std::string& scheme) {
+ webkit_blob::BlobStorageController* blob_storage_controller =
+ static_cast<TestShellRequestContext*>(request->context())->
+ blob_storage_controller();
+ return new webkit_blob::BlobURLRequestJob(
+ request,
+ blob_storage_controller->GetBlobDataFromUrl(request->url()),
+ NULL);
+}
+
TestShellRequestContextParams* g_request_context_params = NULL;
URLRequestContext* g_request_context = NULL;
base::Thread* g_cache_thread = NULL;
@@ -123,9 +136,11 @@
SimpleAppCacheSystem::InitializeOnIOThread(g_request_context);
SimpleSocketStreamBridge::InitializeOnIOThread(g_request_context);
+
TestShellWebBlobRegistryImpl::InitializeOnIOThread(
static_cast<TestShellRequestContext*>(g_request_context)->
blob_storage_controller());
+ URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory);
}
virtual void CleanUp() {
« no previous file with comments | « webkit/support/webkit_support.gypi ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698