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

Side by Side Diff: extensions/browser/api/serial/serial_event_dispatcher.cc

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 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/serial/serial_event_dispatcher.h" 5 #include "extensions/browser/api/serial/serial_event_dispatcher.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "extensions/browser/api/serial/serial_connection.h" 8 #include "extensions/browser/api/serial/serial_connection.h"
9 #include "extensions/browser/event_router.h" 9 #include "extensions/browser/event_router.h"
10 #include "extensions/browser/extensions_browser_client.h" 10 #include "extensions/browser/extensions_browser_client.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 namespace core_api { 14 namespace api {
15 15
16 namespace { 16 namespace {
17 17
18 bool ShouldPauseOnReceiveError(serial::ReceiveError error) { 18 bool ShouldPauseOnReceiveError(serial::ReceiveError error) {
19 return error == serial::RECEIVE_ERROR_DEVICE_LOST || 19 return error == serial::RECEIVE_ERROR_DEVICE_LOST ||
20 error == serial::RECEIVE_ERROR_SYSTEM_ERROR || 20 error == serial::RECEIVE_ERROR_SYSTEM_ERROR ||
21 error == serial::RECEIVE_ERROR_DISCONNECTED || 21 error == serial::RECEIVE_ERROR_DISCONNECTED ||
22 error == serial::RECEIVE_ERROR_BREAK || 22 error == serial::RECEIVE_ERROR_BREAK ||
23 error == serial::RECEIVE_ERROR_FRAME_ERROR || 23 error == serial::RECEIVE_ERROR_FRAME_ERROR ||
24 error == serial::RECEIVE_ERROR_OVERRUN || 24 error == serial::RECEIVE_ERROR_OVERRUN ||
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 content::BrowserContext* context = 154 content::BrowserContext* context =
155 reinterpret_cast<content::BrowserContext*>(browser_context_id); 155 reinterpret_cast<content::BrowserContext*>(browser_context_id);
156 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context)) 156 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context))
157 return; 157 return;
158 158
159 EventRouter* router = EventRouter::Get(context); 159 EventRouter* router = EventRouter::Get(context);
160 if (router) 160 if (router)
161 router->DispatchEventToExtension(extension_id, event.Pass()); 161 router->DispatchEventToExtension(extension_id, event.Pass());
162 } 162 }
163 163
164 } // namespace core_api 164 } // namespace api
165 165
166 } // namespace extensions 166 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/serial/serial_event_dispatcher.h ('k') | extensions/browser/api/socket/socket_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698