Commit 9e42fd84 authored by Ivan.Shulga's avatar Ivan.Shulga Committed by Alexander Trofimov

mac


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@56887 954022d7-b5bf-4e40-9824-e11837661b57
parent f031ac06
......@@ -12,7 +12,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/mac_logging.h"
//#include "base/mac/mac_logging.h"
#import "base/mac/mac_util.h"
#include "base/mac/scoped_authorizationref.h"
#include "base/posix/eintr_wrapper.h"
......@@ -30,7 +30,7 @@ AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) {
kAuthorizationFlagDefaults,
&authorization);
if (status != errAuthorizationSuccess) {
OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate";
//OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate";
return NULL;
}
......@@ -75,7 +75,7 @@ AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) {
NULL);
if (status != errAuthorizationSuccess) {
if (status != errAuthorizationCanceled) {
OSSTATUS_LOG(ERROR, status) << "AuthorizationCopyRights";
//OSSTATUS_LOG(ERROR, status) << "AuthorizationCopyRights";
}
return NULL;
}
......@@ -125,11 +125,11 @@ OSStatus ExecuteWithPrivilegesAndGetPID(AuthorizationRef authorization,
if (!base::StringToInt(line, &line_pid)) {
// StringToInt may have set line_pid to something, but if the conversion
// was imperfect, use -1.
LOG(ERROR) << "ExecuteWithPrivilegesAndGetPid: funny line: " << line;
//LOG(ERROR) << "ExecuteWithPrivilegesAndGetPid: funny line: " << line;
line_pid = -1;
}
} else {
LOG(ERROR) << "ExecuteWithPrivilegesAndGetPid: no line";
//LOG(ERROR) << "ExecuteWithPrivilegesAndGetPid: no line";
}
if (!pipe) {
......@@ -173,7 +173,7 @@ OSStatus ExecuteWithPrivilegesAndWait(AuthorizationRef authorization,
if (pid != -1) {
pid_t wait_result = HANDLE_EINTR(waitpid(pid, exit_status_pointer, 0));
if (wait_result != pid) {
PLOG(ERROR) << "waitpid";
//PLOG(ERROR) << "waitpid";
*exit_status_pointer = -1;
}
} else {
......
......@@ -59,7 +59,7 @@ static void AssignOverridePath(const FilePath& file_path,
NSBundle** override_bundle) {
NSString* path = base::SysUTF8ToNSString(file_path.value());
NSBundle* new_bundle = [NSBundle bundleWithPath:path];
DCHECK(new_bundle) << "Failed to load the bundle at " << file_path.value();
//DCHECK(new_bundle) << "Failed to load the bundle at " << file_path.value();
AssignOverrideBundle(new_bundle, override_bundle);
}
......
......@@ -339,9 +339,9 @@ T GetValueFromDictionary(CFDictionaryRef dict, CFStringRef key) {
if (value && !value_specific) {
std::string expected_type = TypeNameForCFType(value_specific);
DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key,
expected_type,
value);
//DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key,
// expected_type,
// value);
}
return value_specific;
......
......@@ -8,9 +8,9 @@
#include <string.h>
#include "base/files/file_path.h"
#include "base/logging.h"
//#include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/mac_logging.h"
//#include "base/mac/mac_logging.h"
#include "base/strings/sys_string_conversions.h"
#if !defined(OS_IOS)
......@@ -40,7 +40,7 @@ static bool UncachedAmIBundled() {
FSRef fsref;
OSStatus pbErr;
if ((pbErr = GetProcessBundleLocation(&psn, &fsref)) != noErr) {
OSSTATUS_DLOG(ERROR, pbErr) << "GetProcessBundleLocation failed";
//OSSTATUS_DLOG(ERROR, pbErr) << "GetProcessBundleLocation failed";
return false;
}
......@@ -48,7 +48,7 @@ static bool UncachedAmIBundled() {
OSErr fsErr;
if ((fsErr = FSGetCatalogInfo(&fsref, kFSCatInfoNodeFlags, &info,
NULL, NULL, NULL)) != noErr) {
OSSTATUS_DLOG(ERROR, fsErr) << "FSGetCatalogInfo failed";
//OSSTATUS_DLOG(ERROR, fsErr) << "FSGetCatalogInfo failed";
return false;
}
......@@ -61,10 +61,10 @@ bool AmIBundled() {
// values depending on when it's called. This confuses some client code, see
// http://crbug.com/63183 .
static bool result = UncachedAmIBundled();
DCHECK_EQ(result, UncachedAmIBundled())
<< "The return value of AmIBundled() changed. This will confuse tests. "
<< "Call SetAmIBundled() override manually if your test binary "
<< "delay-loads the framework.";
//DCHECK_EQ(result, UncachedAmIBundled())
// << "The return value of AmIBundled() changed. This will confuse tests. "
// << "Call SetAmIBundled() override manually if your test binary "
// << "delay-loads the framework.";
return result;
}
......@@ -110,7 +110,7 @@ OSType CreatorCodeForApplication() {
bool GetSearchPathDirectory(NSSearchPathDirectory directory,
NSSearchPathDomainMask domain_mask,
FilePath* result) {
DCHECK(result);
//DCHECK(result);
NSArray* dirs =
NSSearchPathForDirectoriesInDomains(directory, domain_mask, YES);
if ([dirs count] < 1) {
......@@ -131,7 +131,7 @@ bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result) {
FilePath GetUserLibraryPath() {
FilePath user_library_path;
if (!GetUserDirectory(NSLibraryDirectory, &user_library_path)) {
DLOG(WARNING) << "Could not get user library path";
//DLOG(WARNING) << "Could not get user library path";
}
return user_library_path;
}
......@@ -156,7 +156,7 @@ FilePath GetAppBundlePath(const FilePath& exec_name) {
// Don't prepend '/' to the first component.
std::vector<std::string>::const_iterator it = components.begin();
std::string bundle_name = *it;
DCHECK_GT(it->length(), 0U);
//DCHECK_GT(it->length(), 0U);
// If the first component ends in ".app", we're already done.
if (it->length() > kExtLength &&
!it->compare(it->length() - kExtLength, kExtLength, kExt, kExtLength))
......@@ -169,7 +169,7 @@ FilePath GetAppBundlePath(const FilePath& exec_name) {
// Go through the remaining components.
for (++it; it != components.end(); ++it) {
DCHECK_GT(it->length(), 0U);
//DCHECK_GT(it->length(), 0U);
bundle_name += *it;
......@@ -257,7 +257,6 @@ void SetBaseBundleID(const char* new_base_bundle_id) {
#define CF_TO_NS_CAST_DEFN(TypeCF, TypeNS) \
\
TypeNS* CFToNSCast(TypeCF##Ref cf_val) { \
DCHECK(!cf_val || TypeCF##GetTypeID() == CFGetTypeID(cf_val)); \
TypeNS* ns_val = \
const_cast<TypeNS*>(reinterpret_cast<const TypeNS*>(cf_val)); \
return ns_val; \
......@@ -265,7 +264,6 @@ TypeNS* CFToNSCast(TypeCF##Ref cf_val) { \
\
TypeCF##Ref NSToCFCast(TypeNS* ns_val) { \
TypeCF##Ref cf_val = reinterpret_cast<TypeCF##Ref>(ns_val); \
DCHECK(!cf_val || TypeCF##GetTypeID() == CFGetTypeID(cf_val)); \
return cf_val; \
}
......@@ -273,7 +271,6 @@ TypeCF##Ref NSToCFCast(TypeNS* ns_val) { \
CF_TO_NS_CAST_DEFN(CF##name, NS##name) \
\
NSMutable##name* CFToNSCast(CFMutable##name##Ref cf_val) { \
DCHECK(!cf_val || CF##name##GetTypeID() == CFGetTypeID(cf_val)); \
NSMutable##name* ns_val = reinterpret_cast<NSMutable##name*>(cf_val); \
return ns_val; \
} \
......@@ -281,7 +278,6 @@ NSMutable##name* CFToNSCast(CFMutable##name##Ref cf_val) { \
CFMutable##name##Ref NSToCFCast(NSMutable##name* ns_val) { \
CFMutable##name##Ref cf_val = \
reinterpret_cast<CFMutable##name##Ref>(ns_val); \
DCHECK(!cf_val || CF##name##GetTypeID() == CFGetTypeID(cf_val)); \
return cf_val; \
}
......@@ -321,7 +317,6 @@ CFCast<TypeCF##Ref>(const CFTypeRef& cf_val) { \
template<> TypeCF##Ref \
CFCastStrict<TypeCF##Ref>(const CFTypeRef& cf_val) { \
TypeCF##Ref rv = CFCast<TypeCF##Ref>(cf_val); \
DCHECK(cf_val == NULL || rv); \
return rv; \
}
......
......@@ -7,7 +7,7 @@
#include <ApplicationServices/ApplicationServices.h>
#include "base/logging.h"
#include "base/mac/mac_logging.h"
//#include "base/mac/mac_logging.h"
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
......@@ -19,7 +19,7 @@ bool OpenApplicationWithPath(const base::FilePath& bundle_path,
ProcessSerialNumber* out_psn) {
FSRef app_fsref;
if (!base::mac::FSRefFromPath(bundle_path.value(), &app_fsref)) {
LOG(ERROR) << "base::mac::FSRefFromPath failed for " << bundle_path.value();
//LOG(ERROR) << "base::mac::FSRefFromPath failed for " << bundle_path.value();
return false;
}
......@@ -28,7 +28,7 @@ bool OpenApplicationWithPath(const base::FilePath& bundle_path,
base::mac::ScopedCFTypeRef<CFMutableArrayRef> launch_args(
CFArrayCreateMutable(NULL, argc - 1, &kCFTypeArrayCallBacks));
if (!launch_args) {
LOG(ERROR) << "CFArrayCreateMutable failed, size was " << argc;
//LOG(ERROR) << "CFArrayCreateMutable failed, size was " << argc;
return false;
}
......@@ -38,7 +38,7 @@ bool OpenApplicationWithPath(const base::FilePath& bundle_path,
base::mac::ScopedCFTypeRef<CFStringRef> arg_cf(
base::SysUTF8ToCFStringRef(arg));
if (!arg_cf) {
LOG(ERROR) << "base::SysUTF8ToCFStringRef failed for " << arg;
//LOG(ERROR) << "base::SysUTF8ToCFStringRef failed for " << arg;
return false;
}
CFArrayAppendValue(launch_args, arg_cf);
......@@ -57,7 +57,7 @@ bool OpenApplicationWithPath(const base::FilePath& bundle_path,
// running without any windows open.
OSStatus status = LSOpenApplication(&ls_parameters, out_psn);
if (status != noErr) {
OSSTATUS_LOG(ERROR, status) << "LSOpenApplication";
//OSSTATUS_LOG(ERROR, status) << "LSOpenApplication";
return false;
}
return true;
......
......@@ -19,7 +19,7 @@ launch_data_t MessageForJob(const std::string& job_label,
// launch_data_alloc returns something that needs to be freed.
ScopedLaunchData message(launch_data_alloc(LAUNCH_DATA_DICTIONARY));
if (!message) {
LOG(ERROR) << "launch_data_alloc";
//LOG(ERROR) << "launch_data_alloc";
return NULL;
}
......@@ -29,7 +29,7 @@ launch_data_t MessageForJob(const std::string& job_label,
// dictionary.
ScopedLaunchData job_label_launchd(launch_data_new_string(job_label.c_str()));
if (!job_label_launchd) {
LOG(ERROR) << "launch_data_new_string";
//LOG(ERROR) << "launch_data_new_string";
return NULL;
}
......@@ -51,9 +51,9 @@ pid_t PIDForJob(const std::string& job_label) {
launch_data_type_t response_type = launch_data_get_type(response);
if (response_type != LAUNCH_DATA_DICTIONARY) {
if (response_type == LAUNCH_DATA_ERRNO) {
LOG(ERROR) << "PIDForJob: error " << launch_data_get_errno(response);
//LOG(ERROR) << "PIDForJob: error " << launch_data_get_errno(response);
} else {
LOG(ERROR) << "PIDForJob: expected dictionary, got " << response_type;
//LOG(ERROR) << "PIDForJob: expected dictionary, got " << response_type;
}
return -1;
}
......@@ -64,7 +64,7 @@ pid_t PIDForJob(const std::string& job_label) {
return 0;
if (launch_data_get_type(pid_data) != LAUNCH_DATA_INTEGER) {
LOG(ERROR) << "PIDForJob: expected integer";
//LOG(ERROR) << "PIDForJob: expected integer";
return -1;
}
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/mac/mac_logging.h"
//#include "base/mac/mac_logging.h"
#include <iomanip>
......
......@@ -89,17 +89,17 @@ std::string ReleasableInstanceName(objc_property_t property) {
} // namespace
void ObjCPropertyReleaser::Init(id object, Class classy) {
DCHECK(!object_);
DCHECK(!class_);
CHECK([object isKindOfClass:classy]);
//DCHECK(!object_);
//DCHECK(!class_);
//CHECK([object isKindOfClass:classy]);
object_ = object;
class_ = classy;
}
void ObjCPropertyReleaser::ReleaseProperties() {
DCHECK(object_);
DCHECK(class_);
//DCHECK(object_);
//DCHECK(class_);
unsigned int property_count = 0;
objc_property_t* properties = class_copyPropertyList(class_, &property_count);
......@@ -114,7 +114,7 @@ void ObjCPropertyReleaser::ReleaseProperties() {
Ivar instance_variable =
object_getInstanceVariable(object_, instance_name.c_str(),
(void**)&instance_value);
DCHECK(instance_variable);
//DCHECK(instance_variable);
[instance_value release];
}
}
......
......@@ -273,7 +273,7 @@ NSString* const kWebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType";
// Trim whitespace off the ends and newlines out of the middle so we don't reject otherwise-valid URLs;
// we'll do another cleaning when we set the URLs and titles later, so this is safe.
NSString* potentialURLString = [self cleanedStringWithPasteboardString:[self stringForType:NSStringPboardType]];
return [potentialURLString isValidURI];
return YES;//return [potentialURLString isValidURI];
}
return NO;
......
......@@ -65,7 +65,7 @@ typedef enum
// Utility method to ensure validity of URI strings. NSURL is used to validate
// most of them, but the NSURL test may fail for |javascript:| and |data:| URIs
// because they often contain invalid (per RFC2396) characters such as spaces.
- (BOOL)isValidURI;
//- (BOOL)isValidURI;
- (NSString *)stringByRemovingCharactersInSet:(NSCharacterSet*)characterSet;
- (NSString *)stringByReplacingCharactersInSet:(NSCharacterSet*)characterSet withString:(NSString*)string;
......
......@@ -39,7 +39,7 @@
#import <AppKit/AppKit.h> // for NSStringDrawing.h
#import "NSString+Utils.h"
#include "googleurl/src/gurl.h"
//#include "googleurl/src/gurl.h"
@implementation NSString (ChimeraStringUtils)
......@@ -88,6 +88,7 @@
return ([self hasCaseInsensitivePrefix:@"javascript:"] || [self hasCaseInsensitivePrefix:@"data:"]);
}
/*
- (BOOL)isValidURI
{
// isValid() will only be true for valid, well-formed URI strings
......@@ -100,6 +101,7 @@
}
return NO;
}
*/
- (NSString *)stringByRemovingCharactersInSet:(NSCharacterSet*)characterSet
{
......
......@@ -6,10 +6,10 @@
#include <iterator>
#include "base/lazy_instance.h"
//#include "base/lazy_instance.h"
//#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
//#include "base/memory/scoped_ptr.h"
//#include "base/synchronization/lock.h"
#include "ui/gfx/size.h"
#include "libxml2/libxml/parser.h"
......
......@@ -8,7 +8,7 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/logging.h"
//#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/scoped_nsobject.h"
......@@ -16,9 +16,9 @@
#include "base/strings/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#import "third_party/mozilla/NSPasteboard+Utils.h"
#include "third_party/skia/include/core/SkBitmap.h"
//#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/custom_data_helper.h"
#include "ui/gfx/canvas.h"
//#include "ui/gfx/canvas.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
#include "ui/gfx/size.h"
......@@ -45,7 +45,7 @@ NSPasteboard* GetPasteboard() {
// can help track down problems if someone tries using clipboard code outside
// of a UI session.
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
DCHECK(pasteboard);
//DCHECK(pasteboard);
return pasteboard;
}
......@@ -95,18 +95,18 @@ Clipboard::FormatType Clipboard::FormatType::Deserialize(
}
Clipboard::Clipboard() {
DCHECK(CalledOnValidThread());
//DCHECK(CalledOnValidThread());
}
Clipboard::~Clipboard() {
DCHECK(CalledOnValidThread());
//DCHECK(CalledOnValidThread());
}
void Clipboard::WriteObjectsImpl(Buffer buffer,
const ObjectMap& objects,
SourceTag tag) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
[pb declareTypes:[NSArray array] owner:nil];
......@@ -173,6 +173,7 @@ void Clipboard::WriteBookmark(const char* title_data,
void Clipboard::WriteBitmap(const char* pixel_data, const char* size_data) {
const gfx::Size* size = reinterpret_cast<const gfx::Size*>(size_data);
/*
// Safe because the image goes away before the call returns.
base::mac::ScopedCFTypeRef<CFDataRef> data(
CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
......@@ -212,10 +213,12 @@ void Clipboard::WriteBitmap(const char* pixel_data, const char* size_data) {
NSPasteboard* pb = GetPasteboard();
[pb addTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:nil];
NSData *tiff_data = [image TIFFRepresentation];
LOG_IF(ERROR, tiff_data == NULL) << "Failed to allocate image for clipboard";
//LOG_IF(ERROR, tiff_data == NULL) << "Failed to allocate image for clipboard";
if (tiff_data) {
[pb setData:tiff_data forType:NSTIFFPboardType];
}
*/
}
void Clipboard::WriteData(const FormatType& format,
......@@ -250,8 +253,8 @@ void Clipboard::WriteWebSmartPaste() {
}
uint64 Clipboard::GetSequenceNumber(Buffer buffer) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
return [pb changeCount];
......@@ -259,8 +262,8 @@ uint64 Clipboard::GetSequenceNumber(Buffer buffer) {
bool Clipboard::IsFormatAvailable(const FormatType& format,
Buffer buffer) const {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
NSArray* types = [pb types];
......@@ -275,8 +278,8 @@ bool Clipboard::IsFormatAvailable(const FormatType& format,
}
void Clipboard::Clear(Buffer buffer) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
[pb declareTypes:[NSArray array] owner:nil];
......@@ -285,7 +288,7 @@ void Clipboard::Clear(Buffer buffer) {
void Clipboard::ReadAvailableTypes(Clipboard::Buffer buffer,
std::vector<string16>* types,
bool* contains_filenames) const {
DCHECK(CalledOnValidThread());
//DCHECK(CalledOnValidThread());
types->clear();
if (IsFormatAvailable(Clipboard::GetPlainTextFormatType(), buffer))
types->push_back(UTF8ToUTF16(kMimeTypeText));
......@@ -306,8 +309,8 @@ void Clipboard::ReadAvailableTypes(Clipboard::Buffer buffer,
}
void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
NSString* contents = [pb stringForType:NSStringPboardType];
......@@ -318,8 +321,8 @@ void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const {
void Clipboard::ReadAsciiText(Clipboard::Buffer buffer,
std::string* result) const {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
NSString* contents = [pb stringForType:NSStringPboardType];
......@@ -332,8 +335,8 @@ void Clipboard::ReadAsciiText(Clipboard::Buffer buffer,
void Clipboard::ReadHTML(Clipboard::Buffer buffer, string16* markup,
std::string* src_url, uint32* fragment_start,
uint32* fragment_end) const {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
// TODO(avi): src_url?
markup->clear();
......@@ -356,21 +359,24 @@ void Clipboard::ReadHTML(Clipboard::Buffer buffer, string16* markup,
}
*fragment_start = 0;
DCHECK(markup->length() <= kuint32max);
//DCHECK(markup->length() <= kuint32max);
*fragment_end = static_cast<uint32>(markup->length());
}
void Clipboard::ReadRTF(Buffer buffer, std::string* result) const {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
return ReadData(GetRtfFormatType(), result);
}
SkBitmap Clipboard::ReadImage(Buffer buffer) const {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
/*SkBitmap*/
bool Clipboard::ReadImage(Buffer buffer) const {
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
return true;
/*
scoped_nsobject<NSImage> image(
[[NSImage alloc] initWithPasteboard:GetPasteboard()]);
if (!image.get())
......@@ -394,13 +400,14 @@ SkBitmap Clipboard::ReadImage(Buffer buffer) const {
fraction:1.0];
}
return canvas.ExtractImageRep().sk_bitmap();
*/
}
void Clipboard::ReadCustomData(Buffer buffer,
const string16& type,
string16* result) const {
DCHECK(CalledOnValidThread());
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK(CalledOnValidThread());
//DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
if ([[pb types] containsObject:kWebCustomDataPboardType]) {
......@@ -411,7 +418,7 @@ void Clipboard::ReadCustomData(Buffer buffer,
}
void Clipboard::ReadBookmark(string16* title, std::string* url) const {
DCHECK(CalledOnValidThread());
//DCHECK(CalledOnValidThread());
NSPasteboard* pb = GetPasteboard();
if (title) {
......@@ -431,7 +438,7 @@ void Clipboard::ReadBookmark(string16* title, std::string* url) const {
}
void Clipboard::ReadData(const FormatType& format, std::string* result) const {
DCHECK(CalledOnValidThread());
//DCHECK(CalledOnValidThread());
NSPasteboard* pb = GetPasteboard();
NSData* data = [pb dataForType:format.ToNSString()];
if ([data length])
......@@ -439,7 +446,7 @@ void Clipboard::ReadData(const FormatType& format, std::string* result) const {
}
SourceTag Clipboard::ReadSourceTag(Buffer buffer) const {
DCHECK_EQ(buffer, BUFFER_STANDARD);
//DCHECK_EQ(buffer, BUFFER_STANDARD);
std::string result;
ReadData(GetSourceTagFormatType(), &result);
return Binary2SourceTag(result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment