| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/notifications/notification_platform_bridge_mac.h" | 5 #include "chrome/browser/notifications/notification_platform_bridge_mac.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 // If NO, then -serviceProxy will set the exception port. | 494 // If NO, then -serviceProxy will set the exception port. |
| 495 BOOL setExceptionPort_; | 495 BOOL setExceptionPort_; |
| 496 } | 496 } |
| 497 | 497 |
| 498 - (instancetype)init { | 498 - (instancetype)init { |
| 499 if ((self = [super init])) { | 499 if ((self = [super init])) { |
| 500 xpcConnection_.reset([[NSXPCConnection alloc] | 500 xpcConnection_.reset([[NSXPCConnection alloc] |
| 501 initWithServiceName: | 501 initWithServiceName: |
| 502 [NSString | 502 [NSString |
| 503 stringWithFormat:notification_constants::kAlertXPCServiceName, | 503 stringWithFormat:notification_constants::kAlertXPCServiceName, |
| 504 [base::mac::FrameworkBundle() | 504 [base::mac::OuterBundle() bundleIdentifier]]]); |
| 505 bundleIdentifier]]]); | |
| 506 xpcConnection_.get().remoteObjectInterface = | 505 xpcConnection_.get().remoteObjectInterface = |
| 507 [NSXPCInterface interfaceWithProtocol:@protocol(NotificationDelivery)]; | 506 [NSXPCInterface interfaceWithProtocol:@protocol(NotificationDelivery)]; |
| 508 | 507 |
| 509 xpcConnection_.get().interruptionHandler = ^{ | 508 xpcConnection_.get().interruptionHandler = ^{ |
| 510 // We will be getting this handler both when the XPC server crashes or | 509 // We will be getting this handler both when the XPC server crashes or |
| 511 // when it decides to close the connection. | 510 // when it decides to close the connection. |
| 512 LOG(WARNING) << "AlertNotificationService: XPC connection interrupted."; | 511 LOG(WARNING) << "AlertNotificationService: XPC connection interrupted."; |
| 513 RecordXPCEvent(INTERRUPTED); | 512 RecordXPCEvent(INTERRUPTED); |
| 514 setExceptionPort_ = NO; | 513 setExceptionPort_ = NO; |
| 515 }; | 514 }; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 base::scoped_nsobject<CrXPCMachPort> xpcPort( | 602 base::scoped_nsobject<CrXPCMachPort> xpcPort( |
| 604 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); | 603 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); |
| 605 [proxy setMachExceptionPort:xpcPort]; | 604 [proxy setMachExceptionPort:xpcPort]; |
| 606 setExceptionPort_ = YES; | 605 setExceptionPort_ = YES; |
| 607 } | 606 } |
| 608 | 607 |
| 609 return proxy; | 608 return proxy; |
| 610 } | 609 } |
| 611 | 610 |
| 612 @end | 611 @end |
| OLD | NEW |