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

Side by Side Diff: content/browser/loader/temporary_file_stream_unittest.cc

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/loader/temporary_file_stream.h" 5 #include "content/browser/loader/temporary_file_stream.h"
6 6
7 #include <string.h> 7 #include <string.h>
8
9 #include <string> 8 #include <string>
9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "content/public/test/test_browser_thread_bundle.h" 16 #include "content/public/test/test_browser_thread_bundle.h"
17 #include "net/base/file_stream.h" 17 #include "net/base/file_stream.h"
18 #include "net/base/io_buffer.h" 18 #include "net/base/io_buffer.h"
19 #include "net/base/net_errors.h" 19 #include "net/base/net_errors.h"
(...skipping 15 matching lines...) Expand all
35 base::File::Error error() const { return error_; } 35 base::File::Error error() const { return error_; }
36 net::FileStream* file_stream() const { return file_stream_.get(); } 36 net::FileStream* file_stream() const { return file_stream_.get(); }
37 ShareableFileReference* deletable_file() const { 37 ShareableFileReference* deletable_file() const {
38 return deletable_file_.get(); 38 return deletable_file_.get();
39 } 39 }
40 40
41 void OnFileStreamCreated(base::File::Error error, 41 void OnFileStreamCreated(base::File::Error error,
42 scoped_ptr<net::FileStream> file_stream, 42 scoped_ptr<net::FileStream> file_stream,
43 ShareableFileReference* deletable_file) { 43 ShareableFileReference* deletable_file) {
44 error_ = error; 44 error_ = error;
45 file_stream_ = file_stream.Pass(); 45 file_stream_ = std::move(file_stream);
46 deletable_file_ = deletable_file; 46 deletable_file_ = deletable_file;
47 loop_.Quit(); 47 loop_.Quit();
48 } 48 }
49 49
50 void Wait() { 50 void Wait() {
51 loop_.Run(); 51 loop_.Run();
52 } 52 }
53 53
54 void Release() { 54 void Release() {
55 file_stream_.reset(NULL); 55 file_stream_.reset(NULL);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 // Release everything. The file should be gone now. 112 // Release everything. The file should be gone now.
113 file_stream_waiter.Release(); 113 file_stream_waiter.Release();
114 base::MessageLoop::current()->RunUntilIdle(); 114 base::MessageLoop::current()->RunUntilIdle();
115 115
116 // The temporary should be gone now. 116 // The temporary should be gone now.
117 EXPECT_FALSE(base::PathExists(file_path)); 117 EXPECT_FALSE(base::PathExists(file_path));
118 } 118 }
119 119
120 } // content 120 } // content
OLDNEW
« no previous file with comments | « content/browser/loader/temporary_file_stream.cc ('k') | content/browser/loader/throttling_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698