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

Side by Side Diff: third_party/WebKit/Source/core/testing/InternalSettings.cpp

Issue 2881073003: Support DataSaver for SharedWorker (Closed)
Patch Set: fix #include "public/web/WebDataSaverFlag.h" Created 3 years, 7 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 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } else if (policy_str == "user-gesture-required-for-cross-origin") { 546 } else if (policy_str == "user-gesture-required-for-cross-origin") {
547 policy = AutoplayPolicy::Type::kUserGestureRequiredForCrossOrigin; 547 policy = AutoplayPolicy::Type::kUserGestureRequiredForCrossOrigin;
548 } else { 548 } else {
549 exception_state.ThrowDOMException( 549 exception_state.ThrowDOMException(
550 kSyntaxError, "The autoplay policy ('" + policy_str + ")' is invalid."); 550 kSyntaxError, "The autoplay policy ('" + policy_str + ")' is invalid.");
551 } 551 }
552 552
553 GetSettings()->SetAutoplayPolicy(policy); 553 GetSettings()->SetAutoplayPolicy(policy);
554 } 554 }
555 555
556 void InternalSettings::setDataSaverEnabled(bool enabled,
557 ExceptionState& exception_state) {
558 InternalSettingsGuardForSettings();
559 GetSettings()->SetDataSaverFlag(enabled ? WebDataSaverFlag::kEnabled
560 : WebDataSaverFlag::kDisabled);
561 }
562
556 } // namespace blink 563 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698