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

Side by Side Diff: Source/core/loader/MixedContentChecker.cpp

Issue 1248313002: Add a setting to strictly block "blockable" mixed content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: yoav Created 5 years, 5 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 | « Source/core/frame/Settings.in ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 contextType = ContextTypeOptionallyBlockable; 316 contextType = ContextTypeOptionallyBlockable;
317 317
318 switch (contextType) { 318 switch (contextType) {
319 case ContextTypeOptionallyBlockable: 319 case ContextTypeOptionallyBlockable:
320 allowed = !strictMode && client->allowDisplayingInsecureContent(settings && settings->allowDisplayOfInsecureContent(), securityOrigin, url); 320 allowed = !strictMode && client->allowDisplayingInsecureContent(settings && settings->allowDisplayOfInsecureContent(), securityOrigin, url);
321 if (allowed) 321 if (allowed)
322 client->didDisplayInsecureContent(); 322 client->didDisplayInsecureContent();
323 break; 323 break;
324 324
325 case ContextTypeBlockable: 325 case ContextTypeBlockable:
326 allowed = !strictMode && client->allowRunningInsecureContent(settings && settings->allowRunningOfInsecureContent(), securityOrigin, url); 326 allowed = !strictMode && !settings->strictlyBlockBlockableMixedContent() && client->allowRunningInsecureContent(settings && settings->allowRunningOfInse cureContent(), securityOrigin, url);
327 if (allowed) { 327 if (allowed) {
328 client->didRunInsecureContent(securityOrigin, url); 328 client->didRunInsecureContent(securityOrigin, url);
329 UseCounter::count(mixedFrame, UseCounter::MixedContentBlockableAllow ed); 329 UseCounter::count(mixedFrame, UseCounter::MixedContentBlockableAllow ed);
330 } 330 }
331 break; 331 break;
332 332
333 case ContextTypeShouldBeBlockable: 333 case ContextTypeShouldBeBlockable:
334 allowed = !strictMode; 334 allowed = !strictMode;
335 if (allowed) 335 if (allowed)
336 client->didDisplayInsecureContent(); 336 client->didDisplayInsecureContent();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 { 414 {
415 if (!frame || !frame->document() || !frame->document()->loader()) 415 if (!frame || !frame->document() || !frame->document()->loader())
416 return; 416 return;
417 417
418 // Just count these for the moment, don't block them. 418 // Just count these for the moment, don't block them.
419 if (Platform::current()->isReservedIPAddress(resourceIPAddress) && !frame->d ocument()->isHostedInReservedIPRange()) 419 if (Platform::current()->isReservedIPAddress(resourceIPAddress) && !frame->d ocument()->isHostedInReservedIPRange())
420 UseCounter::count(frame->document(), UseCounter::MixedContentPrivateHost nameInPublicHostname); 420 UseCounter::count(frame->document(), UseCounter::MixedContentPrivateHost nameInPublicHostname);
421 } 421 }
422 422
423 } // namespace blink 423 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/Settings.in ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698