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

Unified Diff: chrome/browser/dom_ui/chrome_url_data_manager.h

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/chrome_url_data_manager.h
diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.h b/chrome/browser/dom_ui/chrome_url_data_manager.h
index c6b6e76f8c0833c7e6c85c5081a1db414014833a..516022902b3372a73c5540e6a7bd277798c55692 100644
--- a/chrome/browser/dom_ui/chrome_url_data_manager.h
+++ b/chrome/browser/dom_ui/chrome_url_data_manager.h
@@ -9,6 +9,7 @@
#include <map>
#include <string>
+#include "base/singleton.h"
#include "base/task.h"
#include "base/ref_counted.h"
@@ -32,8 +33,8 @@ class URLRequestJob;
// it from the UI thread needs to go through an InvokeLater.
class ChromeURLDataManager {
public:
- ChromeURLDataManager();
- ~ChromeURLDataManager();
+ // Returns the singleton instance.
+ static ChromeURLDataManager* GetInstance();
typedef int RequestID;
@@ -122,12 +123,16 @@ class ChromeURLDataManager {
private:
friend class URLRequestChromeJob;
+ friend struct DefaultSingletonTraits<ChromeURLDataManager>;
// Parse a URL into the components used to resolve its request.
static void URLToRequest(const GURL& url,
std::string* source,
std::string* path);
+ ChromeURLDataManager();
+ ~ChromeURLDataManager();
joth 2010/12/08 17:15:07 c'tor & d'tor go before all methods (inc. static m
+
// Translate a chrome resource URL into a local file path if there is one.
// Returns false if there is no file handler for this URL
static bool URLToFilePath(const GURL& url, FilePath* file_path);

Powered by Google App Engine
This is Rietveld 408576698