| OLD | NEW | 
|    1 // Copyright 2013 The Chromium Authors. All rights reserved. |    1 // Copyright 2013 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 <stddef.h> |    5 #include <stddef.h> | 
|    6  |    6  | 
|    7 #include <memory> |    7 #include <memory> | 
|    8 #include <utility> |    8 #include <utility> | 
|    9  |    9  | 
|   10 #include "base/json/json_writer.h" |   10 #include "base/json/json_writer.h" | 
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  148   } |  148   } | 
|  149  |  149  | 
|  150   // Synchronously (from the calling thread's point of view) retrieve the |  150   // Synchronously (from the calling thread's point of view) retrieve the | 
|  151   // device id in the |origin| on the IO thread. On return, |  151   // device id in the |origin| on the IO thread. On return, | 
|  152   // |id_in_origin| contains the id |raw_device_id| is known by in |  152   // |id_in_origin| contains the id |raw_device_id| is known by in | 
|  153   // the origin. |  153   // the origin. | 
|  154   void GetIDInOrigin(content::ResourceContext* resource_context, |  154   void GetIDInOrigin(content::ResourceContext* resource_context, | 
|  155                      GURL origin, |  155                      GURL origin, | 
|  156                      const std::string& raw_device_id, |  156                      const std::string& raw_device_id, | 
|  157                      std::string* id_in_origin) { |  157                      std::string* id_in_origin) { | 
|  158     if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) { |  158     if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { | 
|  159       content::BrowserThread::PostTask( |  159       content::BrowserThread::PostTask( | 
|  160           content::BrowserThread::IO, FROM_HERE, |  160           content::BrowserThread::UI, FROM_HERE, | 
|  161           base::Bind(&WebrtcAudioPrivateTest::GetIDInOrigin, |  161           base::Bind(&WebrtcAudioPrivateTest::GetIDInOrigin, | 
|  162                      this, resource_context, origin, raw_device_id, |  162                      this, resource_context, origin, raw_device_id, | 
|  163                      id_in_origin)); |  163                      id_in_origin)); | 
|  164       enumeration_event_.Wait(); |  164       enumeration_event_.Wait(); | 
|  165     } else { |  165     } else { | 
|  166       *id_in_origin = content::GetHMACForMediaDeviceID( |  166       *id_in_origin = content::GetHMACForMediaDeviceID( | 
|  167           resource_context->GetMediaDeviceIDSalt(), url::Origin(origin), |  167           resource_context->GetMediaDeviceIDSalt(), url::Origin(origin), | 
|  168           raw_device_id); |  168           raw_device_id); | 
|  169       enumeration_event_.Signal(); |  169       enumeration_event_.Signal(); | 
|  170     } |  170     } | 
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  431   title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); |  431   title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("failure")); | 
|  432   base::string16 result = title_watcher.WaitAndGetTitle(); |  432   base::string16 result = title_watcher.WaitAndGetTitle(); | 
|  433   EXPECT_EQ(base::ASCIIToUTF16("success"), result); |  433   EXPECT_EQ(base::ASCIIToUTF16("success"), result); | 
|  434  |  434  | 
|  435   g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting( |  435   g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting( | 
|  436       NULL); |  436       NULL); | 
|  437 } |  437 } | 
|  438 #endif  // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN
     SION) |  438 #endif  // defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTEN
     SION) | 
|  439  |  439  | 
|  440 }  // namespace extensions |  440 }  // namespace extensions | 
| OLD | NEW |