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

Side by Side Diff: chrome/common/extensions/extension_set.h

Issue 10458063: Add sanbdoxed_pages to allow extension/app pages to be served in a sandboxed, unique origin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CheckCurrentContextAccessToExtensionAPI Created 8 years, 6 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 | Annotate | Revision Log
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_COMMON_EXTENSIONS_EXTENSION_SET_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_
7 #pragma once 7 #pragma once
8 8
9 #include <iterator> 9 #include <iterator>
10 #include <map> 10 #include <map>
(...skipping 23 matching lines...) Expand all
34 const GURL& url() const { return url_; } 34 const GURL& url() const { return url_; }
35 35
36 private: 36 private:
37 WebKit::WebSecurityOrigin origin_; 37 WebKit::WebSecurityOrigin origin_;
38 GURL url_; 38 GURL url_;
39 }; 39 };
40 40
41 // The one true extension container. Extensions are identified by their id. 41 // The one true extension container. Extensions are identified by their id.
42 // Only one extension can be in the set with a given ID. 42 // Only one extension can be in the set with a given ID.
43 class ExtensionSet { 43 class ExtensionSet {
44 public: 44 public:
45 typedef std::pair<FilePath, std::string> ExtensionPathAndDefaultLocale; 45 typedef std::pair<FilePath, std::string> ExtensionPathAndDefaultLocale;
46 typedef std::map<std::string, scoped_refptr<const extensions::Extension> > 46 typedef std::map<std::string, scoped_refptr<const extensions::Extension> >
47 ExtensionMap; 47 ExtensionMap;
48 48
49 // Iteration over the values of the map (given that it's an ExtensionSet, 49 // Iteration over the values of the map (given that it's an ExtensionSet,
50 // it should iterate like a set iterator). 50 // it should iterate like a set iterator).
51 class const_iterator : 51 class const_iterator :
52 public std::iterator<std::input_iterator_tag, 52 public std::iterator<std::input_iterator_tag,
53 scoped_refptr<const extensions::Extension> > { 53 scoped_refptr<const extensions::Extension> > {
54 public: 54 public:
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 bool InSameExtent(const GURL& old_url, const GURL& new_url) const; 122 bool InSameExtent(const GURL& old_url, const GURL& new_url) const;
123 123
124 // Look up an Extension object by id. 124 // Look up an Extension object by id.
125 const extensions::Extension* GetByID(const std::string& id) const; 125 const extensions::Extension* GetByID(const std::string& id) const;
126 126
127 // Returns true if |info| should get extension api bindings and be permitted 127 // Returns true if |info| should get extension api bindings and be permitted
128 // to make api calls. Note that this is independent of what extension 128 // to make api calls. Note that this is independent of what extension
129 // permissions the given extension has been granted. 129 // permissions the given extension has been granted.
130 bool ExtensionBindingsAllowed(const ExtensionURLInfo& info) const; 130 bool ExtensionBindingsAllowed(const ExtensionURLInfo& info) const;
131 131
132 // Returns true if |info| is an extension page that is to be served in a
133 // unique sandboxed origin.
134 bool IsSandboxedPage(const ExtensionURLInfo& info) const;
135
132 private: 136 private:
133 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); 137 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet);
134 138
135 ExtensionMap extensions_; 139 ExtensionMap extensions_;
136 140
137 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); 141 DISALLOW_COPY_AND_ASSIGN(ExtensionSet);
138 }; 142 };
139 143
140 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ 144 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698