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

Side by Side Diff: extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc

Issue 1032553009: favor DCHECK_CURRENTLY_ON for better logs in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatc her.h" 5 #include "extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatc her.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "device/bluetooth/bluetooth_device.h" 8 #include "device/bluetooth/bluetooth_device.h"
9 #include "device/bluetooth/bluetooth_socket.h" 9 #include "device/bluetooth/bluetooth_socket.h"
10 #include "extensions/browser/api/bluetooth_socket/bluetooth_api_socket.h" 10 #include "extensions/browser/api/bluetooth_socket/bluetooth_api_socket.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 params.browser_context_id, 348 params.browser_context_id,
349 params.extension_id, 349 params.extension_id,
350 base::Passed(event.Pass()))); 350 base::Passed(event.Pass())));
351 } 351 }
352 352
353 // static 353 // static
354 void BluetoothSocketEventDispatcher::DispatchEvent( 354 void BluetoothSocketEventDispatcher::DispatchEvent(
355 void* browser_context_id, 355 void* browser_context_id,
356 const std::string& extension_id, 356 const std::string& extension_id,
357 scoped_ptr<Event> event) { 357 scoped_ptr<Event> event) {
358 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 358 DCHECK_CURRENTLY_ON(BrowserThread::UI);
359 359
360 content::BrowserContext* context = 360 content::BrowserContext* context =
361 reinterpret_cast<content::BrowserContext*>(browser_context_id); 361 reinterpret_cast<content::BrowserContext*>(browser_context_id);
362 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context)) 362 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context))
363 return; 363 return;
364 364
365 EventRouter* router = EventRouter::Get(context); 365 EventRouter* router = EventRouter::Get(context);
366 if (router) 366 if (router)
367 router->DispatchEventToExtension(extension_id, event.Pass()); 367 router->DispatchEventToExtension(extension_id, event.Pass());
368 } 368 }
369 369
370 } // namespace core_api 370 } // namespace core_api
371 } // namespace extensions 371 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698