forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 3
/
MacAppStoreSupport_Updated.diff
596 lines (533 loc) · 19.9 KB
/
MacAppStoreSupport_Updated.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
diff --git a/chrome/browser/process_singleton_mac.cc b/chrome/browser/process_singleton_mac.cc
index ae234d6..9b9abaf 100644
--- a/chrome/browser/process_singleton_mac.cc
+++ b/chrome/browser/process_singleton_mac.cc
@@ -36,7 +36,6 @@
// process will be considered as hung for some reason. The second process then
// retrieves the process id from the symbol link and kills it by sending
// SIGKILL. Then the second process starts as normal.
-
#include "chrome/browser/process_singleton.h"
#include <errno.h>
@@ -898,14 +897,19 @@ bool ProcessSingleton::Create() {
return false;
}
// Setup the socket symlink and the two cookies.
+#ifndef MAC_APP_STORE
base::FilePath socket_target_path =
socket_dir_.path().Append(chrome::kSingletonSocketFilename);
+#endif
base::FilePath cookie(GenerateCookie());
base::FilePath remote_cookie_path =
socket_dir_.path().Append(chrome::kSingletonCookieFilename);
UnlinkPath(socket_path_);
UnlinkPath(cookie_path_);
- if (!SymlinkPath(socket_target_path, socket_path_) ||
+ if (
+#ifndef MAC_APP_STORE
+ !SymlinkPath(socket_target_path, socket_path_) ||
+#endif
!SymlinkPath(cookie, cookie_path_) ||
!SymlinkPath(cookie, remote_cookie_path)) {
// We've already locked things, so we can't have lost the startup race,
@@ -916,10 +920,18 @@ bool ProcessSingleton::Create() {
return false;
}
- SetupSocket(socket_target_path.value(), &sock, &addr);
+#ifndef MAC_APP_STORE
+ SetupSocket(socket_target_path.value(), &sock, &addr);
+#else
+ SetupSocket(socket_path_.value(), &sock, &addr);
+#endif
if (bind(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) < 0) {
+#ifndef MAC_APP_STORE
PLOG(ERROR) << "Failed to bind() " << socket_target_path.value();
+#else
+ PLOG(ERROR) << "Failed to bind() " << socket_path_.value();
+#endif
CloseSocket(sock);
return false;
}
diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc
index c9a5a51..93ee028 100644
--- a/chrome/common/chrome_constants.cc
+++ b/chrome/common/chrome_constants.cc
@@ -186,8 +186,18 @@ const base::FilePath::CharType kShortcutsDatabaseName[] = FPL("Shortcuts");
const base::FilePath::CharType kSingletonCookieFilename[] =
FPL("SingletonCookie");
const base::FilePath::CharType kSingletonLockFilename[] = FPL("SingletonLock");
+#ifdef MAC_APP_STORE
+// Used to be SingletonSocket but due to length limits of sockets we must peal this down.
+// See: https://code.google.com/p/chromium/issues/detail?id=33097 this is a temporary
+// work around.
+//
+// See: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man4/unix.4.html
+const base::FilePath::CharType kSingletonSocketFilename[] =
+ FPL("S");
+#else
const base::FilePath::CharType kSingletonSocketFilename[] =
- FPL("SingletonSocket");
+ FPL("SingletonSocket");
+#endif
const base::FilePath::CharType kSyncCredentialsFilename[] =
FPL("Sync Credentials");
const base::FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak");
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index be9ff5b..09edb3e 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -17,10 +17,12 @@
#include "content/public/common/content_client.h"
#include "grit/webkit_strings.h"
+#ifndef MAC_APP_STORE
// See http://openradar.appspot.com/9896491. This SPI has been tested on 10.5,
// 10.6, and 10.7. It allows accessibility clients to observe events posted on
// this object.
extern "C" void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
+#endif
using content::AccessibilityNodeData;
using content::BrowserAccessibility;
@@ -317,7 +319,9 @@ NSDictionary* attributeToMethodNameMap = nil;
- (void)detach {
if (browserAccessibility_) {
+#ifndef MAC_APP_STORE
NSAccessibilityUnregisterUniqueIdForUIElement(self);
+#endif
browserAccessibility_ = NULL;
}
}
diff --git a/content/browser/device_monitor_mac.mm b/content/browser/device_monitor_mac.mm
index e30cd5b..3630dba 100644
--- a/content/browser/device_monitor_mac.mm
+++ b/content/browser/device_monitor_mac.mm
@@ -4,7 +4,10 @@
#include "content/browser/device_monitor_mac.h"
+#ifndef MAC_APP_STORE
#import <QTKit/QTKit.h>
+#endif
+#import <Foundation/Foundation.h>
#include "base/logging.h"
@@ -43,6 +46,7 @@ DeviceMonitorMac::QTMonitorImpl::QTMonitorImpl(DeviceMonitorMac* monitor)
}
void DeviceMonitorMac::QTMonitorImpl::Start() {
+#ifndef MAC_APP_STORE
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
device_arrival_ =
[nc addObserverForName:QTCaptureDeviceWasConnectedNotification
@@ -64,9 +68,11 @@ void DeviceMonitorMac::QTMonitorImpl::Start() {
queue:nil
usingBlock:^(NSNotification* notification) {
OnAttributeChanged(notification);}];
+#endif
}
void DeviceMonitorMac::QTMonitorImpl::Stop() {
+#ifndef MAC_APP_STORE
if (!monitor_)
return;
@@ -74,16 +80,20 @@ void DeviceMonitorMac::QTMonitorImpl::Stop() {
[nc removeObserver:device_arrival_];
[nc removeObserver:device_removal_];
[nc removeObserver:device_change_];
+#endif
}
void DeviceMonitorMac::QTMonitorImpl::OnAttributeChanged(
NSNotification* notification) {
+#ifndef MAC_APP_STORE
if ([[[notification userInfo] objectForKey:QTCaptureDeviceChangedAttributeKey]
isEqualToString:QTCaptureDeviceSuspendedAttribute])
OnDeviceChanged();
+#endif
}
void DeviceMonitorMac::QTMonitorImpl::CountDevices() {
+#ifndef MAC_APP_STORE
NSArray* devices = [QTCaptureDevice inputDevices];
number_video_devices_ = 0;
number_audio_devices_ = 0;
@@ -99,9 +109,11 @@ void DeviceMonitorMac::QTMonitorImpl::CountDevices() {
[device hasMediaType:QTMediaTypeMuxed])
++number_audio_devices_;
}
+#endif
}
void DeviceMonitorMac::QTMonitorImpl::OnDeviceChanged() {
+#ifndef MAC_APP_STORE
int number_video_devices = number_video_devices_;
int number_audio_devices = number_audio_devices_;
CountDevices();
@@ -111,21 +123,28 @@ void DeviceMonitorMac::QTMonitorImpl::OnDeviceChanged() {
if (number_audio_devices_ != number_audio_devices)
monitor_->NotifyDeviceChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE);
+#endif
}
DeviceMonitorMac::DeviceMonitorMac() {
+#ifndef MAC_APP_STORE
qt_monitor_.reset(new QTMonitorImpl(this));
qt_monitor_->Start();
+#endif
}
DeviceMonitorMac::~DeviceMonitorMac() {
+#ifndef MAC_APP_STORE
qt_monitor_->Stop();
+#endif
}
void DeviceMonitorMac::NotifyDeviceChanged(
base::SystemMonitor::DeviceType type) {
// TODO(xians): Remove the global variable for SystemMonitor.
+#ifndef MAC_APP_STORE
base::SystemMonitor::Get()->ProcessDevicesChanged(type);
+#endif
}
} // namespace content
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 71dfb16..384c9c4 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -3379,9 +3379,12 @@ static const NSTrackingRectTag kTrackingRectTag = 0xBADFACE;
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
+
+#ifndef MAC_APP_STORE
extern "C" {
extern NSString *NSTextInputReplacementRangeAttributeName;
}
+#endif
- (NSArray *)validAttributesForMarkedText {
// This code is just copied from WebKit except renaming variables.
@@ -3390,8 +3393,10 @@ extern NSString *NSTextInputReplacementRangeAttributeName;
NSUnderlineStyleAttributeName,
NSUnderlineColorAttributeName,
NSMarkedClauseSegmentAttributeName,
+#ifndef MAC_APP_STORE
NSTextInputReplacementRangeAttributeName,
- nil]);
+#endif
+ nil]);
}
return validAttributesForMarkedText_.get();
}
diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm
index b121144..610f838 100644
--- a/content/renderer/renderer_main_platform_delegate_mac.mm
+++ b/content/renderer/renderer_main_platform_delegate_mac.mm
@@ -20,6 +20,7 @@
#include "content/common/sandbox_init_mac.h"
#include "third_party/mach_override/mach_override.h"
+#ifndef MAC_APP_STORE
extern "C" {
// SPI logging functions for CF that are exported externally.
void CFLog(int32_t level, CFStringRef format, ...);
@@ -27,6 +28,7 @@ void _CFLogvEx(void* log_func, void* copy_desc_func,
CFDictionaryRef format_options, int32_t level,
CFStringRef format, va_list args);
} // extern "C"
+#endif
namespace content {
@@ -64,7 +66,9 @@ void CrRendererCFLog(int32_t level, CFStringRef format, ...) {
va_list args;
va_start(args, format);
+#ifndef MAC_APP_STORE
_CFLogvEx(NULL, NULL, NULL, level, format, args);
+#endif
va_end(args);
}
@@ -127,6 +131,7 @@ bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) {
}
bool RendererMainPlatformDelegate::EnableSandbox() {
+#ifndef MAC_APP_STORE
// rdar://9251340 http://openradar.me/9251340
// See http://crbug.com/31225 and http://crbug.com/152566
// To check if this is broken:
@@ -155,10 +160,10 @@ bool RendererMainPlatformDelegate::EnableSandbox() {
err = mach_override_ptr((void*)&CFLog, (void*)&CrRendererCFLog, NULL);
CHECK_EQ(err_none, err);
}
-
+#endif
// Enable the sandbox.
bool sandbox_initialized = InitializeSandbox();
-
+#ifndef MAC_APP_STORE
if (needs_ime_hack) {
// After the sandbox is initialized, call into TIS. Doing this before
// the sandbox is in place will open up renderer access to the
@@ -172,7 +177,7 @@ bool RendererMainPlatformDelegate::EnableSandbox() {
g_text_input_services_source_list_ = CFArrayCreate(kCFAllocatorDefault,
source_list, arraysize(source_list), &kCFTypeArrayCallBacks);
}
-
+#endif
return sandbox_initialized;
}
diff --git a/media/media.gyp b/media/media.gyp
index d346dac4..6eb680f 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -725,6 +725,9 @@
'$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework',
'$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
+ # This may need to be removed for support for the MAC_APP_STORE
+ # if MAC_APP_STORE is enabled this line can be removed as the
+ # source code doesn't require it.
'$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
],
},
diff --git a/media/video/capture/mac/video_capture_device_mac.h b/media/video/capture/mac/video_capture_device_mac.h
index adfd4c7..2509d6b 100644
--- a/media/video/capture/mac/video_capture_device_mac.h
+++ b/media/video/capture/mac/video_capture_device_mac.h
@@ -18,8 +18,9 @@
#include "media/video/capture/video_capture_device.h"
#include "media/video/capture/video_capture_types.h"
+#ifndef MAC_APP_STORE
@protocol PlatformVideoCapturingMac;
-
+#endif
namespace media {
// Called by VideoCaptureManager to open, close and start, stop video capture
@@ -73,9 +74,9 @@ class VideoCaptureDeviceMac : public VideoCaptureDevice {
// after the VideoCaptureDeviceMac is destroyed.
base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_;
base::WeakPtr<VideoCaptureDeviceMac> weak_this_;
-
+#ifndef MAC_APP_STORE
id<PlatformVideoCapturingMac> capture_device_;
-
+#endif
DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac);
};
diff --git a/media/video/capture/mac/video_capture_device_mac.mm b/media/video/capture/mac/video_capture_device_mac.mm
index 77d30e9..b52649a 100644
--- a/media/video/capture/mac/video_capture_device_mac.mm
+++ b/media/video/capture/mac/video_capture_device_mac.mm
@@ -9,8 +9,9 @@
#include "base/logging.h"
#include "base/time/time.h"
#import "media/video/capture/mac/platform_video_capturing_mac.h"
+#ifndef MAC_APP_STORE
#include "media/video/capture/mac/video_capture_device_qtkit_mac.h"
-
+#endif
namespace {
const int kMinFrameRate = 1;
@@ -65,6 +66,7 @@ void GetBestMatchSupportedResolution(int* width, int* height) {
namespace media {
void VideoCaptureDevice::GetDeviceNames(Names* device_names) {
+#ifndef MAC_APP_STORE
// Loop through all available devices and add to |device_names|.
device_names->clear();
@@ -74,6 +76,7 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) {
[key UTF8String]);
device_names->push_back(name);
}
+#endif
}
// static
@@ -83,6 +86,7 @@ void VideoCaptureDevice::GetDeviceSupportedFormats(const Name& device,
}
const std::string VideoCaptureDevice::Name::GetModel() const {
+#ifndef MAC_APP_STORE
// Both PID and VID are 4 characters.
if (unique_id_.size() < 2 * kVidPidSize) {
return "";
@@ -95,9 +99,13 @@ const std::string VideoCaptureDevice::Name::GetModel() const {
std::string id_product = unique_id_.substr(pid_location, kVidPidSize);
return id_vendor + ":" + id_product;
+#else
+ return "";
+#endif
}
VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) {
+#ifndef MAC_APP_STORE
VideoCaptureDeviceMac* capture_device =
new VideoCaptureDeviceMac(device_name);
if (!capture_device->Init()) {
@@ -106,6 +114,9 @@ VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) {
capture_device = NULL;
}
return capture_device;
+#else
+ return NULL;
+#endif
}
VideoCaptureDeviceMac::VideoCaptureDeviceMac(const Name& device_name)
@@ -115,18 +126,25 @@ VideoCaptureDeviceMac::VideoCaptureDeviceMac(const Name& device_name)
loop_proxy_(base::MessageLoopProxy::current()),
state_(kNotInitialized),
weak_factory_(this),
- weak_this_(weak_factory_.GetWeakPtr()),
- capture_device_(nil) {
+ weak_this_(weak_factory_.GetWeakPtr())
+#ifndef MAC_STORE_APP
+ ,capture_device_(nil)
+#endif
+{
+ {
}
VideoCaptureDeviceMac::~VideoCaptureDeviceMac() {
+#ifndef MAC_APP_STORE
DCHECK_EQ(loop_proxy_, base::MessageLoopProxy::current());
[capture_device_ release];
+#endif
}
void VideoCaptureDeviceMac::AllocateAndStart(
const VideoCaptureCapability& capture_format,
scoped_ptr<VideoCaptureDevice::Client> client) {
+#ifndef MAC_APP_STORE
DCHECK_EQ(loop_proxy_, base::MessageLoopProxy::current());
if (state_ != kIdle) {
return;
@@ -181,9 +199,11 @@ void VideoCaptureDeviceMac::AllocateAndStart(
}
state_ = kCapturing;
+#endif
}
void VideoCaptureDeviceMac::StopAndDeAllocate() {
+#ifndef MAC_APP_STORE
DCHECK_EQ(loop_proxy_, base::MessageLoopProxy::current());
DCHECK(state_ == kCapturing || state_ == kError) << state_;
[capture_device_ stopCapture];
@@ -193,9 +213,11 @@ void VideoCaptureDeviceMac::StopAndDeAllocate() {
client_.reset();
state_ = kIdle;
tried_to_square_pixels_ = false;
+#endif
}
bool VideoCaptureDeviceMac::Init() {
+#ifndef MAC_APP_STORE
DCHECK_EQ(loop_proxy_, base::MessageLoopProxy::current());
DCHECK_EQ(state_, kNotInitialized);
@@ -212,6 +234,9 @@ bool VideoCaptureDeviceMac::Init() {
state_ = kIdle;
return true;
+#else
+ return false;
+#endif
}
void VideoCaptureDeviceMac::ReceiveFrame(
@@ -220,6 +245,7 @@ void VideoCaptureDeviceMac::ReceiveFrame(
const VideoCaptureCapability& frame_info,
int aspect_numerator,
int aspect_denominator) {
+#ifndef MAC_APP_STORE
// This method is safe to call from a device capture thread,
// i.e. any thread controlled by QTKit.
@@ -291,22 +317,28 @@ void VideoCaptureDeviceMac::ReceiveFrame(
client_->OnIncomingCapturedFrame(
video_frame, video_frame_length, base::Time::Now(), 0, false, false);
+#endif
}
void VideoCaptureDeviceMac::ReceiveError(const std::string& reason) {
+#ifndef MAC_APP_STORE
loop_proxy_->PostTask(FROM_HERE,
base::Bind(&VideoCaptureDeviceMac::SetErrorState, weak_this_,
reason));
+#endif
}
void VideoCaptureDeviceMac::SetErrorState(const std::string& reason) {
+#ifndef MAC_APP_STORE
DCHECK_EQ(loop_proxy_, base::MessageLoopProxy::current());
DLOG(ERROR) << reason;
state_ = kError;
client_->OnError();
+#endif
}
bool VideoCaptureDeviceMac::UpdateCaptureResolution() {
+#ifndef MAC_APP_STORE
if (![capture_device_ setCaptureHeight:current_settings_.height
width:current_settings_.width
frameRate:current_settings_.frame_rate]) {
@@ -314,6 +346,9 @@ bool VideoCaptureDeviceMac::UpdateCaptureResolution() {
return false;
}
return true;
+#else
+ return false;
+#endif
}
} // namespace media
diff --git a/media/video/capture/mac/video_capture_device_qtkit_mac.h b/media/video/capture/mac/video_capture_device_qtkit_mac.h
index f3bdcc5..266f536 100644
--- a/media/video/capture/mac/video_capture_device_qtkit_mac.h
+++ b/media/video/capture/mac/video_capture_device_qtkit_mac.h
@@ -5,6 +5,8 @@
// VideoCaptureDeviceQTKit implements all QTKit related code for
// communicating with a QTKit capture device.
+#ifndef MAC_APP_STORE
+
#ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_QTKIT_H_
#define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_QTKIT_H_
@@ -66,3 +68,5 @@ namespace media {
@end
#endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_QTKIT_H_
+
+#endif // MAC_APP_STORE
diff --git a/media/video/capture/mac/video_capture_device_qtkit_mac.mm b/media/video/capture/mac/video_capture_device_qtkit_mac.mm
index aa8ae4e..a549c36 100644
--- a/media/video/capture/mac/video_capture_device_qtkit_mac.mm
+++ b/media/video/capture/mac/video_capture_device_qtkit_mac.mm
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifndef MAC_APP_STORE
+
#import "media/video/capture/mac/video_capture_device_qtkit_mac.h"
#import <QTKit/QTKit.h>
@@ -320,3 +322,5 @@
}
@end
+
+#endif // MAC_APP_STORE
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
index baf9172..ff68105 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -121,10 +121,17 @@ class ConfigWatcher {
typedef base::Callback<void(bool succeeded)> CallbackType;
bool Watch(const CallbackType& callback) {
+#ifndef MAC_APP_STORE
+ // this is disabled for acceptance to the mac app store,
+ // entitlements do not allow atching sensitive file system
+ // data in /etc/
callback_ = callback;
return watcher_.Watch(base::FilePath(kFilePathConfig), false,
base::Bind(&ConfigWatcher::OnCallback,
base::Unretained(this)));
+#else
+ return false;
+#endif
}
private:
@@ -214,6 +221,10 @@ class DnsConfigServicePosix::Watcher {
DNS_CONFIG_WATCH_FAILED_TO_START_CONFIG,
DNS_CONFIG_WATCH_MAX);
}
+#ifndef MAC_APP_STORE
+ // this is disabled for acceptance to the mac app store,
+ // entitlements do not allow watching sensitive file system
+ // data in /etc/
if (!hosts_watcher_.Watch(base::FilePath(kFilePathHosts), false,
base::Bind(&Watcher::OnHostsChanged,
base::Unretained(this)))) {
@@ -223,6 +234,7 @@ class DnsConfigServicePosix::Watcher {
DNS_CONFIG_WATCH_FAILED_TO_START_HOSTS,
DNS_CONFIG_WATCH_MAX);
}
+#endif
return success;
}
diff --git a/ui/shell_dialogs/select_file_dialog_mac.mm b/ui/shell_dialogs/select_file_dialog_mac.mm
index dcbc93f..2b159e4 100644
--- a/ui/shell_dialogs/select_file_dialog_mac.mm
+++ b/ui/shell_dialogs/select_file_dialog_mac.mm
@@ -403,7 +403,9 @@ bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() {
index = 1;
}
} else {
+#ifndef MAC_APP_STORE
CHECK([panel isKindOfClass:[NSOpenPanel class]]);
+#endif
NSArray* urls = [static_cast<NSOpenPanel*>(panel) URLs];
for (NSURL* url in urls)
if ([url isFileURL])