OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // Resets the found file list. | 105 // Resets the found file list. |
106 void ClearFoundFiles(); | 106 void ClearFoundFiles(); |
107 | 107 |
108 static std::string DebugString(FileOperationCode code); | 108 static std::string DebugString(FileOperationCode code); |
109 | 109 |
110 private: | 110 private: |
111 friend class base::RefCountedThreadSafe<TestFileErrorInjector>; | 111 friend class base::RefCountedThreadSafe<TestFileErrorInjector>; |
112 | 112 |
113 typedef std::set<GURL> FileSet; | 113 typedef std::set<GURL> FileSet; |
114 | 114 |
115 TestFileErrorInjector( | 115 explicit TestFileErrorInjector( |
116 scoped_refptr<DownloadManager> download_manager); | 116 scoped_refptr<DownloadManager> download_manager); |
117 | 117 |
118 virtual ~TestFileErrorInjector(); | 118 virtual ~TestFileErrorInjector(); |
119 | 119 |
120 // Callbacks from the download file, to record lifetimes. | 120 // Callbacks from the download file, to record lifetimes. |
121 // These may be called on any thread. | 121 // These may be called on any thread. |
122 void RecordDownloadFileConstruction(const GURL& url); | 122 void RecordDownloadFileConstruction(const GURL& url); |
123 void RecordDownloadFileDestruction(const GURL& url); | 123 void RecordDownloadFileDestruction(const GURL& url); |
124 | 124 |
125 // These run on the UI thread. | 125 // These run on the UI thread. |
(...skipping 15 matching lines...) Expand all Loading... |
141 | 141 |
142 // The download manager we set the factory on. | 142 // The download manager we set the factory on. |
143 scoped_refptr<DownloadManagerImpl> download_manager_; | 143 scoped_refptr<DownloadManagerImpl> download_manager_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(TestFileErrorInjector); | 145 DISALLOW_COPY_AND_ASSIGN(TestFileErrorInjector); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace content | 148 } // namespace content |
149 | 149 |
150 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ | 150 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ |
OLD | NEW |