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

Side by Side Diff: content/public/browser/browser_context.h

Issue 1878153002: Revert of Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 const GURL& site, 92 const GURL& site,
93 const base::Closure& on_gc_required); 93 const base::Closure& on_gc_required);
94 94
95 // This function clears the contents of |active_paths| but does not take 95 // This function clears the contents of |active_paths| but does not take
96 // ownership of the pointer. 96 // ownership of the pointer.
97 static void GarbageCollectStoragePartitions( 97 static void GarbageCollectStoragePartitions(
98 BrowserContext* browser_context, 98 BrowserContext* browser_context,
99 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, 99 std::unique_ptr<base::hash_set<base::FilePath>> active_paths,
100 const base::Closure& done); 100 const base::Closure& done);
101 101
102 // DON'T USE THIS. GetDefaultStoragePartition() is going away.
103 // Use GetStoragePartition() instead. Ask ajwong@ if you have problems.
102 static content::StoragePartition* GetDefaultStoragePartition( 104 static content::StoragePartition* GetDefaultStoragePartition(
103 BrowserContext* browser_context); 105 BrowserContext* browser_context);
104 106
105 typedef base::Callback<void(std::unique_ptr<BlobHandle>)> BlobCallback; 107 typedef base::Callback<void(std::unique_ptr<BlobHandle>)> BlobCallback;
106 108
107 // |callback| returns a nullptr scoped_ptr on failure. 109 // |callback| returns a nullptr scoped_ptr on failure.
108 static void CreateMemoryBackedBlob(BrowserContext* browser_context, 110 static void CreateMemoryBackedBlob(BrowserContext* browser_context,
109 const char* data, size_t length, 111 const char* data, size_t length,
110 const BlobCallback& callback); 112 const BlobCallback& callback);
111 113
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // This is called during creation of each StoragePartition. 159 // This is called during creation of each StoragePartition.
158 virtual std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( 160 virtual std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate(
159 const base::FilePath& partition_path) = 0; 161 const base::FilePath& partition_path) = 0;
160 162
161 // Returns the path of the directory where this context's data is stored. 163 // Returns the path of the directory where this context's data is stored.
162 virtual base::FilePath GetPath() const = 0; 164 virtual base::FilePath GetPath() const = 0;
163 165
164 // Return whether this context is incognito. Default is false. 166 // Return whether this context is incognito. Default is false.
165 virtual bool IsOffTheRecord() const = 0; 167 virtual bool IsOffTheRecord() const = 0;
166 168
169 // Returns the request context information associated with this context. Call
170 // this only on the UI thread, since it can send notifications that should
171 // happen on the UI thread.
172 // TODO(creis): Remove this version in favor of the one below.
173 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
174
167 // Returns the default request context for media resources associated with 175 // Returns the default request context for media resources associated with
168 // this context. 176 // this context.
169 // TODO(creis): Remove this version in favor of the one below. 177 // TODO(creis): Remove this version in favor of the one below.
170 virtual net::URLRequestContextGetter* GetMediaRequestContext() = 0; 178 virtual net::URLRequestContextGetter* GetMediaRequestContext() = 0;
171 179
172 // Returns the request context for media resources associated with this 180 // Returns the request context for media resources associated with this
173 // context and renderer process. 181 // context and renderer process.
174 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( 182 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
175 int renderer_child_id) = 0; 183 int renderer_child_id) = 0;
176 virtual net::URLRequestContextGetter* 184 virtual net::URLRequestContextGetter*
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( 227 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
220 const base::FilePath& partition_path, 228 const base::FilePath& partition_path,
221 bool in_memory, 229 bool in_memory,
222 ProtocolHandlerMap* protocol_handlers, 230 ProtocolHandlerMap* protocol_handlers,
223 URLRequestInterceptorScopedVector request_interceptors) = 0; 231 URLRequestInterceptorScopedVector request_interceptors) = 0;
224 }; 232 };
225 233
226 } // namespace content 234 } // namespace content
227 235
228 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 236 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl_unittest.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698