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

Side by Side Diff: chrome/browser/pepper_permission_util.cc

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/pepper_permission_util.h" 5 #include "chrome/browser/pepper_permission_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/sha1.h" 10 #include "base/sha1.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 const std::string host = url.host(); 49 const std::string host = url.host();
50 if (url.SchemeIs(extensions::kExtensionScheme) && 50 if (url.SchemeIs(extensions::kExtensionScheme) &&
51 HostIsInSet(host, whitelist)) { 51 HostIsInSet(host, whitelist)) {
52 return true; 52 return true;
53 } 53 }
54 54
55 const Extension* extension = NULL; 55 const Extension* extension = NULL;
56 ExtensionService* extension_service = !profile ? NULL : 56 ExtensionService* extension_service = !profile ? NULL :
57 extensions::ExtensionSystem::Get(profile)->extension_service(); 57 extensions::ExtensionSystem::Get(profile)->extension_service();
58 if (extension_service) { 58 if (extension_service) {
59 extension = extension_service->extensions()-> 59 extension = extension_service->extensions()->GetExtensionOrAppByURL(url);
60 GetExtensionOrAppByURL(ExtensionURLInfo(url));
61 } 60 }
62 61
63 // Check the modules that are imported by this extension to see if any of them 62 // Check the modules that are imported by this extension to see if any of them
64 // is whitelisted. 63 // is whitelisted.
65 if (extension) { 64 if (extension) {
66 typedef std::vector<extensions::SharedModuleInfo::ImportInfo> 65 typedef std::vector<extensions::SharedModuleInfo::ImportInfo>
67 ImportInfoVector; 66 ImportInfoVector;
68 const ImportInfoVector& imports = 67 const ImportInfoVector& imports =
69 extensions::SharedModuleInfo::GetImports(extension); 68 extensions::SharedModuleInfo::GetImports(extension);
70 for (ImportInfoVector::const_iterator it = imports.begin(); 69 for (ImportInfoVector::const_iterator it = imports.begin();
(...skipping 23 matching lines...) Expand all
94 while (t.GetNext()) { 93 while (t.GetNext()) {
95 if (t.token() == host) 94 if (t.token() == host)
96 return true; 95 return true;
97 } 96 }
98 } 97 }
99 98
100 return false; 99 return false;
101 } 100 }
102 101
103 } // namespace chrome 102 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698