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

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

Issue 1120553002: [storage] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "storage/browser/blob/blob_storage_context.h" 5 #include "storage/browser/blob/blob_storage_context.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop/message_loop_proxy.h"
15 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
16 #include "base/stl_util.h" 15 #include "base/stl_util.h"
16 #include "base/thread_task_runner_handle.h"
17 #include "base/trace_event/trace_event.h" 17 #include "base/trace_event/trace_event.h"
18 #include "storage/browser/blob/blob_data_builder.h" 18 #include "storage/browser/blob/blob_data_builder.h"
19 #include "storage/browser/blob/blob_data_handle.h" 19 #include "storage/browser/blob/blob_data_handle.h"
20 #include "url/gurl.h" 20 #include "url/gurl.h"
21 21
22 namespace storage { 22 namespace storage {
23 23
24 namespace { 24 namespace {
25 25
26 // We can't use GURL directly for these hash fragment manipulations 26 // We can't use GURL directly for these hash fragment manipulations
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const std::string& uuid) { 71 const std::string& uuid) {
72 scoped_ptr<BlobDataHandle> result; 72 scoped_ptr<BlobDataHandle> result;
73 BlobMap::iterator found = blob_map_.find(uuid); 73 BlobMap::iterator found = blob_map_.find(uuid);
74 if (found == blob_map_.end()) 74 if (found == blob_map_.end())
75 return result.Pass(); 75 return result.Pass();
76 auto* entry = found->second; 76 auto* entry = found->second;
77 if (entry->flags & EXCEEDED_MEMORY) 77 if (entry->flags & EXCEEDED_MEMORY)
78 return result.Pass(); 78 return result.Pass();
79 DCHECK(!entry->IsBeingBuilt()); 79 DCHECK(!entry->IsBeingBuilt());
80 result.reset( 80 result.reset(
81 new BlobDataHandle(uuid, this, base::MessageLoopProxy::current().get())); 81 new BlobDataHandle(uuid,
82 this,
83 base::ThreadTaskRunnerHandle::Get().get()
84 ));
kinuko 2015/04/30 07:52:06 Can this be appended at the end of the previous li
Pranay 2015/05/04 03:20:58 Done.
82 return result.Pass(); 85 return result.Pass();
83 } 86 }
84 87
85 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromPublicURL( 88 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromPublicURL(
86 const GURL& url) { 89 const GURL& url) {
87 BlobURLMap::iterator found = 90 BlobURLMap::iterator found =
88 public_blob_urls_.find(BlobUrlHasRef(url) ? ClearBlobUrlRef(url) : url); 91 public_blob_urls_.find(BlobUrlHasRef(url) ? ClearBlobUrlRef(url) : url);
89 if (found == public_blob_urls_.end()) 92 if (found == public_blob_urls_.end())
90 return scoped_ptr<BlobDataHandle>(); 93 return scoped_ptr<BlobDataHandle>();
91 return GetBlobDataFromUUID(found->second); 94 return GetBlobDataFromUUID(found->second);
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 if (found == blob_map_.end()) 473 if (found == blob_map_.end())
471 return false; 474 return false;
472 return found->second->IsBeingBuilt(); 475 return found->second->IsBeingBuilt();
473 } 476 }
474 477
475 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { 478 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) {
476 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); 479 return public_blob_urls_.find(blob_url) != public_blob_urls_.end();
477 } 480 }
478 481
479 } // namespace storage 482 } // namespace storage
OLDNEW
« no previous file with comments | « no previous file | storage/browser/blob/blob_url_request_job.h » ('j') | storage/browser/blob/blob_url_request_job.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698