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

Side by Side Diff: chrome/browser/profiles/profile_destroyer.h

Issue 853743002: First pass at fixing guest browser cookies issue. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete the Profile Manager. Guest Profile doesn't write to autocomplete/history. Views still needs … Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PROFILES_PROFILE_DESTROYER_H_ 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_DESTROYER_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_DESTROYER_H_ 6 #define CHROME_BROWSER_PROFILES_PROFILE_DESTROYER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/timer/timer.h" 11 #include "base/timer/timer.h"
12 #include "content/public/browser/render_process_host_observer.h" 12 #include "content/public/browser/render_process_host_observer.h"
13 13
14 class Profile; 14 class Profile;
15 15
16 namespace content { 16 namespace content {
17 class RenderProcessHost; 17 class RenderProcessHost;
18 } 18 }
19 19
20 // We use this class to destroy the off the record profile so that we can make 20 // We use this class to destroy the off the record profile so that we can make
21 // sure it gets done asynchronously after all render process hosts are gone. 21 // sure it gets done asynchronously after all render process hosts are gone.
22 class ProfileDestroyer : public content::RenderProcessHostObserver { 22 class ProfileDestroyer : public content::RenderProcessHostObserver {
23 public: 23 public:
24 static void DestroyProfileWhenAppropriate(Profile* const profile); 24 static void DestroyProfileWhenAppropriate(Profile* const profile);
25 static void DestroyOffTheRecordProfileNow(Profile* const profile); 25 static void DestroyOffTheRecordProfileNow(Profile* const profile);
26 26
27 // If the Guest Profile is ready to be destroyed, do so.
28 static void DestroyGuestProfileIfAppropriate();
29
27 private: 30 private:
28 typedef std::set<content::RenderProcessHost*> HostSet; 31 typedef std::set<content::RenderProcessHost*> HostSet;
29 typedef std::set<ProfileDestroyer*> DestroyerSet; 32 typedef std::set<ProfileDestroyer*> DestroyerSet;
30 33
31 friend class base::RefCounted<ProfileDestroyer>; 34 friend class base::RefCounted<ProfileDestroyer>;
32 35
33 ProfileDestroyer(Profile* const profile, HostSet* hosts); 36 ProfileDestroyer(Profile* const profile, HostSet* hosts);
34 ~ProfileDestroyer() override; 37 ~ProfileDestroyer() override;
35 38
36 // content::RenderProcessHostObserver override. 39 // content::RenderProcessHostObserver override.
(...skipping 18 matching lines...) Expand all
55 // The profile being destroyed. If it is set to NULL, it is a signal from 58 // The profile being destroyed. If it is set to NULL, it is a signal from
56 // another instance of ProfileDestroyer that this instance is canceled. 59 // another instance of ProfileDestroyer that this instance is canceled.
57 Profile* profile_; 60 Profile* profile_;
58 61
59 base::WeakPtrFactory<ProfileDestroyer> weak_ptr_factory_; 62 base::WeakPtrFactory<ProfileDestroyer> weak_ptr_factory_;
60 63
61 DISALLOW_COPY_AND_ASSIGN(ProfileDestroyer); 64 DISALLOW_COPY_AND_ASSIGN(ProfileDestroyer);
62 }; 65 };
63 66
64 #endif // CHROME_BROWSER_PROFILES_PROFILE_DESTROYER_H_ 67 #endif // CHROME_BROWSER_PROFILES_PROFILE_DESTROYER_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | chrome/browser/profiles/profile_destroyer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698