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

Side by Side Diff: chrome/browser/debugger/devtools_file_util.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/debugger/devtools_file_util.h" 5 #include "chrome/browser/debugger/devtools_file_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/download/download_prefs.h" 12 #include "chrome/browser/download/download_prefs.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/shell_dialogs.h" 14 #include "chrome/browser/ui/shell_dialogs.h"
15 15
16 using content::BrowserThread; 16 using content::BrowserThread;
17 17
18 namespace { 18 namespace {
19 19
20 base::LazyInstance<FilePath, 20 base::LazyInstance<FilePath,
21 base::LeakyLazyInstanceTraits<FilePath> > 21 base::LeakyLazyInstanceTraits<FilePath> >
22 g_last_save_path(base::LINKER_INITIALIZED); 22 g_last_save_path = LAZY_INSTANCE_INITIALIZER;
23 23
24 class SaveAsDialog : public SelectFileDialog::Listener, 24 class SaveAsDialog : public SelectFileDialog::Listener,
25 public base::RefCounted<SaveAsDialog> { 25 public base::RefCounted<SaveAsDialog> {
26 public: 26 public:
27 SaveAsDialog() { 27 SaveAsDialog() {
28 select_file_dialog_ = SelectFileDialog::Create(this); 28 select_file_dialog_ = SelectFileDialog::Create(this);
29 } 29 }
30 30
31 void Show(Profile* profile, 31 void Show(Profile* profile,
32 const std::string& suggested_file_name, 32 const std::string& suggested_file_name,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 } // namespace 100 } // namespace
101 101
102 // static 102 // static
103 void DevToolsFileUtil::SaveAs(Profile* profile, 103 void DevToolsFileUtil::SaveAs(Profile* profile,
104 const std::string& suggested_file_name, 104 const std::string& suggested_file_name,
105 const std::string& content) { 105 const std::string& content) {
106 scoped_refptr<SaveAsDialog> dialog = new SaveAsDialog(); 106 scoped_refptr<SaveAsDialog> dialog = new SaveAsDialog();
107 dialog->Show(profile, suggested_file_name, content); 107 dialog->Show(profile, suggested_file_name, content);
108 } 108 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698