OLD | NEW |
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 #include "chrome/browser/profiles/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "chrome/common/chrome_paths.h" | 41 #include "chrome/common/chrome_paths.h" |
42 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
43 #include "chrome/common/extensions/extension.h" | 43 #include "chrome/common/extensions/extension.h" |
44 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
45 #include "chrome/common/render_messages.h" | 45 #include "chrome/common/render_messages.h" |
46 #include "content/public/browser/browser_thread.h" | 46 #include "content/public/browser/browser_thread.h" |
47 #include "content/public/browser/host_zoom_map.h" | 47 #include "content/public/browser/host_zoom_map.h" |
48 #include "content/public/browser/notification_service.h" | 48 #include "content/public/browser/notification_service.h" |
49 #include "content/public/browser/notification_types.h" | 49 #include "content/public/browser/notification_types.h" |
50 #include "content/public/browser/render_process_host.h" | 50 #include "content/public/browser/render_process_host.h" |
| 51 #include "content/public/browser/storage_partition.h" |
51 #include "content/public/browser/web_contents.h" | 52 #include "content/public/browser/web_contents.h" |
52 #include "net/base/transport_security_state.h" | 53 #include "net/base/transport_security_state.h" |
53 #include "net/http/http_server_properties.h" | 54 #include "net/http/http_server_properties.h" |
54 #include "webkit/database/database_tracker.h" | 55 #include "webkit/database/database_tracker.h" |
55 | 56 |
56 #if defined(OS_ANDROID) | 57 #if defined(OS_ANDROID) |
57 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 58 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
58 #endif | 59 #endif |
59 | 60 |
60 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 extension_service->GetIsolatedAppForRenderer(renderer_child_id); | 273 extension_service->GetIsolatedAppForRenderer(renderer_child_id); |
273 if (extension) | 274 if (extension) |
274 return GetRequestContextForStoragePartition(extension->id()); | 275 return GetRequestContextForStoragePartition(extension->id()); |
275 } | 276 } |
276 | 277 |
277 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 278 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
278 renderer_child_id); | 279 renderer_child_id); |
279 if (rph && rph->IsGuest()) { | 280 if (rph && rph->IsGuest()) { |
280 // For guest processes (used by the browser tag), we need to isolate the | 281 // For guest processes (used by the browser tag), we need to isolate the |
281 // storage. | 282 // storage. |
282 // TODO(nasko): Until we have proper storage partitions, create a | 283 return rph->GetStoragePartition()->GetURLRequestContext(); |
283 // non-persistent context using the RPH's id. | |
284 std::string id("guest-"); | |
285 id.append(base::IntToString(renderer_child_id)); | |
286 return GetRequestContextForStoragePartition(id); | |
287 } | 284 } |
288 | 285 |
289 return GetRequestContext(); | 286 return GetRequestContext(); |
290 } | 287 } |
291 | 288 |
292 net::URLRequestContextGetter* | 289 net::URLRequestContextGetter* |
293 OffTheRecordProfileImpl::GetMediaRequestContext() { | 290 OffTheRecordProfileImpl::GetMediaRequestContext() { |
294 // In OTR mode, media request context is the same as the original one. | 291 // In OTR mode, media request context is the same as the original one. |
295 return GetRequestContext(); | 292 return GetRequestContext(); |
296 } | 293 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 if (!profile) | 491 if (!profile) |
495 profile = new OffTheRecordProfileImpl(this); | 492 profile = new OffTheRecordProfileImpl(this); |
496 profile->Init(); | 493 profile->Init(); |
497 return profile; | 494 return profile; |
498 } | 495 } |
499 | 496 |
500 base::Callback<ChromeURLDataManagerBackend*(void)> | 497 base::Callback<ChromeURLDataManagerBackend*(void)> |
501 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 498 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
502 return io_data_.GetChromeURLDataManagerBackendGetter(); | 499 return io_data_.GetChromeURLDataManagerBackendGetter(); |
503 } | 500 } |
OLD | NEW |