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

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 2737673002: [WIP] Synthetic repro for bug 693720
Patch Set: Extensions thing. Created 3 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
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/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 23 matching lines...) Expand all
34 #include "chrome/common/url_constants.h" 34 #include "chrome/common/url_constants.h"
35 #include "chrome/grit/common_resources.h" 35 #include "chrome/grit/common_resources.h"
36 #include "components/dom_distiller/core/url_constants.h" 36 #include "components/dom_distiller/core/url_constants.h"
37 #include "components/version_info/version_info.h" 37 #include "components/version_info/version_info.h"
38 #include "content/public/common/cdm_info.h" 38 #include "content/public/common/cdm_info.h"
39 #include "content/public/common/content_constants.h" 39 #include "content/public/common/content_constants.h"
40 #include "content/public/common/content_switches.h" 40 #include "content/public/common/content_switches.h"
41 #include "content/public/common/url_constants.h" 41 #include "content/public/common/url_constants.h"
42 #include "content/public/common/user_agent.h" 42 #include "content/public/common/user_agent.h"
43 #include "extensions/common/constants.h" 43 #include "extensions/common/constants.h"
44 #include "extensions/common/switches.h"
44 #include "extensions/features/features.h" 45 #include "extensions/features/features.h"
45 #include "gpu/config/gpu_info.h" 46 #include "gpu/config/gpu_info.h"
46 #include "media/media_features.h" 47 #include "media/media_features.h"
47 #include "net/http/http_util.h" 48 #include "net/http/http_util.h"
48 #include "pdf/features.h" 49 #include "pdf/features.h"
49 #include "ppapi/features/features.h" 50 #include "ppapi/features/features.h"
50 #include "ui/base/l10n/l10n_util.h" 51 #include "ui/base/l10n/l10n_util.h"
51 #include "ui/base/layout.h" 52 #include "ui/base/layout.h"
52 #include "ui/base/resource/resource_bundle.h" 53 #include "ui/base/resource/resource_bundle.h"
53 #include "url/url_constants.h" 54 #include "url/url_constants.h"
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 #if BUILDFLAG(ENABLE_EXTENSIONS) 613 #if BUILDFLAG(ENABLE_EXTENSIONS)
613 if (extensions::feature_util::ExtensionServiceWorkersEnabled()) 614 if (extensions::feature_util::ExtensionServiceWorkersEnabled())
614 schemes->service_worker_schemes.push_back(extensions::kExtensionScheme); 615 schemes->service_worker_schemes.push_back(extensions::kExtensionScheme);
615 616
616 // As far as Blink is concerned, they should be allowed to receive CORS 617 // As far as Blink is concerned, they should be allowed to receive CORS
617 // requests. At the Extensions layer, requests will actually be blocked unless 618 // requests. At the Extensions layer, requests will actually be blocked unless
618 // overridden by the web_accessible_resources manifest key. 619 // overridden by the web_accessible_resources manifest key.
619 // TODO(kalman): See what happens with a service worker. 620 // TODO(kalman): See what happens with a service worker.
620 schemes->cors_enabled_schemes.push_back(extensions::kExtensionScheme); 621 schemes->cors_enabled_schemes.push_back(extensions::kExtensionScheme);
621 622
622 schemes->csp_bypassing_schemes.push_back(extensions::kExtensionScheme); 623 // Outside of extension processes, Content Security Policy cannot be used to
624 // block the chrome-extension:// scheme. This is to prevent a page from using
625 // CSP to block user scripts. Within app/extension processes, this bypass is
626 // not necessary. And within isolated app processes, we rely on a restrictive
627 // CSP to ensure isolation of the StoragePartition, so it's important that
628 // other extensions be blocked.
629 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
630 extensions::switches::kExtensionProcess)) {
631 schemes->csp_bypassing_schemes.push_back(extensions::kExtensionScheme);
632 }
623 #endif 633 #endif
624 634
625 #if defined(OS_CHROMEOS) 635 #if defined(OS_CHROMEOS)
626 schemes->local_schemes.push_back(content::kExternalFileScheme); 636 schemes->local_schemes.push_back(content::kExternalFileScheme);
627 #endif 637 #endif
628 638
629 #if defined(OS_ANDROID) 639 #if defined(OS_ANDROID)
630 schemes->local_schemes.push_back(url::kContentScheme); 640 schemes->local_schemes.push_back(url::kContentScheme);
631 #endif 641 #endif
632 } 642 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 if (!origin_trial_policy_) 719 if (!origin_trial_policy_)
710 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); 720 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>();
711 return origin_trial_policy_.get(); 721 return origin_trial_policy_.get();
712 } 722 }
713 723
714 #if defined(OS_ANDROID) 724 #if defined(OS_ANDROID)
715 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { 725 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() {
716 return new ChromeMediaClientAndroid(); 726 return new ChromeMediaClientAndroid();
717 } 727 }
718 #endif // OS_ANDROID 728 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « chrome/browser/apps/app_browsertest.cc ('k') | chrome/test/data/extensions/platform_apps/iframes/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698