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

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

Issue 166793003: Allow FTP requests by Chromium extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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/renderer/extensions/dispatcher.h" 5 #include "chrome/renderer/extensions/dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 UpdatedExtensionPermissionsInfo::Reason reason, 1373 UpdatedExtensionPermissionsInfo::Reason reason,
1374 const Extension* extension, 1374 const Extension* extension,
1375 const URLPatternSet& origins) { 1375 const URLPatternSet& origins) {
1376 for (URLPatternSet::const_iterator i = origins.begin(); 1376 for (URLPatternSet::const_iterator i = origins.begin();
1377 i != origins.end(); ++i) { 1377 i != origins.end(); ++i) {
1378 const char* schemes[] = { 1378 const char* schemes[] = {
1379 content::kHttpScheme, 1379 content::kHttpScheme,
1380 content::kHttpsScheme, 1380 content::kHttpsScheme,
1381 content::kFileScheme, 1381 content::kFileScheme,
1382 content::kChromeUIScheme, 1382 content::kChromeUIScheme,
1383 content::kFtpScheme,
1383 }; 1384 };
1384 for (size_t j = 0; j < arraysize(schemes); ++j) { 1385 for (size_t j = 0; j < arraysize(schemes); ++j) {
1385 if (i->MatchesScheme(schemes[j])) { 1386 if (i->MatchesScheme(schemes[j])) {
1386 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ? 1387 ((reason == UpdatedExtensionPermissionsInfo::REMOVED) ?
1387 WebSecurityPolicy::removeOriginAccessWhitelistEntry : 1388 WebSecurityPolicy::removeOriginAccessWhitelistEntry :
1388 WebSecurityPolicy::addOriginAccessWhitelistEntry)( 1389 WebSecurityPolicy::addOriginAccessWhitelistEntry)(
1389 extension->url(), 1390 extension->url(),
1390 WebString::fromUTF8(schemes[j]), 1391 WebString::fromUTF8(schemes[j]),
1391 WebString::fromUTF8(i->host()), 1392 WebString::fromUTF8(i->host()),
1392 i->match_subdomains()); 1393 i->match_subdomains());
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 } 1689 }
1689 1690
1690 void Dispatcher::ClearPortData(int port_id) { 1691 void Dispatcher::ClearPortData(int port_id) {
1691 // Only the target port side has entries in |port_to_tab_id_map_|. If 1692 // Only the target port side has entries in |port_to_tab_id_map_|. If
1692 // |port_id| is a source port, std::map::erase() will just silently fail 1693 // |port_id| is a source port, std::map::erase() will just silently fail
1693 // here as a no-op. 1694 // here as a no-op.
1694 port_to_tab_id_map_.erase(port_id); 1695 port_to_tab_id_map_.erase(port_id);
1695 } 1696 }
1696 1697
1697 } // namespace extensions 1698 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698