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

Side by Side Diff: extensions/common/extension_messages.h

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: Add URLPattern effective TLD whitelisting, Switched IPC to UpdatePermissions, Removed shared memor… Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // IPC messages for extensions. 5 // IPC messages for extensions.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 ExtensionMsg_PermissionSetStruct( 265 ExtensionMsg_PermissionSetStruct(
266 const ExtensionMsg_PermissionSetStruct& other); 266 const ExtensionMsg_PermissionSetStruct& other);
267 ~ExtensionMsg_PermissionSetStruct(); 267 ~ExtensionMsg_PermissionSetStruct();
268 268
269 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const; 269 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const;
270 270
271 extensions::APIPermissionSet apis; 271 extensions::APIPermissionSet apis;
272 extensions::ManifestPermissionSet manifest_permissions; 272 extensions::ManifestPermissionSet manifest_permissions;
273 extensions::URLPatternSet explicit_hosts; 273 extensions::URLPatternSet explicit_hosts;
274 extensions::URLPatternSet scriptable_hosts; 274 extensions::URLPatternSet scriptable_hosts;
275 extensions::URLPatternSet runtime_blocked_hosts;
276 extensions::URLPatternSet runtime_allowed_hosts;
277 bool uses_default_policy_host_restrictions;
275 }; 278 };
276 279
277 struct ExtensionMsg_Loaded_Params { 280 struct ExtensionMsg_Loaded_Params {
278 ExtensionMsg_Loaded_Params(); 281 ExtensionMsg_Loaded_Params();
279 ~ExtensionMsg_Loaded_Params(); 282 ~ExtensionMsg_Loaded_Params();
280 ExtensionMsg_Loaded_Params(const extensions::Extension* extension, 283 ExtensionMsg_Loaded_Params(const extensions::Extension* extension,
281 bool include_tab_permissions); 284 bool include_tab_permissions);
282 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other); 285 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other);
283 286
284 // Creates a new extension from the data in this object. 287 // Creates a new extension from the data in this object.
285 scoped_refptr<extensions::Extension> ConvertToExtension( 288 scoped_refptr<extensions::Extension> ConvertToExtension(
286 std::string* error) const; 289 std::string* error) const;
287 290
288 // The subset of the extension manifest data we send to renderers. 291 // The subset of the extension manifest data we send to renderers.
289 linked_ptr<base::DictionaryValue> manifest; 292 linked_ptr<base::DictionaryValue> manifest;
290 293
291 // The location the extension was installed from. 294 // The location the extension was installed from.
292 extensions::Manifest::Location location; 295 extensions::Manifest::Location location;
293 296
294 // The path the extension was loaded from. This is used in the renderer only 297 // The path the extension was loaded from. This is used in the renderer only
295 // to generate the extension ID for extensions that are loaded unpacked. 298 // to generate the extension ID for extensions that are loaded unpacked.
296 base::FilePath path; 299 base::FilePath path;
297 300
298 // The extension's active and withheld permissions. 301 // The extension's active and withheld permissions.
299 ExtensionMsg_PermissionSetStruct active_permissions; 302 ExtensionMsg_PermissionSetStruct active_permissions;
300 ExtensionMsg_PermissionSetStruct withheld_permissions; 303 ExtensionMsg_PermissionSetStruct withheld_permissions;
301 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions; 304 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions;
302 305
306 // Contians URLPatternSets defining which URLs an extension may not interact
307 // with by policy. This is mapped to shared memory to deal with large lists.
308 extensions::URLPatternSet runtime_blocked_hosts;
309 extensions::URLPatternSet runtime_allowed_hosts;
310
311 // If the extension uses the default list of blocked / allowed URLs. If false,
312 // then the 'hosts' struct in this struct must be populated with a valid
313 // shared memory handle.
Devlin 2017/01/26 22:47:40 outdated?
nrpeter 2017/02/03 19:32:24 Done.
314 bool is_default_runtime_blocked_allowed_hosts;
315
303 // We keep this separate so that it can be used in logging. 316 // We keep this separate so that it can be used in logging.
304 std::string id; 317 std::string id;
305 318
306 // Send creation flags so extension is initialized identically. 319 // Send creation flags so extension is initialized identically.
307 int creation_flags; 320 int creation_flags;
308 }; 321 };
309 322
310 struct ExtensionHostMsg_AutomationQuerySelector_Error { 323 struct ExtensionHostMsg_AutomationQuerySelector_Error {
311 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed }; 324 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed };
312 325
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 427
415 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error) 428 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error)
416 IPC_STRUCT_TRAITS_MEMBER(value) 429 IPC_STRUCT_TRAITS_MEMBER(value)
417 IPC_STRUCT_TRAITS_END() 430 IPC_STRUCT_TRAITS_END()
418 431
419 // Parameters structure for ExtensionMsg_UpdatePermissions. 432 // Parameters structure for ExtensionMsg_UpdatePermissions.
420 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params) 433 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params)
421 IPC_STRUCT_MEMBER(std::string, extension_id) 434 IPC_STRUCT_MEMBER(std::string, extension_id)
422 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions) 435 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions)
423 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions) 436 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions)
437 IPC_STRUCT_MEMBER(extensions::URLPatternSet, runtime_blocked_hosts)
438 IPC_STRUCT_MEMBER(extensions::URLPatternSet, runtime_allowed_hosts)
439 IPC_STRUCT_MEMBER(bool, uses_default_policy_host_restrictions)
440 IPC_STRUCT_END()
441
442 // Parameters structure for ExtensionMsg_UpdateDefaultPolicyHostRestrictions.
443 IPC_STRUCT_BEGIN(ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
444 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_runtime_blocked_hosts)
445 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_runtime_allowed_hosts)
424 IPC_STRUCT_END() 446 IPC_STRUCT_END()
425 447
426 // Messages sent from the browser to the renderer: 448 // Messages sent from the browser to the renderer:
427 449
428 // The browser sends this message in response to all extension api calls. The 450 // The browser sends this message in response to all extension api calls. The
429 // response data (if any) is one of the base::Value subclasses, wrapped as the 451 // response data (if any) is one of the base::Value subclasses, wrapped as the
430 // first element in a ListValue. 452 // first element in a ListValue.
431 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response, 453 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response,
432 int /* request_id */, 454 int /* request_id */,
433 bool /* success */, 455 bool /* success */,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 int /* id of browser window */) 536 int /* id of browser window */)
515 537
516 // Tell the render view what its tab ID is. 538 // Tell the render view what its tab ID is.
517 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, 539 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId,
518 int /* id of tab */) 540 int /* id of tab */)
519 541
520 // Tell the renderer to update an extension's permission set. 542 // Tell the renderer to update an extension's permission set.
521 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions, 543 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions,
522 ExtensionMsg_UpdatePermissions_Params) 544 ExtensionMsg_UpdatePermissions_Params)
523 545
546 // Tell the renderer to update an extension's runtime_blocked_hosts set.
547 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateDefaultPolicyHostRestrictions,
548 ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
549
524 // Tell the render view about new tab-specific permissions for an extension. 550 // Tell the render view about new tab-specific permissions for an extension.
525 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions, 551 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions,
526 GURL /* url */, 552 GURL /* url */,
527 std::string /* extension_id */, 553 std::string /* extension_id */,
528 extensions::URLPatternSet /* hosts */, 554 extensions::URLPatternSet /* hosts */,
529 bool /* update origin whitelist */, 555 bool /* update origin whitelist */,
530 int /* tab_id */) 556 int /* tab_id */)
531 557
532 // Tell the render view to clear tab-specific permissions for some extensions. 558 // Tell the render view to clear tab-specific permissions for some extensions.
533 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions, 559 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions,
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 int64_t /* service_worker_version_id */, 920 int64_t /* service_worker_version_id */,
895 std::string /* request_uuid */) 921 std::string /* request_uuid */)
896 922
897 // Asks the browser to decrement the pending activity count for 923 // Asks the browser to decrement the pending activity count for
898 // the worker with version id |service_worker_version_id|. 924 // the worker with version id |service_worker_version_id|.
899 // |request_uuid| must match the GUID of a previous request, otherwise the 925 // |request_uuid| must match the GUID of a previous request, otherwise the
900 // browser process ignores the IPC. 926 // browser process ignores the IPC.
901 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity, 927 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity,
902 int64_t /* service_worker_version_id */, 928 int64_t /* service_worker_version_id */,
903 std::string /* request_uuid */) 929 std::string /* request_uuid */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698