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

Side by Side Diff: content/browser/storage_partition_impl_map.cc

Issue 2116503004: Make Foreign Fetch an origin trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 4 years, 4 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 #include "content/browser/storage_partition_impl_map.h" 5 #include "content/browser/storage_partition_impl_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 24 matching lines...) Expand all
35 #include "content/browser/streams/stream_context.h" 35 #include "content/browser/streams/stream_context.h"
36 #include "content/browser/streams/stream_registry.h" 36 #include "content/browser/streams/stream_registry.h"
37 #include "content/browser/streams/stream_url_request_job.h" 37 #include "content/browser/streams/stream_url_request_job.h"
38 #include "content/browser/webui/url_data_manager_backend.h" 38 #include "content/browser/webui/url_data_manager_backend.h"
39 #include "content/public/browser/browser_context.h" 39 #include "content/public/browser/browser_context.h"
40 #include "content/public/browser/browser_thread.h" 40 #include "content/public/browser/browser_thread.h"
41 #include "content/public/browser/content_browser_client.h" 41 #include "content/public/browser/content_browser_client.h"
42 #include "content/public/browser/storage_partition.h" 42 #include "content/public/browser/storage_partition.h"
43 #include "content/public/common/content_constants.h" 43 #include "content/public/common/content_constants.h"
44 #include "content/public/common/content_switches.h" 44 #include "content/public/common/content_switches.h"
45 #include "content/public/common/origin_trial_policy.h"
45 #include "content/public/common/url_constants.h" 46 #include "content/public/common/url_constants.h"
46 #include "crypto/sha2.h" 47 #include "crypto/sha2.h"
47 #include "net/url_request/url_request_context.h" 48 #include "net/url_request/url_request_context.h"
48 #include "net/url_request/url_request_context_getter.h" 49 #include "net/url_request/url_request_context_getter.h"
49 #include "storage/browser/blob/blob_storage_context.h" 50 #include "storage/browser/blob/blob_storage_context.h"
50 #include "storage/browser/blob/blob_url_request_job_factory.h" 51 #include "storage/browser/blob/blob_url_request_job_factory.h"
51 #include "storage/browser/fileapi/file_system_url_request_job_factory.h" 52 #include "storage/browser/fileapi/file_system_url_request_job_factory.h"
52 53
53 using storage::FileSystemContext; 54 using storage::FileSystemContext;
54 using storage::BlobStorageContext; 55 using storage::BlobStorageContext;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 439 }
439 protocol_handlers[kChromeDevToolsScheme] = 440 protocol_handlers[kChromeDevToolsScheme] =
440 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 441 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
441 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(), 442 CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(),
442 browser_context_->IsOffTheRecord())); 443 browser_context_->IsOffTheRecord()));
443 444
444 URLRequestInterceptorScopedVector request_interceptors; 445 URLRequestInterceptorScopedVector request_interceptors;
445 request_interceptors.push_back( 446 request_interceptors.push_back(
446 ServiceWorkerRequestHandler::CreateInterceptor( 447 ServiceWorkerRequestHandler::CreateInterceptor(
447 browser_context_->GetResourceContext()).release()); 448 browser_context_->GetResourceContext()).release());
449 OriginTrialPolicy* origin_trial_policy =
450 GetContentClient()->GetOriginTrialPolicy();
448 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 451 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
449 switches::kEnableExperimentalWebPlatformFeatures)) { 452 switches::kEnableExperimentalWebPlatformFeatures) ||
453 !origin_trial_policy ||
pfeldman 2016/08/12 18:49:23 ditto
454 !origin_trial_policy->IsFeatureDisabled("ForeignFetch")) {
450 request_interceptors.push_back( 455 request_interceptors.push_back(
451 ForeignFetchRequestHandler::CreateInterceptor( 456 ForeignFetchRequestHandler::CreateInterceptor(
452 browser_context_->GetResourceContext()) 457 browser_context_->GetResourceContext())
453 .release()); 458 .release());
454 } 459 }
455 request_interceptors.push_back(new AppCacheInterceptor()); 460 request_interceptors.push_back(new AppCacheInterceptor());
456 461
457 // These calls must happen after StoragePartitionImpl::Create(). 462 // These calls must happen after StoragePartitionImpl::Create().
458 if (partition_domain.empty()) { 463 if (partition_domain.empty()) {
459 partition->SetURLRequestContext( 464 partition->SetURLRequestContext(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 611
607 // We do not call InitializeURLRequestContext() for media contexts because, 612 // We do not call InitializeURLRequestContext() for media contexts because,
608 // other than the HTTP cache, the media contexts share the same backing 613 // other than the HTTP cache, the media contexts share the same backing
609 // objects as their associated "normal" request context. Thus, the previous 614 // objects as their associated "normal" request context. Thus, the previous
610 // call serves to initialize the media request context for this storage 615 // call serves to initialize the media request context for this storage
611 // partition as well. 616 // partition as well.
612 } 617 }
613 } 618 }
614 619
615 } // namespace content 620 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698