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

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

Issue 1583813003: Remove obsolete histogram values from SSL.InsecureContent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change deprecated histograms labels Created 4 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 /* 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // If we're dealing with a CORS-enabled scheme, then block mixed frames as a ctive content. Otherwise, 319 // If we're dealing with a CORS-enabled scheme, then block mixed frames as a ctive content. Otherwise,
320 // treat frames as passive content. 320 // treat frames as passive content.
321 // 321 //
322 // FIXME: Remove this temporary hack once we have a reasonable API for launc hing external applications 322 // FIXME: Remove this temporary hack once we have a reasonable API for launc hing external applications
323 // via URLs. http://crbug.com/318788 and https://crbug.com/393481 323 // via URLs. http://crbug.com/318788 and https://crbug.com/393481
324 if (frameType == WebURLRequest::FrameTypeNested && !SchemeRegistry::shouldTr eatURLSchemeAsCORSEnabled(url.protocol())) 324 if (frameType == WebURLRequest::FrameTypeNested && !SchemeRegistry::shouldTr eatURLSchemeAsCORSEnabled(url.protocol()))
325 contextType = ContextTypeOptionallyBlockable; 325 contextType = ContextTypeOptionallyBlockable;
326 326
327 switch (contextType) { 327 switch (contextType) {
328 case ContextTypeOptionallyBlockable: 328 case ContextTypeOptionallyBlockable:
329 allowed = !strictMode && client->allowDisplayingInsecureContent(settings && settings->allowDisplayOfInsecureContent(), securityOrigin, url); 329 allowed = !strictMode && client->allowDisplayingInsecureContent(settings && settings->allowDisplayOfInsecureContent(), url);
330 if (allowed) 330 if (allowed)
331 client->didDisplayInsecureContent(); 331 client->didDisplayInsecureContent();
332 break; 332 break;
333 333
334 case ContextTypeBlockable: { 334 case ContextTypeBlockable: {
335 // Strictly block subresources in subframes, unless all insecure 335 // Strictly block subresources in subframes, unless all insecure
336 // content is allowed. 336 // content is allowed.
337 if (!settings->allowRunningOfInsecureContent() && requestIsSubframeSubre source(frame, frameType)) { 337 if (!settings->allowRunningOfInsecureContent() && requestIsSubframeSubre source(frame, frameType)) {
338 UseCounter::count(mixedFrame, UseCounter::BlockableMixedContentInSub frameBlocked); 338 UseCounter::count(mixedFrame, UseCounter::BlockableMixedContentInSub frameBlocked);
339 allowed = false; 339 allowed = false;
340 break; 340 break;
341 } 341 }
342 342
343 bool shouldAskEmbedder = !strictMode && settings && (!settings->strictly BlockBlockableMixedContent() || settings->allowRunningOfInsecureContent()); 343 bool shouldAskEmbedder = !strictMode && settings && (!settings->strictly BlockBlockableMixedContent() || settings->allowRunningOfInsecureContent());
344 allowed = shouldAskEmbedder && client->allowRunningInsecureContent(setti ngs && settings->allowRunningOfInsecureContent(), securityOrigin, url); 344 allowed = shouldAskEmbedder && client->allowRunningInsecureContent(setti ngs && settings->allowRunningOfInsecureContent(), securityOrigin, url);
Mike West 2016/01/15 08:29:31 What about the |securityOrigin| here? I thought th
estark 2016/01/15 18:42:32 Unfortunately, this gets passed into DidBlockConte
345 if (allowed) { 345 if (allowed) {
346 client->didRunInsecureContent(securityOrigin, url); 346 client->didRunInsecureContent(securityOrigin, url);
Mike West 2016/01/15 08:29:30 Ditto.
347 UseCounter::count(mixedFrame, UseCounter::MixedContentBlockableAllow ed); 347 UseCounter::count(mixedFrame, UseCounter::MixedContentBlockableAllow ed);
348 } 348 }
349 break; 349 break;
350 } 350 }
351 351
352 case ContextTypeShouldBeBlockable: 352 case ContextTypeShouldBeBlockable:
353 allowed = !strictMode; 353 allowed = !strictMode;
354 if (allowed) 354 if (allowed)
355 client->didDisplayInsecureContent(); 355 client->didDisplayInsecureContent();
356 break; 356 break;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 // See comment in shouldBlockFetch() about loading the main resource of a su bframe. 489 // See comment in shouldBlockFetch() about loading the main resource of a su bframe.
490 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { 490 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) {
491 return ContextTypeOptionallyBlockable; 491 return ContextTypeOptionallyBlockable;
492 } 492 }
493 493
494 return contextTypeFromContext(request.requestContext(), mixedFrame); 494 return contextTypeFromContext(request.requestContext(), mixedFrame);
495 } 495 }
496 496
497 } // namespace blink 497 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698