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

Unified Diff: chrome/browser/extensions/api/api_resource_event_notifier.cc

Issue 10134008: Add bind(), recvFrom(), sendTo() for UDP socket. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reenable api tests Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/api_resource_event_notifier.cc
diff --git a/chrome/browser/extensions/api/api_resource_event_notifier.cc b/chrome/browser/extensions/api/api_resource_event_notifier.cc
index 6b090239e6406c9a3b2309c263aadb82d814d772..246586a1253c1122177eb1c156638a304e8f3c3c 100644
--- a/chrome/browser/extensions/api/api_resource_event_notifier.cc
+++ b/chrome/browser/extensions/api/api_resource_event_notifier.cc
@@ -31,6 +31,8 @@ const char kIsFinalEventKey[] = "isFinalEvent";
const char kResultCodeKey[] = "resultCode";
const char kDataKey[] = "data";
+const char kAddressKey[] = "address";
+const char kPortKey[] = "port";
APIResourceEventNotifier::APIResourceEventNotifier(
ExtensionEventRouter* router,
@@ -47,11 +49,14 @@ APIResourceEventNotifier::APIResourceEventNotifier(
APIResourceEventNotifier::~APIResourceEventNotifier() {}
void APIResourceEventNotifier::OnConnectComplete(int result_code) {
+ LOG(ERROR) << "APIResourceEventNotifier::OnConnectComplete()" << result_code;
miket_OOO 2012/04/24 20:49:06 Leftover?
Peng 2012/04/24 21:13:47 Done.
SendEventWithResultCode(API_RESOURCE_EVENT_CONNECT_COMPLETE, result_code);
}
void APIResourceEventNotifier::OnDataRead(int result_code,
- base::ListValue* data) {
+ base::ListValue* data,
+ const std::string& address,
+ int port) {
// Do we have a destination for this event? There will be one if a source id
// was injected by the request handler for the resource's create method in
// schema_generated_bindings.js, which will in turn be the case if the caller
@@ -65,6 +70,8 @@ void APIResourceEventNotifier::OnDataRead(int result_code,
API_RESOURCE_EVENT_DATA_READ);
event->SetInteger(kResultCodeKey, result_code);
event->Set(kDataKey, data);
+ event->SetString(kAddressKey, address);
+ event->SetInteger(kPortKey, port);
DispatchEvent(event);
}

Powered by Google App Engine
This is Rietveld 408576698