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

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

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes based on Albert's review. Created 8 years, 2 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 #include "chrome/browser/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 ChromeURLRequestContext* 379 ChromeURLRequestContext*
380 ProfileIOData::GetExtensionsRequestContext() const { 380 ProfileIOData::GetExtensionsRequestContext() const {
381 LazyInitialize(); 381 LazyInitialize();
382 return extensions_request_context_.get(); 382 return extensions_request_context_.get();
383 } 383 }
384 384
385 ChromeURLRequestContext* 385 ChromeURLRequestContext*
386 ProfileIOData::GetIsolatedAppRequestContext( 386 ProfileIOData::GetIsolatedAppRequestContext(
387 ChromeURLRequestContext* main_context, 387 ChromeURLRequestContext* main_context,
388 const std::string& app_id, 388 const StoragePartitionDescriptor& partition_descriptor,
389 scoped_ptr<net::URLRequestJobFactory::Interceptor> 389 scoped_ptr<net::URLRequestJobFactory::Interceptor>
390 protocol_handler_interceptor) const { 390 protocol_handler_interceptor) const {
391 LazyInitialize(); 391 LazyInitialize();
392 ChromeURLRequestContext* context = NULL; 392 ChromeURLRequestContext* context = NULL;
393 if (ContainsKey(app_request_context_map_, app_id)) { 393 if (ContainsKey(app_request_context_map_, partition_descriptor)) {
394 context = app_request_context_map_[app_id]; 394 context = app_request_context_map_[partition_descriptor];
395 } else { 395 } else {
396 context = AcquireIsolatedAppRequestContext( 396 context = AcquireIsolatedAppRequestContext(
397 main_context, app_id, protocol_handler_interceptor.Pass()); 397 main_context, partition_descriptor,
398 app_request_context_map_[app_id] = context; 398 protocol_handler_interceptor.Pass());
399 app_request_context_map_[partition_descriptor] = context;
399 } 400 }
400 DCHECK(context); 401 DCHECK(context);
401 return context; 402 return context;
402 } 403 }
403 404
404 ChromeURLRequestContext* 405 ChromeURLRequestContext*
405 ProfileIOData::GetIsolatedMediaRequestContext( 406 ProfileIOData::GetIsolatedMediaRequestContext(
406 ChromeURLRequestContext* app_context, 407 ChromeURLRequestContext* app_context,
407 const std::string& app_id) const { 408 const StoragePartitionDescriptor& partition_descriptor) const {
408 LazyInitialize(); 409 LazyInitialize();
409 ChromeURLRequestContext* context = NULL; 410 ChromeURLRequestContext* context = NULL;
410 if (ContainsKey(isolated_media_request_context_map_, app_id)) { 411 if (ContainsKey(isolated_media_request_context_map_, partition_descriptor)) {
411 context = isolated_media_request_context_map_[app_id]; 412 context = isolated_media_request_context_map_[partition_descriptor];
412 } else { 413 } else {
413 context = AcquireIsolatedMediaRequestContext(app_context, app_id); 414 context = AcquireIsolatedMediaRequestContext(app_context,
414 isolated_media_request_context_map_[app_id] = context; 415 partition_descriptor);
416 isolated_media_request_context_map_[partition_descriptor] = context;
415 } 417 }
416 DCHECK(context); 418 DCHECK(context);
417 return context; 419 return context;
418 } 420 }
419 421
420 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const { 422 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const {
421 DCHECK(extension_info_map_) << "ExtensionSystem not initialized"; 423 DCHECK(extension_info_map_) << "ExtensionSystem not initialized";
422 return extension_info_map_; 424 return extension_info_map_;
423 } 425 }
424 426
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 params->http_pipelining_enabled = globals->http_pipelining_enabled; 719 params->http_pipelining_enabled = globals->http_pipelining_enabled;
718 params->testing_fixed_http_port = globals->testing_fixed_http_port; 720 params->testing_fixed_http_port = globals->testing_fixed_http_port;
719 params->testing_fixed_https_port = globals->testing_fixed_https_port; 721 params->testing_fixed_https_port = globals->testing_fixed_https_port;
720 722
721 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 723 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
722 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { 724 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) {
723 params->trusted_spdy_proxy = command_line.GetSwitchValueASCII( 725 params->trusted_spdy_proxy = command_line.GetSwitchValueASCII(
724 switches::kTrustedSpdyProxy); 726 switches::kTrustedSpdyProxy);
725 } 727 }
726 } 728 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698