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

Side by Side Diff: chrome/browser/extensions/extension_renderer_state.h

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 19 matching lines...) Expand all
30 30
31 // Looks up the tab and window ID for a given request. Returns true if we have 31 // Looks up the tab and window ID for a given request. Returns true if we have
32 // the IDs in our map. Called on the IO thread. 32 // the IDs in our map. Called on the IO thread.
33 bool GetTabAndWindowId( 33 bool GetTabAndWindowId(
34 const content::ResourceRequestInfo* info, int* tab_id, int* window_id); 34 const content::ResourceRequestInfo* info, int* tab_id, int* window_id);
35 35
36 private: 36 private:
37 class RenderViewHostObserver; 37 class RenderViewHostObserver;
38 class TabObserver; 38 class TabObserver;
39 friend class TabObserver; 39 friend class TabObserver;
40 friend struct DefaultSingletonTraits<ExtensionRendererState>; 40 friend struct base::DefaultSingletonTraits<ExtensionRendererState>;
41 41
42 typedef std::pair<int, int> RenderId; 42 typedef std::pair<int, int> RenderId;
43 typedef std::pair<int, int> TabAndWindowId; 43 typedef std::pair<int, int> TabAndWindowId;
44 typedef std::map<RenderId, TabAndWindowId> TabAndWindowIdMap; 44 typedef std::map<RenderId, TabAndWindowId> TabAndWindowIdMap;
45 45
46 ExtensionRendererState(); 46 ExtensionRendererState();
47 ~ExtensionRendererState(); 47 ~ExtensionRendererState();
48 48
49 // Adds or removes a render view from our map. 49 // Adds or removes a render view from our map.
50 void SetTabAndWindowId( 50 void SetTabAndWindowId(
51 int render_process_host_id, int routing_id, int tab_id, int window_id); 51 int render_process_host_id, int routing_id, int tab_id, int window_id);
52 void ClearTabAndWindowId( 52 void ClearTabAndWindowId(
53 int render_process_host_id, int routing_id); 53 int render_process_host_id, int routing_id);
54 54
55 TabObserver* observer_; 55 TabObserver* observer_;
56 TabAndWindowIdMap map_; 56 TabAndWindowIdMap map_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererState); 58 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererState);
59 }; 59 };
60 60
61 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ 61 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_management.cc ('k') | chrome/browser/extensions/extension_renderer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698