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

Side by Side Diff: chrome/browser/dom_ui/chrome_url_data_manager.h

Issue 6268014: Release all DataSources before the main thread goes away. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H_ 5 #ifndef CHROME_BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H_
6 #define CHROME_BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H_ 6 #define CHROME_BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Add a DataSource to the collection of data sources. 108 // Add a DataSource to the collection of data sources.
109 // Because we don't track users of a given path, we can't know when it's 109 // Because we don't track users of a given path, we can't know when it's
110 // safe to remove them, so the added source effectively leaks. 110 // safe to remove them, so the added source effectively leaks.
111 // This could be improved in the future but currently the users of this 111 // This could be improved in the future but currently the users of this
112 // interface are conceptually permanent registration anyway. 112 // interface are conceptually permanent registration anyway.
113 // Adding a second DataSource with the same name clobbers the first. 113 // Adding a second DataSource with the same name clobbers the first.
114 // NOTE: Calling this from threads other the IO thread must be done via 114 // NOTE: Calling this from threads other the IO thread must be done via
115 // InvokeLater. 115 // InvokeLater.
116 void AddDataSource(scoped_refptr<DataSource> source); 116 void AddDataSource(scoped_refptr<DataSource> source);
117 117
118 // Called during shutdown, before destruction of |BrowserThread|.
119 void RemoveAllDataSources();
120
118 // Add/remove a path from the collection of file sources. 121 // Add/remove a path from the collection of file sources.
119 // A file source acts like a file:// URL to the specified path. 122 // A file source acts like a file:// URL to the specified path.
120 // Calling this from threads other the IO thread must be done via 123 // Calling this from threads other the IO thread must be done via
121 // InvokeLater. 124 // InvokeLater.
122 void AddFileSource(const std::string& source_name, const FilePath& path); 125 void AddFileSource(const std::string& source_name, const FilePath& path);
123 void RemoveFileSource(const std::string& source_name); 126 void RemoveFileSource(const std::string& source_name);
124 127
125 static net::URLRequestJob* Factory(net::URLRequest* request, 128 static net::URLRequestJob* Factory(net::URLRequest* request,
126 const std::string& scheme); 129 const std::string& scheme);
127 130
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeURLDataManager); 182 DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeURLDataManager);
180 183
181 // Register our special URL handler under our special URL scheme. 184 // Register our special URL handler under our special URL scheme.
182 // Must be done once at startup. 185 // Must be done once at startup.
183 void RegisterURLRequestChromeJob(); 186 void RegisterURLRequestChromeJob();
184 187
185 // Undoes the registration done by RegisterURLRequestChromeJob. 188 // Undoes the registration done by RegisterURLRequestChromeJob.
186 void UnregisterURLRequestChromeJob(); 189 void UnregisterURLRequestChromeJob();
187 190
188 #endif // CHROME_BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H_ 191 #endif // CHROME_BROWSER_DOM_UI_CHROME_URL_DATA_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698