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

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

Issue 539143002: Migrate webkit/browser/ to storage/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
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 "storage/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"
11 #include "net/base/request_priority.h" 11 #include "net/base/request_priority.h"
12 #include "net/url_request/url_request_context.h" 12 #include "net/url_request/url_request_context.h"
13 #include "net/url_request/url_request_job_factory.h" 13 #include "net/url_request/url_request_job_factory.h"
14 #include "webkit/browser/blob/blob_data_handle.h" 14 #include "storage/browser/blob/blob_data_handle.h"
15 #include "webkit/browser/blob/blob_storage_context.h" 15 #include "storage/browser/blob/blob_storage_context.h"
16 #include "webkit/browser/blob/blob_url_request_job.h" 16 #include "storage/browser/blob/blob_url_request_job.h"
17 #include "webkit/browser/fileapi/file_system_context.h" 17 #include "storage/browser/fileapi/file_system_context.h"
18 18
19 namespace storage { 19 namespace storage {
20 20
21 namespace { 21 namespace {
22 22
23 int kUserDataKey; // The value is not important, the addr is a key. 23 int kUserDataKey; // The value is not important, the addr is a key.
24 24
25 BlobDataHandle* GetRequestedBlobDataHandle(net::URLRequest* request) { 25 BlobDataHandle* GetRequestedBlobDataHandle(net::URLRequest* request) {
26 return static_cast<BlobDataHandle*>(request->GetUserData(&kUserDataKey)); 26 return static_cast<BlobDataHandle*>(request->GetUserData(&kUserDataKey));
27 } 27 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // impl that does not depend on urlfetching to perform this function. 81 // impl that does not depend on urlfetching to perform this function.
82 const std::string kPrefix("blob:uuid/"); 82 const std::string kPrefix("blob:uuid/");
83 if (!StartsWithASCII(request->url().spec(), kPrefix, true)) 83 if (!StartsWithASCII(request->url().spec(), kPrefix, true))
84 return NULL; 84 return NULL;
85 std::string uuid = request->url().spec().substr(kPrefix.length()); 85 std::string uuid = request->url().spec().substr(kPrefix.length());
86 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid); 86 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid);
87 return handle.get() ? handle->data() : NULL; 87 return handle.get() ? handle->data() : NULL;
88 } 88 }
89 89
90 } // namespace storage 90 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698