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

Side by Side Diff: ios/net/http_cache_helper.cc

Issue 1586833002: Convert Pass()→std::move() for iOS build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert accidental //base change Created 4 years, 11 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
« no previous file with comments | « ios/net/crn_http_protocol_handler.mm ('k') | ios/net/protocol_handler_util_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/net/http_cache_helper.h" 5 #include "ios/net/http_cache_helper.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
9 #include "base/callback.h" 11 #include "base/callback.h"
10 #include "base/location.h" 12 #include "base/location.h"
11 #include "base/task_runner.h" 13 #include "base/task_runner.h"
12 #include "net/base/sdch_manager.h" 14 #include "net/base/sdch_manager.h"
13 #include "net/disk_cache/disk_cache.h" 15 #include "net/disk_cache/disk_cache.h"
14 #include "net/http/http_cache.h" 16 #include "net/http/http_cache.h"
15 #include "net/http/http_network_session.h" 17 #include "net/http/http_network_session.h"
16 #include "net/http/http_transaction_factory.h" 18 #include "net/http/http_transaction_factory.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 getter->GetURLRequestContext()->sdch_manager(); 62 getter->GetURLRequestContext()->sdch_manager();
61 // The test is probably overkill, since chrome should always have an 63 // The test is probably overkill, since chrome should always have an
62 // SdchManager. But in general the URLRequestContext is *not* 64 // SdchManager. But in general the URLRequestContext is *not*
63 // guaranteed to have an SdchManager, so checking is wise. 65 // guaranteed to have an SdchManager, so checking is wise.
64 if (sdch_manager) 66 if (sdch_manager)
65 sdch_manager->ClearData(); 67 sdch_manager->ClearData();
66 68
67 scoped_ptr<disk_cache::Backend*> backend(new disk_cache::Backend*(nullptr)); 69 scoped_ptr<disk_cache::Backend*> backend(new disk_cache::Backend*(nullptr));
68 disk_cache::Backend** backend_ptr = backend.get(); 70 disk_cache::Backend** backend_ptr = backend.get();
69 net::CompletionCallback doom_callback = 71 net::CompletionCallback doom_callback =
70 base::Bind(&DoomHttpCache, base::Passed(backend.Pass()), 72 base::Bind(&DoomHttpCache, base::Passed(std::move(backend)),
71 client_task_runner, callback); 73 client_task_runner, callback);
72 74
73 int rv = http_cache->GetBackend(backend_ptr, doom_callback); 75 int rv = http_cache->GetBackend(backend_ptr, doom_callback);
74 76
75 if (rv != net::ERR_IO_PENDING) { 77 if (rv != net::ERR_IO_PENDING) {
76 // GetBackend doesn't call the callback if it completes synchronously, so 78 // GetBackend doesn't call the callback if it completes synchronously, so
77 // call it directly here. 79 // call it directly here.
78 doom_callback.Run(rv); 80 doom_callback.Run(rv);
79 } 81 }
80 } 82 }
81 83
82 } // namespace 84 } // namespace
83 85
84 namespace net { 86 namespace net {
85 87
86 void ClearHttpCache(const scoped_refptr<net::URLRequestContextGetter>& getter, 88 void ClearHttpCache(const scoped_refptr<net::URLRequestContextGetter>& getter,
87 const scoped_refptr<base::TaskRunner>& network_task_runner, 89 const scoped_refptr<base::TaskRunner>& network_task_runner,
88 const net::CompletionCallback& callback) { 90 const net::CompletionCallback& callback) {
89 network_task_runner->PostTask( 91 network_task_runner->PostTask(
90 FROM_HERE, base::Bind(&ClearHttpCacheOnIOThread, getter, 92 FROM_HERE, base::Bind(&ClearHttpCacheOnIOThread, getter,
91 base::ThreadTaskRunnerHandle::Get(), callback)); 93 base::ThreadTaskRunnerHandle::Get(), callback));
92 } 94 }
93 95
94 } // namespace net 96 } // namespace net
OLDNEW
« no previous file with comments | « ios/net/crn_http_protocol_handler.mm ('k') | ios/net/protocol_handler_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698