#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "extensions/browser/event_router.h"
-#include "extensions/browser/extension_system.h"
namespace extensions {
void SerialEventDispatcher::PollConnection(const std::string& extension_id,
int connection_id) {
- DCHECK(BrowserThread::CurrentlyOn(thread_id_));
+ DCHECK_CURRENTLY_ON(thread_id_);
ReceiveParams params;
params.thread_id = thread_id_;
// static
void SerialEventDispatcher::StartReceive(const ReceiveParams& params) {
- DCHECK(BrowserThread::CurrentlyOn(params.thread_id));
+ DCHECK_CURRENTLY_ON(params.thread_id);
SerialConnection* connection =
params.connections->Get(params.extension_id, params.connection_id);
void SerialEventDispatcher::ReceiveCallback(const ReceiveParams& params,
const std::string& data,
serial::ReceiveError error) {
- DCHECK(BrowserThread::CurrentlyOn(params.thread_id));
+ DCHECK_CURRENTLY_ON(params.thread_id);
// Note that an error (e.g. timeout) does not necessarily mean that no data
// was read, so we may fire an onReceive regardless of any error code.
// static
void SerialEventDispatcher::PostEvent(const ReceiveParams& params,
scoped_ptr<extensions::Event> event) {
- DCHECK(BrowserThread::CurrentlyOn(params.thread_id));
+ DCHECK_CURRENTLY_ON(params.thread_id);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
void SerialEventDispatcher::DispatchEvent(void* profile_id,
const std::string& extension_id,
scoped_ptr<extensions::Event> event) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = reinterpret_cast<Profile*>(profile_id);
if (!g_browser_process->profile_manager()->IsValidProfile(profile))
return;
- EventRouter* router = ExtensionSystem::Get(profile)->event_router();
+ EventRouter* router = EventRouter::Get(profile);
if (router)
router->DispatchEventToExtension(extension_id, event.Pass());
}