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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api.cc

Issue 14358004: Almost all actions in Declarative Web Request require all_urls host permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: All URLs -> all hosts; also rebased Created 7 years, 8 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 (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/browser/extensions/api/web_request/web_request_api.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 if (it->filter.tab_id != -1 && tab_id != it->filter.tab_id) 1281 if (it->filter.tab_id != -1 && tab_id != it->filter.tab_id)
1282 continue; 1282 continue;
1283 if (it->filter.window_id != -1 && window_id != it->filter.window_id) 1283 if (it->filter.window_id != -1 && window_id != it->filter.window_id)
1284 continue; 1284 continue;
1285 if (!it->filter.types.empty() && 1285 if (!it->filter.types.empty() &&
1286 std::find(it->filter.types.begin(), it->filter.types.end(), 1286 std::find(it->filter.types.begin(), it->filter.types.end(),
1287 resource_type) == it->filter.types.end()) 1287 resource_type) == it->filter.types.end())
1288 continue; 1288 continue;
1289 1289
1290 if (!WebRequestPermissions::CanExtensionAccessURL( 1290 if (!WebRequestPermissions::CanExtensionAccessURL(
1291 extension_info_map, it->extension_id, url, crosses_incognito, true)) 1291 extension_info_map, it->extension_id, url, crosses_incognito,
1292 WebRequestPermissions::REQUIRE_HOST_PERMISSION))
1292 continue; 1293 continue;
1293 1294
1294 bool blocking_listener = 1295 bool blocking_listener =
1295 (it->extra_info_spec & 1296 (it->extra_info_spec &
1296 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) != 0; 1297 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) != 0;
1297 1298
1298 // We do not want to notify extensions about XHR requests that are 1299 // We do not want to notify extensions about XHR requests that are
1299 // triggered by themselves. This is a workaround to prevent deadlocks 1300 // triggered by themselves. This is a workaround to prevent deadlocks
1300 // in case of synchronous XHR requests that block the extension renderer 1301 // in case of synchronous XHR requests that block the extension renderer
1301 // and therefore prevent the extension from processing the request 1302 // and therefore prevent the extension from processing the request
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 } else if ((*it)->name().find("AdBlock") != std::string::npos) { 2179 } else if ((*it)->name().find("AdBlock") != std::string::npos) {
2179 adblock = true; 2180 adblock = true;
2180 } else { 2181 } else {
2181 other = true; 2182 other = true;
2182 } 2183 }
2183 } 2184 }
2184 } 2185 }
2185 2186
2186 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); 2187 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other));
2187 } 2188 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698