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

Side by Side Diff: webkit/browser/blob/blob_url_request_job_factory.cc

Issue 29513003: Cleanup deprecated and no longer needed blob revamp stuff, deadcode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "webkit/browser/blob/blob_url_request_job_factory.h" 5 #include "webkit/browser/blob/blob_url_request_job_factory.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 scoped_refptr<webkit_blob::BlobData> 69 scoped_refptr<webkit_blob::BlobData>
70 BlobProtocolHandler::LookupBlobData(net::URLRequest* request) const { 70 BlobProtocolHandler::LookupBlobData(net::URLRequest* request) const {
71 BlobDataHandle* blob_data_handle = GetRequestedBlobDataHandle(request); 71 BlobDataHandle* blob_data_handle = GetRequestedBlobDataHandle(request);
72 if (blob_data_handle) 72 if (blob_data_handle)
73 return blob_data_handle->data(); 73 return blob_data_handle->data();
74 if (!context_.get()) 74 if (!context_.get())
75 return NULL; 75 return NULL;
76 76
77 // Retain support for looking up based on deprecated blob urls for now.
78 // The FeedbackExtensionAPI relies on this.
79 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(
80 context_->LookupUuidFromDeprecatedURL(request->url()));
81 if (handle)
82 return handle->data();
83
84 // Support looking up based on uuid, the FeedbackExtensionAPI relies on this. 77 // Support looking up based on uuid, the FeedbackExtensionAPI relies on this.
85 // TODO(michaeln): Replace this use case and others like it with a BlobReader 78 // TODO(michaeln): Replace this use case and others like it with a BlobReader
86 // impl that does not depend on urlfetching to perform this function. 79 // impl that does not depend on urlfetching to perform this function.
87 const std::string kPrefix("blob:uuid/"); 80 const std::string kPrefix("blob:uuid/");
88 if (!StartsWithASCII(request->url().spec(), kPrefix, true)) 81 if (!StartsWithASCII(request->url().spec(), kPrefix, true))
89 return NULL; 82 return NULL;
90 std::string uuid = request->url().spec().substr(kPrefix.length()); 83 std::string uuid = request->url().spec().substr(kPrefix.length());
91 handle = context_->GetBlobDataFromUUID(uuid); 84 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid);
92 return handle.get() ? handle->data() : NULL; 85 return handle.get() ? handle->data() : NULL;
93 } 86 }
94 87
95 } // namespace webkit_blob 88 } // namespace webkit_blob
OLDNEW
« no previous file with comments | « webkit/browser/blob/blob_storage_host.cc ('k') | webkit/browser/blob/view_blob_internals_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698