OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 | 8 |
9 /** | 9 /** |
10 * Manages clients and settings for Service Workers. | 10 * Manages clients and settings for Service Workers. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 public boolean shouldBlockNetworkLoads() { | 74 public boolean shouldBlockNetworkLoads() { |
75 return mServiceWorkerSettings.getBlockNetworkLoads(); | 75 return mServiceWorkerSettings.getBlockNetworkLoads(); |
76 } | 76 } |
77 | 77 |
78 @Override | 78 @Override |
79 public boolean shouldAcceptThirdPartyCookies() { | 79 public boolean shouldAcceptThirdPartyCookies() { |
80 // We currently don't allow third party cookies in service workers, | 80 // We currently don't allow third party cookies in service workers, |
81 // see e.g. AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies. | 81 // see e.g. AwCookieAccessPolicy::GetShouldAcceptThirdPartyCookies. |
82 return false; | 82 return false; |
83 } | 83 } |
84 | |
85 @Override | |
86 public boolean getSafeBrowsingEnabled() { | |
87 // We don't allow safe browsing in service workers | |
88 return false; | |
sgurun-gerrit only
2017/04/11 00:38:52
return the value that is dictated by the manifest.
Nate Fischer
2017/04/11 00:58:02
done
| |
89 } | |
84 } | 90 } |
85 | 91 |
86 private class ServiceWorkerBackgroundThreadClientImpl | 92 private class ServiceWorkerBackgroundThreadClientImpl |
87 extends AwContentsBackgroundThreadClient { | 93 extends AwContentsBackgroundThreadClient { |
88 // All methods are called on the background thread. | 94 // All methods are called on the background thread. |
89 @Override | 95 @Override |
90 public AwWebResourceResponse shouldInterceptRequest( | 96 public AwWebResourceResponse shouldInterceptRequest( |
91 AwContentsClient.AwWebResourceRequest request) { | 97 AwContentsClient.AwWebResourceRequest request) { |
92 // TODO: Consider analogy with AwContentsClient, i.e. | 98 // TODO: Consider analogy with AwContentsClient, i.e. |
93 // - do we need an onloadresource callback? | 99 // - do we need an onloadresource callback? |
94 // - do we need to post an error if the response data == null? | 100 // - do we need to post an error if the response data == null? |
95 return mServiceWorkerClient.shouldInterceptRequest(request); | 101 return mServiceWorkerClient.shouldInterceptRequest(request); |
96 } | 102 } |
97 } | 103 } |
98 } | 104 } |
OLD | NEW |