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

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

Issue 11234032: Webview tag creation should be using storage partitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing the custom format of partition id. Created 8 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) 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_CONTENT_BROWSER_CLIENT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 ResourceContext* context, 256 ResourceContext* context,
257 const std::vector<std::pair<int, int> >& render_views); 257 const std::vector<std::pair<int, int> >& render_views);
258 258
259 // Allow the embedder to override the request context based on the URL for 259 // Allow the embedder to override the request context based on the URL for
260 // certain operations, like cookie access. Returns NULL to indicate the 260 // certain operations, like cookie access. Returns NULL to indicate the
261 // regular request context should be used. 261 // regular request context should be used.
262 // This is called on the IO thread. 262 // This is called on the IO thread.
263 virtual net::URLRequestContext* OverrideRequestContextForURL( 263 virtual net::URLRequestContext* OverrideRequestContextForURL(
264 const GURL& url, ResourceContext* context); 264 const GURL& url, ResourceContext* context);
265 265
266 // Allow the embedder to specify storage parititon id associated with a child 266 // Allow the embedder to specify storage parititon id associated with a site.
Charlie Reis 2012/11/07 02:36:34 Can you also update this to explain that partition
nasko 2012/11/07 17:47:01 Done.
267 // process.
268 //
269 // Child processes that have different storage partition identifiers will
270 // behave as if they belong to different web browsers and not be able to
271 // access each other's cookies, local storage, etc. IDs must only fit the
272 // pattern [a-z0-9]* (lowercase letters or digits).
273 //
274 // Returns the empty string for the regular storage partition.
275 virtual std::string GetStoragePartitionIdForChildProcess(
276 content::BrowserContext* browser_context,
277 int child_process_id);
278
279 // Same as GetStoragePartitionIdForChildProcess(), but uses a site instead.
280 //
281 // TODO(ajwong): Replace all uses of GetStoragePartitionIdForChildProcess()
282 // with this one.
283 virtual std::string GetStoragePartitionIdForSite( 267 virtual std::string GetStoragePartitionIdForSite(
284 content::BrowserContext* browser_context, 268 content::BrowserContext* browser_context,
285 const GURL& site); 269 const GURL& site);
286 270
287 // Allows the embedder to provide a validation check for |partition_id|s. 271 // Allows the embedder to provide a validation check for |partition_id|s.
288 // This domain of valid entries should match the range of outputs for 272 // This domain of valid entries should match the range of outputs for
289 // GetStoragePartitionIdForChildProcess(). 273 // GetStoragePartitionIdForChildProcess().
290 virtual bool IsValidStoragePartitionId(BrowserContext* browser_context, 274 virtual bool IsValidStoragePartitionId(BrowserContext* browser_context,
291 const std::string& partition_id); 275 const std::string& partition_id);
292 276
277 // Allow the embedder to provide storage parititon description associated with
Charlie Reis 2012/11/07 01:40:54 nit: Allows nit: provide a s/associated with/for/
Charlie Reis 2012/11/07 02:36:34 Also, s/description/configuration/. We've already
nasko 2012/11/07 17:47:01 Done.
nasko 2012/11/07 17:47:01 Done.
278 // a site. Storage can be split into partition domains, which are independent
Charlie Reis 2012/11/07 01:40:54 This sentence is hard for me to understand. Can w
nasko 2012/11/07 17:47:01 Done.
279 // from each other. The |partition_domain| is an arbitrary string, specifying
awong 2012/11/07 01:14:11 Please state the formating constraints (eg., what'
nasko 2012/11/07 17:47:01 Done.
280 // the domain in which partitions live (similar to namespace). Within a
281 // domain, partitions can be uniquely identified by the combination of
282 // |partition_name| and |in_memory| values. When a partition is not to be
283 // persisted, the |in_memory| value should be set to true.
awong 2012/11/07 01:14:11 should -> will
Charlie Reis 2012/11/07 01:40:54 Hmm, I think I agree with Nasko's wording (should)
awong 2012/11/07 01:43:46 I tend to think of function comments as hard specs
nasko 2012/11/07 17:47:01 Done.
nasko 2012/11/07 17:47:01 Done.
284 virtual void GetStoragePartitionConfigForSite(
285 content::BrowserContext* browser_context,
286 const GURL& site,
287 std::string* partition_domain,
288 std::string* partition_name,
289 bool* in_memory);
290
293 // Create and return a new quota permission context. 291 // Create and return a new quota permission context.
294 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); 292 virtual QuotaPermissionContext* CreateQuotaPermissionContext();
295 293
296 // Open the given file in the desktop's default manner. 294 // Open the given file in the desktop's default manner.
297 virtual void OpenItem(const FilePath& path) {} 295 virtual void OpenItem(const FilePath& path) {}
298 296
299 // Show the given file in a file manager. If possible, select the file. 297 // Show the given file in a file manager. If possible, select the file.
300 virtual void ShowItemInFolder(const FilePath& path) {} 298 virtual void ShowItemInFolder(const FilePath& path) {}
301 299
302 // Informs the embedder that a certificate error has occured. If 300 // Informs the embedder that a certificate error has occured. If
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 // This is called on a worker thread. 470 // This is called on a worker thread.
473 virtual 471 virtual
474 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( 472 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate(
475 const GURL& url); 473 const GURL& url);
476 #endif 474 #endif
477 }; 475 };
478 476
479 } // namespace content 477 } // namespace content
480 478
481 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 479 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698