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

Side by Side Diff: net/url_request/url_fetcher_response_writer.h

Issue 623213004: replace OVERRIDE and FINAL with override and final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo unwanted change in comment Created 6 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
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 #ifndef NET_URL_REQUEST_URL_FETCHER_RESPONSE_WRITER_H_ 5 #ifndef NET_URL_REQUEST_URL_FETCHER_RESPONSE_WRITER_H_
6 #define NET_URL_REQUEST_URL_FETCHER_RESPONSE_WRITER_H_ 6 #define NET_URL_REQUEST_URL_FETCHER_RESPONSE_WRITER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // URLFetcherResponseWriter implementation for std::string. 59 // URLFetcherResponseWriter implementation for std::string.
60 class NET_EXPORT URLFetcherStringWriter : public URLFetcherResponseWriter { 60 class NET_EXPORT URLFetcherStringWriter : public URLFetcherResponseWriter {
61 public: 61 public:
62 URLFetcherStringWriter(); 62 URLFetcherStringWriter();
63 virtual ~URLFetcherStringWriter(); 63 virtual ~URLFetcherStringWriter();
64 64
65 const std::string& data() const { return data_; } 65 const std::string& data() const { return data_; }
66 66
67 // URLFetcherResponseWriter overrides: 67 // URLFetcherResponseWriter overrides:
68 virtual int Initialize(const CompletionCallback& callback) OVERRIDE; 68 virtual int Initialize(const CompletionCallback& callback) override;
69 virtual int Write(IOBuffer* buffer, 69 virtual int Write(IOBuffer* buffer,
70 int num_bytes, 70 int num_bytes,
71 const CompletionCallback& callback) OVERRIDE; 71 const CompletionCallback& callback) override;
72 virtual int Finish(const CompletionCallback& callback) OVERRIDE; 72 virtual int Finish(const CompletionCallback& callback) override;
73 virtual URLFetcherStringWriter* AsStringWriter() OVERRIDE; 73 virtual URLFetcherStringWriter* AsStringWriter() override;
74 74
75 private: 75 private:
76 std::string data_; 76 std::string data_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(URLFetcherStringWriter); 78 DISALLOW_COPY_AND_ASSIGN(URLFetcherStringWriter);
79 }; 79 };
80 80
81 // URLFetcherResponseWriter implementation for files. 81 // URLFetcherResponseWriter implementation for files.
82 class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter { 82 class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter {
83 public: 83 public:
84 // |file_path| is used as the destination path. If |file_path| is empty, 84 // |file_path| is used as the destination path. If |file_path| is empty,
85 // Initialize() will create a temporary file. 85 // Initialize() will create a temporary file.
86 URLFetcherFileWriter( 86 URLFetcherFileWriter(
87 scoped_refptr<base::SequencedTaskRunner> file_task_runner, 87 scoped_refptr<base::SequencedTaskRunner> file_task_runner,
88 const base::FilePath& file_path); 88 const base::FilePath& file_path);
89 virtual ~URLFetcherFileWriter(); 89 virtual ~URLFetcherFileWriter();
90 90
91 const base::FilePath& file_path() const { return file_path_; } 91 const base::FilePath& file_path() const { return file_path_; }
92 92
93 // URLFetcherResponseWriter overrides: 93 // URLFetcherResponseWriter overrides:
94 virtual int Initialize(const CompletionCallback& callback) OVERRIDE; 94 virtual int Initialize(const CompletionCallback& callback) override;
95 virtual int Write(IOBuffer* buffer, 95 virtual int Write(IOBuffer* buffer,
96 int num_bytes, 96 int num_bytes,
97 const CompletionCallback& callback) OVERRIDE; 97 const CompletionCallback& callback) override;
98 virtual int Finish(const CompletionCallback& callback) OVERRIDE; 98 virtual int Finish(const CompletionCallback& callback) override;
99 virtual URLFetcherFileWriter* AsFileWriter() OVERRIDE; 99 virtual URLFetcherFileWriter* AsFileWriter() override;
100 100
101 // Drops ownership of the file at |file_path_|. 101 // Drops ownership of the file at |file_path_|.
102 // This class will not delete it or write to it again. 102 // This class will not delete it or write to it again.
103 void DisownFile(); 103 void DisownFile();
104 104
105 private: 105 private:
106 // Called when a write has been done. 106 // Called when a write has been done.
107 void DidWrite(const CompletionCallback& callback, int result); 107 void DidWrite(const CompletionCallback& callback, int result);
108 108
109 // Closes the file if it is open and then delete it. 109 // Closes the file if it is open and then delete it.
(...skipping 25 matching lines...) Expand all
135 135
136 // Callbacks are created for use with base::FileUtilProxy. 136 // Callbacks are created for use with base::FileUtilProxy.
137 base::WeakPtrFactory<URLFetcherFileWriter> weak_factory_; 137 base::WeakPtrFactory<URLFetcherFileWriter> weak_factory_;
138 138
139 DISALLOW_COPY_AND_ASSIGN(URLFetcherFileWriter); 139 DISALLOW_COPY_AND_ASSIGN(URLFetcherFileWriter);
140 }; 140 };
141 141
142 } // namespace net 142 } // namespace net
143 143
144 #endif // NET_URL_REQUEST_URL_FETCHER_RESPONSE_WRITER_H_ 144 #endif // NET_URL_REQUEST_URL_FETCHER_RESPONSE_WRITER_H_
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_impl_unittest.cc ('k') | net/url_request/url_fetcher_response_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698