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

Side by Side Diff: chrome/browser/profiles/profile.cc

Issue 6201005: Initial support for partitioning cookies for isolated apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor and address comments. Created 9 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/prefs/pref_service.h" 28 #include "chrome/browser/prefs/pref_service.h"
29 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" 29 #include "chrome/browser/profiles/off_the_record_profile_io_data.h"
30 #include "chrome/browser/ssl/ssl_host_state.h" 30 #include "chrome/browser/ssl/ssl_host_state.h"
31 #include "chrome/browser/sync/profile_sync_service.h" 31 #include "chrome/browser/sync/profile_sync_service.h"
32 #include "chrome/browser/themes/browser_theme_provider.h" 32 #include "chrome/browser/themes/browser_theme_provider.h"
33 #include "chrome/browser/ui/find_bar/find_bar_state.h" 33 #include "chrome/browser/ui/find_bar/find_bar_state.h"
34 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 34 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
35 #include "chrome/common/chrome_constants.h" 35 #include "chrome/common/chrome_constants.h"
36 #include "chrome/common/chrome_paths.h" 36 #include "chrome/common/chrome_paths.h"
37 #include "chrome/common/chrome_switches.h" 37 #include "chrome/common/chrome_switches.h"
38 #include "chrome/common/extensions/extension.h"
38 #include "chrome/common/json_pref_store.h" 39 #include "chrome/common/json_pref_store.h"
39 #include "chrome/common/notification_service.h" 40 #include "chrome/common/notification_service.h"
40 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
41 #include "chrome/common/render_messages.h" 42 #include "chrome/common/render_messages.h"
42 #include "content/browser/appcache/chrome_appcache_service.h" 43 #include "content/browser/appcache/chrome_appcache_service.h"
43 #include "content/browser/browser_thread.h" 44 #include "content/browser/browser_thread.h"
44 #include "content/browser/chrome_blob_storage_context.h" 45 #include "content/browser/chrome_blob_storage_context.h"
45 #include "content/browser/file_system/browser_file_system_helper.h" 46 #include "content/browser/file_system/browser_file_system_helper.h"
46 #include "content/browser/host_zoom_map.h" 47 #include "content/browser/host_zoom_map.h"
47 #include "content/browser/in_process_webkit/webkit_context.h" 48 #include "content/browser/in_process_webkit/webkit_context.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 417 }
417 418
418 virtual BrowserThemeProvider* GetThemeProvider() { 419 virtual BrowserThemeProvider* GetThemeProvider() {
419 return profile_->GetThemeProvider(); 420 return profile_->GetThemeProvider();
420 } 421 }
421 422
422 virtual URLRequestContextGetter* GetRequestContext() { 423 virtual URLRequestContextGetter* GetRequestContext() {
423 return io_data_.GetMainRequestContextGetter(); 424 return io_data_.GetMainRequestContextGetter();
424 } 425 }
425 426
427 virtual URLRequestContextGetter* GetRequestContextForPossibleApp(
428 const Extension* app) {
429 if (CommandLine::ForCurrentProcess()->HasSwitch(
430 switches::kEnableExperimentalAppManifests) &&
431 app != NULL &&
432 app->is_storage_isolated())
433 return GetRequestContextForIsolatedApp(app);
434
435 return GetRequestContext();
436 }
437
426 virtual URLRequestContextGetter* GetRequestContextForMedia() { 438 virtual URLRequestContextGetter* GetRequestContextForMedia() {
427 // In OTR mode, media request context is the same as the original one. 439 // In OTR mode, media request context is the same as the original one.
428 return io_data_.GetMainRequestContextGetter(); 440 return io_data_.GetMainRequestContextGetter();
429 } 441 }
430 442
431 URLRequestContextGetter* GetRequestContextForExtensions() { 443 URLRequestContextGetter* GetRequestContextForExtensions() {
432 return io_data_.GetExtensionsRequestContextGetter(); 444 return io_data_.GetExtensionsRequestContextGetter();
433 } 445 }
434 446
447 URLRequestContextGetter* GetRequestContextForIsolatedApp(
448 const Extension* installed_app) {
449 // Initialize the app context IO data on demand.
450 io_data_.InitIsolatedApp(installed_app);
451 return io_data_.GetIsolatedAppRequestContextGetter(installed_app);
452 }
453
435 virtual net::SSLConfigService* GetSSLConfigService() { 454 virtual net::SSLConfigService* GetSSLConfigService() {
436 return profile_->GetSSLConfigService(); 455 return profile_->GetSSLConfigService();
437 } 456 }
438 457
439 virtual HostContentSettingsMap* GetHostContentSettingsMap() { 458 virtual HostContentSettingsMap* GetHostContentSettingsMap() {
440 // Retrieve the host content settings map of the parent profile in order to 459 // Retrieve the host content settings map of the parent profile in order to
441 // ensure the preferences have been migrated. 460 // ensure the preferences have been migrated.
442 profile_->GetHostContentSettingsMap(); 461 profile_->GetHostContentSettingsMap();
443 if (!host_content_settings_map_.get()) 462 if (!host_content_settings_map_.get())
444 host_content_settings_map_ = new HostContentSettingsMap(this); 463 host_content_settings_map_ = new HostContentSettingsMap(this);
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 }; 792 };
774 #endif 793 #endif
775 794
776 Profile* Profile::CreateOffTheRecordProfile() { 795 Profile* Profile::CreateOffTheRecordProfile() {
777 #if defined(OS_CHROMEOS) 796 #if defined(OS_CHROMEOS)
778 if (Profile::IsGuestSession()) 797 if (Profile::IsGuestSession())
779 return new GuestSessionProfile(this); 798 return new GuestSessionProfile(this);
780 #endif 799 #endif
781 return new OffTheRecordProfileImpl(this); 800 return new OffTheRecordProfileImpl(this);
782 } 801 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698