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

Side by Side Diff: content/child/background_sync/background_sync_provider.cc

Issue 1197853005: Collecting statistics on iframe permissions use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed documentation. 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/child/background_sync/background_sync_provider.h" 5 #include "content/child/background_sync/background_sync_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/child/background_sync/background_sync_type_converters.h" 9 #include "content/child/background_sync/background_sync_type_converters.h"
10 #include "content/child/service_worker/web_service_worker_registration_impl.h" 10 #include "content/child/service_worker/web_service_worker_registration_impl.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 "Background Sync is disabled.")); 247 "Background Sync is disabled."));
248 break; 248 break;
249 case BACKGROUND_SYNC_ERROR_NO_SERVICE_WORKER: 249 case BACKGROUND_SYNC_ERROR_NO_SERVICE_WORKER:
250 callbacks->onError( 250 callbacks->onError(
251 new blink::WebSyncError(blink::WebSyncError::ErrorTypeUnknown, 251 new blink::WebSyncError(blink::WebSyncError::ErrorTypeUnknown,
252 "No service worker is active.")); 252 "No service worker is active."));
253 break; 253 break;
254 } 254 }
255 } 255 }
256 256
257 void BackgroundSyncProvider::GetPermissionStatusCallback( 257 void BackgroundSyncProvider::GetPermissionStatusCallback(
jww 2015/07/08 15:53:58 Sorry to beat on a dead horse here, but can you pu
jww 2015/07/08 15:55:09 (Although if you make mlamouri's change, then I th
keenanb 2015/07/08 22:31:52 yeah. i've disappeared them in celebration.
258 scoped_ptr<blink::WebSyncGetPermissionStatusCallbacks> callbacks, 258 scoped_ptr<blink::WebSyncGetPermissionStatusCallbacks> callbacks,
259 BackgroundSyncError error, 259 BackgroundSyncError error,
260 PermissionStatus status) { 260 PermissionStatus status) {
261 // TODO(iclelland): Determine the correct error message to return in each case 261 // TODO(iclelland): Determine the correct error message to return in each case
262 switch (error) { 262 switch (error) {
263 case BACKGROUND_SYNC_ERROR_NONE: 263 case BACKGROUND_SYNC_ERROR_NONE:
264 switch (status) { 264 switch (status) {
265 case PERMISSION_STATUS_GRANTED: 265 case PERMISSION_STATUS_GRANTED:
266 callbacks->onSuccess(new blink::WebSyncPermissionStatus( 266 callbacks->onSuccess(new blink::WebSyncPermissionStatus(
267 blink::WebSyncPermissionStatusGranted)); 267 blink::WebSyncPermissionStatusGranted));
268 break; 268 break;
269 case PERMISSION_STATUS_DENIED: 269 case PERMISSION_STATUS_DENIED:
270 callbacks->onSuccess(new blink::WebSyncPermissionStatus( 270 callbacks->onSuccess(new blink::WebSyncPermissionStatus(
271 blink::WebSyncPermissionStatusDenied)); 271 blink::WebSyncPermissionStatusDenied));
272 break; 272 break;
273 case PERMISSION_STATUS_ASK: 273 case PERMISSION_STATUS_ASK:
274 callbacks->onSuccess(new blink::WebSyncPermissionStatus( 274 callbacks->onSuccess(new blink::WebSyncPermissionStatus(
275 blink::WebSyncPermissionStatusPrompt)); 275 blink::WebSyncPermissionStatusPrompt));
276 break; 276 break;
277 case PERMISSION_STATUS_NUM:
278 NOTREACHED();
279 break;
277 } 280 }
278 break; 281 break;
279 case BACKGROUND_SYNC_ERROR_NOT_FOUND: 282 case BACKGROUND_SYNC_ERROR_NOT_FOUND:
280 // This error should never be returned from 283 // This error should never be returned from
281 // BackgroundSyncManager::GetPermissionStatus 284 // BackgroundSyncManager::GetPermissionStatus
282 NOTREACHED(); 285 NOTREACHED();
283 break; 286 break;
284 case BACKGROUND_SYNC_ERROR_STORAGE: 287 case BACKGROUND_SYNC_ERROR_STORAGE:
285 callbacks->onError( 288 callbacks->onError(
286 new blink::WebSyncError(blink::WebSyncError::ErrorTypeUnknown, 289 new blink::WebSyncError(blink::WebSyncError::ErrorTypeUnknown,
(...skipping 10 matching lines...) Expand all
297 BackgroundSyncServicePtr& 300 BackgroundSyncServicePtr&
298 BackgroundSyncProvider::GetBackgroundSyncServicePtr() { 301 BackgroundSyncProvider::GetBackgroundSyncServicePtr() {
299 if (!background_sync_service_.get()) { 302 if (!background_sync_service_.get()) {
300 service_registry_->ConnectToRemoteService( 303 service_registry_->ConnectToRemoteService(
301 mojo::GetProxy(&background_sync_service_)); 304 mojo::GetProxy(&background_sync_service_));
302 } 305 }
303 return background_sync_service_; 306 return background_sync_service_;
304 } 307 }
305 308
306 } // namespace content 309 } // namespace content
OLDNEW
« no previous file with comments | « content/child/background_sync/background_sync_provider.h ('k') | content/child/permissions/permission_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698