| 
        
       | 
      
        
  
  Only allow SyncManager.register to occur from main frame
This CL limits registrations of background syncs to:
1) Main frame documents
2) Service Workers with a main frame window client
The main frame document check occurs in SyncManager.cpp
The window client check occurs in BackgroundSyncManager.cpp.
There are browser tests to verify the functionality. I've removed
spurious unittests from background_sync_manager_service_impl.cc.
There is not currently a unittest of the ServiceWorkerContextCore
change, due to the difficulty of unit testing the render frame
host (mocking it out seemed pointless).
BUG= 558388
Committed:  https://crrev.com/0cafe7ecc2c99f9cd7c9392f56814eb83d7eb63d
Cr-Commit-Position: refs/heads/master@{#361707}
    
  
  
  
  
   
  
  
  
  
  
   
  
  
  
  
  
   
  
  
  
  
  
   
  
  
  
    
      Total comments: 4
      
     
  
  
  
   
  
  
  
    
      Total comments: 7
      
     
  
  
  
   
  
  
  
  
    
  
  
    
       | 
      Unified diffs | 
      Side-by-side diffs | 
      Delta from patch set | 
      Stats (+310 lines, -180 lines) | 
      Patch | 
     
    
      
          | 
        M | 
        
          
            content/browser/background_sync/background_sync_browsertest.cc
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          3 chunks | 
          +31 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/background_sync/background_sync_manager.h
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
         | 
        
          3 chunks | 
          +12 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/background_sync/background_sync_manager.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
         | 
        
          5 chunks | 
          +61 lines, -17 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/background_sync/background_sync_manager_unittest.cc
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          8 chunks | 
          +20 lines, -46 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/background_sync/background_sync_service_impl_unittest.cc
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          4 chunks | 
          +0 lines, -73 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/service_worker/service_worker_context_core.h
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +5 lines, -3 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/service_worker/service_worker_context_core.cc
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
          5
        
          6
        
         | 
        
          3 chunks | 
          +44 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/service_worker/service_worker_context_unittest.cc
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +0 lines, -25 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/service_worker/service_worker_context_wrapper.h
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +3 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/browser/service_worker/service_worker_context_wrapper.cc
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +9 lines, -5 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/test/data/background_sync/background_sync_test_helpers.js
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +56 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A + | 
        
          
            content/test/data/background_sync/empty.html
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          0 chunks | 
          +-1 lines, --1 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            content/test/data/background_sync/register_sync.html
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +10 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            content/test/data/background_sync/register_sync.js
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +21 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            content/test/data/background_sync/register_sync_sw.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
          3
        
          4
        
         | 
        
          1 chunk | 
          +22 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            content/test/data/background_sync/service_worker.js
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot.html
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          3 chunks | 
          +8 lines, -7 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            third_party/WebKit/Source/modules/background_sync/SyncManager.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +8 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
   
  
    
      Depends on Patchset:
         
    
  
  
 
  
   
  
    
  
  
  
    
    Total messages: 17 (7 generated)
     
  
  
       |