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

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

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: nits Created 3 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
« no previous file with comments | « extensions/common/extension.h ('k') | extensions/common/extension_messages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 ExtensionMsg_PermissionSetStruct( 286 ExtensionMsg_PermissionSetStruct(
287 const ExtensionMsg_PermissionSetStruct& other); 287 const ExtensionMsg_PermissionSetStruct& other);
288 ~ExtensionMsg_PermissionSetStruct(); 288 ~ExtensionMsg_PermissionSetStruct();
289 289
290 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const; 290 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const;
291 291
292 extensions::APIPermissionSet apis; 292 extensions::APIPermissionSet apis;
293 extensions::ManifestPermissionSet manifest_permissions; 293 extensions::ManifestPermissionSet manifest_permissions;
294 extensions::URLPatternSet explicit_hosts; 294 extensions::URLPatternSet explicit_hosts;
295 extensions::URLPatternSet scriptable_hosts; 295 extensions::URLPatternSet scriptable_hosts;
296 extensions::URLPatternSet policy_blocked_hosts;
297 extensions::URLPatternSet policy_allowed_hosts;
298 bool uses_default_policy_host_restrictions;
vabr (Chromium) 2017/04/18 14:17:48 Do the POD fields like uses_default_policy_host_re
nrpeter 2017/04/18 15:30:39 I think msan is complaining about the policy_block
296 }; 299 };
297 300
298 struct ExtensionMsg_Loaded_Params { 301 struct ExtensionMsg_Loaded_Params {
299 ExtensionMsg_Loaded_Params(); 302 ExtensionMsg_Loaded_Params();
300 ~ExtensionMsg_Loaded_Params(); 303 ~ExtensionMsg_Loaded_Params();
301 ExtensionMsg_Loaded_Params(const extensions::Extension* extension, 304 ExtensionMsg_Loaded_Params(const extensions::Extension* extension,
302 bool include_tab_permissions); 305 bool include_tab_permissions);
303 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other); 306 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other);
304 307
305 // Creates a new extension from the data in this object. 308 // Creates a new extension from the data in this object.
306 scoped_refptr<extensions::Extension> ConvertToExtension( 309 scoped_refptr<extensions::Extension> ConvertToExtension(
307 std::string* error) const; 310 std::string* error) const;
308 311
309 // The subset of the extension manifest data we send to renderers. 312 // The subset of the extension manifest data we send to renderers.
310 linked_ptr<base::DictionaryValue> manifest; 313 linked_ptr<base::DictionaryValue> manifest;
311 314
312 // The location the extension was installed from. 315 // The location the extension was installed from.
313 extensions::Manifest::Location location; 316 extensions::Manifest::Location location;
314 317
315 // The path the extension was loaded from. This is used in the renderer only 318 // The path the extension was loaded from. This is used in the renderer only
316 // to generate the extension ID for extensions that are loaded unpacked. 319 // to generate the extension ID for extensions that are loaded unpacked.
317 base::FilePath path; 320 base::FilePath path;
318 321
319 // The extension's active and withheld permissions. 322 // The extension's active and withheld permissions.
320 ExtensionMsg_PermissionSetStruct active_permissions; 323 ExtensionMsg_PermissionSetStruct active_permissions;
321 ExtensionMsg_PermissionSetStruct withheld_permissions; 324 ExtensionMsg_PermissionSetStruct withheld_permissions;
322 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions; 325 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions;
323 326
327 // Contains URLPatternSets defining which URLs an extension may not interact
328 // with by policy.
329 extensions::URLPatternSet policy_blocked_hosts;
330 extensions::URLPatternSet policy_allowed_hosts;
331
332 // If the extension uses the default list of blocked / allowed URLs.
333 bool uses_default_policy_blocked_allowed_hosts;
334
324 // We keep this separate so that it can be used in logging. 335 // We keep this separate so that it can be used in logging.
325 std::string id; 336 std::string id;
326 337
327 // Send creation flags so extension is initialized identically. 338 // Send creation flags so extension is initialized identically.
328 int creation_flags; 339 int creation_flags;
329 }; 340 };
330 341
331 struct ExtensionHostMsg_AutomationQuerySelector_Error { 342 struct ExtensionHostMsg_AutomationQuerySelector_Error {
332 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed }; 343 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed };
333 344
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 446
436 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error) 447 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error)
437 IPC_STRUCT_TRAITS_MEMBER(value) 448 IPC_STRUCT_TRAITS_MEMBER(value)
438 IPC_STRUCT_TRAITS_END() 449 IPC_STRUCT_TRAITS_END()
439 450
440 // Parameters structure for ExtensionMsg_UpdatePermissions. 451 // Parameters structure for ExtensionMsg_UpdatePermissions.
441 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params) 452 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params)
442 IPC_STRUCT_MEMBER(std::string, extension_id) 453 IPC_STRUCT_MEMBER(std::string, extension_id)
443 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions) 454 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions)
444 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions) 455 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions)
456 IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_blocked_hosts)
457 IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_allowed_hosts)
458 IPC_STRUCT_MEMBER(bool, uses_default_policy_host_restrictions)
459 IPC_STRUCT_END()
460
461 // Parameters structure for ExtensionMsg_UpdateDefaultPolicyHostRestrictions.
462 IPC_STRUCT_BEGIN(ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
463 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_blocked_hosts)
464 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_allowed_hosts)
445 IPC_STRUCT_END() 465 IPC_STRUCT_END()
446 466
447 // Messages sent from the browser to the renderer: 467 // Messages sent from the browser to the renderer:
448 468
449 // The browser sends this message in response to all extension api calls. The 469 // The browser sends this message in response to all extension api calls. The
450 // response data (if any) is one of the base::Value subclasses, wrapped as the 470 // response data (if any) is one of the base::Value subclasses, wrapped as the
451 // first element in a ListValue. 471 // first element in a ListValue.
452 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response, 472 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response,
453 int /* request_id */, 473 int /* request_id */,
454 bool /* success */, 474 bool /* success */,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 int /* id of browser window */) 561 int /* id of browser window */)
542 562
543 // Tell the render view what its tab ID is. 563 // Tell the render view what its tab ID is.
544 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, 564 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId,
545 int /* id of tab */) 565 int /* id of tab */)
546 566
547 // Tell the renderer to update an extension's permission set. 567 // Tell the renderer to update an extension's permission set.
548 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions, 568 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions,
549 ExtensionMsg_UpdatePermissions_Params) 569 ExtensionMsg_UpdatePermissions_Params)
550 570
571 // Tell the renderer to update an extension's policy_blocked_hosts set.
572 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateDefaultPolicyHostRestrictions,
573 ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
574
551 // Tell the render view about new tab-specific permissions for an extension. 575 // Tell the render view about new tab-specific permissions for an extension.
552 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions, 576 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions,
553 GURL /* url */, 577 GURL /* url */,
554 std::string /* extension_id */, 578 std::string /* extension_id */,
555 extensions::URLPatternSet /* hosts */, 579 extensions::URLPatternSet /* hosts */,
556 bool /* update origin whitelist */, 580 bool /* update origin whitelist */,
557 int /* tab_id */) 581 int /* tab_id */)
558 582
559 // Tell the render view to clear tab-specific permissions for some extensions. 583 // Tell the render view to clear tab-specific permissions for some extensions.
560 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions, 584 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 int64_t /* service_worker_version_id */, 938 int64_t /* service_worker_version_id */,
915 std::string /* request_uuid */) 939 std::string /* request_uuid */)
916 940
917 // Asks the browser to decrement the pending activity count for 941 // Asks the browser to decrement the pending activity count for
918 // the worker with version id |service_worker_version_id|. 942 // the worker with version id |service_worker_version_id|.
919 // |request_uuid| must match the GUID of a previous request, otherwise the 943 // |request_uuid| must match the GUID of a previous request, otherwise the
920 // browser process ignores the IPC. 944 // browser process ignores the IPC.
921 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity, 945 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity,
922 int64_t /* service_worker_version_id */, 946 int64_t /* service_worker_version_id */,
923 std::string /* request_uuid */) 947 std::string /* request_uuid */)
OLDNEW
« no previous file with comments | « extensions/common/extension.h ('k') | extensions/common/extension_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698