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

Side by Side Diff: chrome/browser/browser_about_handler.cc

Issue 350007: Convert chrome_url_data_manager (previously a global) into a Singleton. This (Closed)
Patch Set: Created 11 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/dom_ui/chrome_url_data_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/browser/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 // AboutSource ----------------------------------------------------------------- 561 // AboutSource -----------------------------------------------------------------
562 562
563 AboutSource::AboutSource() 563 AboutSource::AboutSource()
564 : DataSource(chrome::kAboutScheme, MessageLoop::current()) { 564 : DataSource(chrome::kAboutScheme, MessageLoop::current()) {
565 // This should be a singleton. 565 // This should be a singleton.
566 DCHECK(!about_source); 566 DCHECK(!about_source);
567 about_source = this; 567 about_source = this;
568 568
569 // Add us to the global URL handler on the IO thread. 569 // Add us to the global URL handler on the IO thread.
570 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, 570 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
571 NewRunnableMethod(&chrome_url_data_manager, 571 NewRunnableMethod(Singleton<ChromeURLDataManager>().get(),
572 &ChromeURLDataManager::AddDataSource, this)); 572 &ChromeURLDataManager::AddDataSource, this));
573 } 573 }
574 574
575 AboutSource::~AboutSource() { 575 AboutSource::~AboutSource() {
576 about_source = NULL; 576 about_source = NULL;
577 } 577 }
578 578
579 void AboutSource::StartDataRequest(const std::string& path_raw, 579 void AboutSource::StartDataRequest(const std::string& path_raw,
580 int request_id) { 580 int request_id) {
581 std::string path = path_raw; 581 std::string path = path_raw;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 // Run the dialog. This will re-use the existing one if it's already up. 894 // Run the dialog. This will re-use the existing one if it's already up.
895 AboutIPCDialog::RunDialog(); 895 AboutIPCDialog::RunDialog();
896 return true; 896 return true;
897 } 897 }
898 #endif 898 #endif
899 899
900 #endif // OFFICIAL_BUILD 900 #endif // OFFICIAL_BUILD
901 901
902 return false; 902 return false;
903 } 903 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/chrome_url_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698