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

Side by Side Diff: chrome/renderer/extensions/resource_request_policy.cc

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback Created 7 years, 5 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
« no previous file with comments | « chrome/renderer/extensions/request_sender.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/extensions/resource_request_policy.h" 5 #include "chrome/renderer/extensions/resource_request_policy.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 21 matching lines...) Expand all
32 32
33 // static 33 // static
34 bool ResourceRequestPolicy::CanRequestResource( 34 bool ResourceRequestPolicy::CanRequestResource(
35 const GURL& resource_url, 35 const GURL& resource_url,
36 WebKit::WebFrame* frame, 36 WebKit::WebFrame* frame,
37 content::PageTransition transition_type, 37 content::PageTransition transition_type,
38 const ExtensionSet* loaded_extensions) { 38 const ExtensionSet* loaded_extensions) {
39 CHECK(resource_url.SchemeIs(extensions::kExtensionScheme)); 39 CHECK(resource_url.SchemeIs(extensions::kExtensionScheme));
40 40
41 const Extension* extension = 41 const Extension* extension =
42 loaded_extensions->GetExtensionOrAppByURL(ExtensionURLInfo(resource_url)); 42 loaded_extensions->GetExtensionOrAppByURL(resource_url);
43 if (!extension) { 43 if (!extension) {
44 // Allow the load in the case of a non-existent extension. We'll just get a 44 // Allow the load in the case of a non-existent extension. We'll just get a
45 // 404 from the browser process. 45 // 404 from the browser process.
46 return true; 46 return true;
47 } 47 }
48 48
49 // Disallow loading of packaged resources for hosted apps. We don't allow 49 // Disallow loading of packaged resources for hosted apps. We don't allow
50 // hybrid hosted/packaged apps. The one exception is access to icons, since 50 // hybrid hosted/packaged apps. The one exception is access to icons, since
51 // some extensions want to be able to do things like create their own 51 // some extensions want to be able to do things like create their own
52 // launchers. 52 // launchers.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return false; 123 return false;
124 } 124 }
125 125
126 return true; 126 return true;
127 } 127 }
128 128
129 ResourceRequestPolicy::ResourceRequestPolicy() { 129 ResourceRequestPolicy::ResourceRequestPolicy() {
130 } 130 }
131 131
132 } // namespace extensions 132 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/request_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698