 Chromium Code Reviews
 Chromium Code Reviews 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
    
  
    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| 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); |