Commit 20553490 authored by jln@chromium.org's avatar jln@chromium.org

Do a giant svn propset svn:eol-style LF on .cc and .h files that

lack this property.


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182368 0039d316-1c4b-4281-b951-d872f2087c98
parent 684003e2
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef BASE_JSON_JSON_STRING_VALUE_SERIALIZER_H_ #ifndef BASE_JSON_JSON_STRING_VALUE_SERIALIZER_H_
#define BASE_JSON_JSON_STRING_VALUE_SERIALIZER_H_ #define BASE_JSON_JSON_STRING_VALUE_SERIALIZER_H_
#include <string> #include <string>
#include "base/base_export.h" #include "base/base_export.h"
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/file_path.h" #include "base/file_path.h"
#include "base/values.h" #include "base/values.h"
class BASE_EXPORT JSONStringValueSerializer : public base::ValueSerializer { class BASE_EXPORT JSONStringValueSerializer : public base::ValueSerializer {
public: public:
// json_string is the string that will be source of the deserialization // json_string is the string that will be source of the deserialization
// or the destination of the serialization. The caller of the constructor // or the destination of the serialization. The caller of the constructor
// retains ownership of the string. // retains ownership of the string.
explicit JSONStringValueSerializer(std::string* json_string) explicit JSONStringValueSerializer(std::string* json_string)
: json_string_(json_string), : json_string_(json_string),
initialized_with_const_string_(false), initialized_with_const_string_(false),
pretty_print_(false), pretty_print_(false),
allow_trailing_comma_(false) { allow_trailing_comma_(false) {
} }
// This version allows initialization with a const string reference for // This version allows initialization with a const string reference for
// deserialization only. // deserialization only.
explicit JSONStringValueSerializer(const std::string& json_string) explicit JSONStringValueSerializer(const std::string& json_string)
: json_string_(&const_cast<std::string&>(json_string)), : json_string_(&const_cast<std::string&>(json_string)),
initialized_with_const_string_(true), initialized_with_const_string_(true),
pretty_print_(false), pretty_print_(false),
allow_trailing_comma_(false) { allow_trailing_comma_(false) {
} }
virtual ~JSONStringValueSerializer(); virtual ~JSONStringValueSerializer();
// Attempt to serialize the data structure represented by Value into // Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written // JSON. If the return value is true, the result will have been written
// into the string passed into the constructor. // into the string passed into the constructor.
virtual bool Serialize(const Value& root) OVERRIDE; virtual bool Serialize(const Value& root) OVERRIDE;
// Equivalent to Serialize(root) except binary values are omitted from the // Equivalent to Serialize(root) except binary values are omitted from the
// output. // output.
bool SerializeAndOmitBinaryValues(const Value& root); bool SerializeAndOmitBinaryValues(const Value& root);
// Attempt to deserialize the data structure encoded in the string passed // Attempt to deserialize the data structure encoded in the string passed
// in to the constructor into a structure of Value objects. If the return // in to the constructor into a structure of Value objects. If the return
// value is NULL, and if |error_code| is non-null, |error_code| will // value is NULL, and if |error_code| is non-null, |error_code| will
// contain an integer error code (either JsonFileError or JsonParseError). // contain an integer error code (either JsonFileError or JsonParseError).
// If |error_message| is non-null, it will be filled in with a formatted // If |error_message| is non-null, it will be filled in with a formatted
// error message including the location of the error if appropriate. // error message including the location of the error if appropriate.
// The caller takes ownership of the returned value. // The caller takes ownership of the returned value.
virtual Value* Deserialize(int* error_code, virtual Value* Deserialize(int* error_code,
std::string* error_message) OVERRIDE; std::string* error_message) OVERRIDE;
void set_pretty_print(bool new_value) { pretty_print_ = new_value; } void set_pretty_print(bool new_value) { pretty_print_ = new_value; }
bool pretty_print() { return pretty_print_; } bool pretty_print() { return pretty_print_; }
void set_allow_trailing_comma(bool new_value) { void set_allow_trailing_comma(bool new_value) {
allow_trailing_comma_ = new_value; allow_trailing_comma_ = new_value;
} }
private: private:
bool SerializeInternal(const Value& root, bool omit_binary_values); bool SerializeInternal(const Value& root, bool omit_binary_values);
std::string* json_string_; std::string* json_string_;
bool initialized_with_const_string_; bool initialized_with_const_string_;
bool pretty_print_; // If true, serialization will span multiple lines. bool pretty_print_; // If true, serialization will span multiple lines.
// If true, deserialization will allow trailing commas. // If true, deserialization will allow trailing commas.
bool allow_trailing_comma_; bool allow_trailing_comma_;
DISALLOW_COPY_AND_ASSIGN(JSONStringValueSerializer); DISALLOW_COPY_AND_ASSIGN(JSONStringValueSerializer);
}; };
#endif // BASE_JSON_JSON_STRING_VALUE_SERIALIZER_H_ #endif // BASE_JSON_JSON_STRING_VALUE_SERIALIZER_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.h" #include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.h"
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "base/values.h" #include "base/values.h"
#include "content/common/font_list.h" #include "content/common/font_list.h"
#include "content/public/browser/browser_ppapi_host.h" #include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "ppapi/host/dispatch_host_message.h" #include "ppapi/host/dispatch_host_message.h"
#include "ppapi/host/resource_message_filter.h" #include "ppapi/host/resource_message_filter.h"
#include "ppapi/proxy/ppapi_messages.h" #include "ppapi/proxy/ppapi_messages.h"
namespace content { namespace content {
namespace { namespace {
// Handles the font list request on the blocking pool. // Handles the font list request on the blocking pool.
class FontMessageFilter : public ppapi::host::ResourceMessageFilter { class FontMessageFilter : public ppapi::host::ResourceMessageFilter {
public: public:
FontMessageFilter(); FontMessageFilter();
// ppapi::host::ResourceMessageFilter implementation. // ppapi::host::ResourceMessageFilter implementation.
virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
const IPC::Message& msg) OVERRIDE; const IPC::Message& msg) OVERRIDE;
virtual int32_t OnResourceMessageReceived( virtual int32_t OnResourceMessageReceived(
const IPC::Message& msg, const IPC::Message& msg,
ppapi::host::HostMessageContext* context) OVERRIDE; ppapi::host::HostMessageContext* context) OVERRIDE;
private: private:
virtual ~FontMessageFilter(); virtual ~FontMessageFilter();
// Message handler. // Message handler.
int32_t OnHostMsgGetFontFamilies(ppapi::host::HostMessageContext* context); int32_t OnHostMsgGetFontFamilies(ppapi::host::HostMessageContext* context);
DISALLOW_COPY_AND_ASSIGN(FontMessageFilter); DISALLOW_COPY_AND_ASSIGN(FontMessageFilter);
}; };
FontMessageFilter::FontMessageFilter() { FontMessageFilter::FontMessageFilter() {
} }
FontMessageFilter::~FontMessageFilter() { FontMessageFilter::~FontMessageFilter() {
} }
scoped_refptr<base::TaskRunner> FontMessageFilter::OverrideTaskRunnerForMessage( scoped_refptr<base::TaskRunner> FontMessageFilter::OverrideTaskRunnerForMessage(
const IPC::Message& msg) { const IPC::Message& msg) {
// Use the blocking pool to get the font list (currently the only message // Use the blocking pool to get the font list (currently the only message
// so we can always just return it). // so we can always just return it).
return scoped_refptr<base::TaskRunner>(BrowserThread::GetBlockingPool()); return scoped_refptr<base::TaskRunner>(BrowserThread::GetBlockingPool());
} }
int32_t FontMessageFilter::OnResourceMessageReceived( int32_t FontMessageFilter::OnResourceMessageReceived(
const IPC::Message& msg, const IPC::Message& msg,
ppapi::host::HostMessageContext* context) { ppapi::host::HostMessageContext* context) {
IPC_BEGIN_MESSAGE_MAP(FontMessageFilter, msg) IPC_BEGIN_MESSAGE_MAP(FontMessageFilter, msg)
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(
PpapiHostMsg_BrowserFontSingleton_GetFontFamilies, PpapiHostMsg_BrowserFontSingleton_GetFontFamilies,
OnHostMsgGetFontFamilies) OnHostMsgGetFontFamilies)
IPC_END_MESSAGE_MAP() IPC_END_MESSAGE_MAP()
return PP_ERROR_FAILED; return PP_ERROR_FAILED;
} }
int32_t FontMessageFilter::OnHostMsgGetFontFamilies( int32_t FontMessageFilter::OnHostMsgGetFontFamilies(
ppapi::host::HostMessageContext* context) { ppapi::host::HostMessageContext* context) {
// OK to use "slow blocking" version since we're on the blocking pool. // OK to use "slow blocking" version since we're on the blocking pool.
scoped_ptr<base::ListValue> list(GetFontList_SlowBlocking()); scoped_ptr<base::ListValue> list(GetFontList_SlowBlocking());
std::string output; std::string output;
for (size_t i = 0; i < list->GetSize(); i++) { for (size_t i = 0; i < list->GetSize(); i++) {
base::ListValue* cur_font; base::ListValue* cur_font;
if (!list->GetList(i, &cur_font)) if (!list->GetList(i, &cur_font))
continue; continue;
// Each entry is actually a list of (font name, localized name). // Each entry is actually a list of (font name, localized name).
// We only care about the regular name. // We only care about the regular name.
std::string font_name; std::string font_name;
if (!cur_font->GetString(0, &font_name)) if (!cur_font->GetString(0, &font_name))
continue; continue;
// Font names are separated with nulls. We also want an explicit null at // Font names are separated with nulls. We also want an explicit null at
// the end of the string (Pepper strings aren't null terminated so since // the end of the string (Pepper strings aren't null terminated so since
// we specify there will be a null, it should actually be in the string). // we specify there will be a null, it should actually be in the string).
output.append(font_name); output.append(font_name);
output.push_back(0); output.push_back(0);
} }
context->reply_msg = context->reply_msg =
PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply(output); PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply(output);
return PP_OK; return PP_OK;
} }
} // namespace } // namespace
PepperBrowserFontSingletonHost::PepperBrowserFontSingletonHost( PepperBrowserFontSingletonHost::PepperBrowserFontSingletonHost(
BrowserPpapiHost* host, BrowserPpapiHost* host,
PP_Instance instance, PP_Instance instance,
PP_Resource resource) PP_Resource resource)
: ResourceHost(host->GetPpapiHost(), instance, resource) { : ResourceHost(host->GetPpapiHost(), instance, resource) {
AddFilter(scoped_refptr<ppapi::host::ResourceMessageFilter>( AddFilter(scoped_refptr<ppapi::host::ResourceMessageFilter>(
new FontMessageFilter())); new FontMessageFilter()));
} }
PepperBrowserFontSingletonHost::~PepperBrowserFontSingletonHost() { PepperBrowserFontSingletonHost::~PepperBrowserFontSingletonHost() {
} }
} // namespace content } // namespace content
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_BROWSER_FONT_SINGLETON_HOST_H_ #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_BROWSER_FONT_SINGLETON_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_BROWSER_FONT_SINGLETON_HOST_H_ #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_BROWSER_FONT_SINGLETON_HOST_H_
#include "base/basictypes.h" #include "base/basictypes.h"
#include "ppapi/host/resource_host.h" #include "ppapi/host/resource_host.h"
namespace content { namespace content {
class BrowserPpapiHost; class BrowserPpapiHost;
class PepperBrowserFontSingletonHost : public ppapi::host::ResourceHost { class PepperBrowserFontSingletonHost : public ppapi::host::ResourceHost {
public: public:
PepperBrowserFontSingletonHost(BrowserPpapiHost* host, PepperBrowserFontSingletonHost(BrowserPpapiHost* host,
PP_Instance instance, PP_Instance instance,
PP_Resource resource); PP_Resource resource);
virtual ~PepperBrowserFontSingletonHost(); virtual ~PepperBrowserFontSingletonHost();
private: private:
DISALLOW_COPY_AND_ASSIGN(PepperBrowserFontSingletonHost); DISALLOW_COPY_AND_ASSIGN(PepperBrowserFontSingletonHost);
}; };
} // namespace content } // namespace content
#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_BROWSER_FONT_SINGLETON_HOST_H_ #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_BROWSER_FONT_SINGLETON_HOST_H_
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// PagedArray implements an array stored using many fixed-size pages. // PagedArray implements an array stored using many fixed-size pages.
// //
// PagedArray is a work-around to allow large arrays to be allocated when there // PagedArray is a work-around to allow large arrays to be allocated when there
// is too much address space fragmentation for allocating the large arrays as // is too much address space fragmentation for allocating the large arrays as
// contigous arrays. // contigous arrays.
#ifndef COURGETTE_BSDIFF_PAGED_ARRAY_H_ #ifndef COURGETTE_BSDIFF_PAGED_ARRAY_H_
#define COURGETTE_BSDIFF_PAGED_ARRAY_H_ #define COURGETTE_BSDIFF_PAGED_ARRAY_H_
// For std::nothrow: // For std::nothrow:
#include <new> #include <new>
#include "base/basictypes.h" #include "base/basictypes.h"
namespace courgette { namespace courgette {
// PagedArray implements an array stored using many fixed-size pages. // PagedArray implements an array stored using many fixed-size pages.
template<typename T> template<typename T>
class PagedArray { class PagedArray {
enum { enum {
// Page size in elements. Page size of 2^18 * sizeof(T) is 1MB for T = int. // Page size in elements. Page size of 2^18 * sizeof(T) is 1MB for T = int.
kLogPageSize = 18, kLogPageSize = 18,
kPageSize = 1 << kLogPageSize kPageSize = 1 << kLogPageSize
}; };
public: public:
PagedArray() : pages_(NULL), page_count_(0) {} PagedArray() : pages_(NULL), page_count_(0) {}
~PagedArray() { clear(); } ~PagedArray() { clear(); }
T& operator[](size_t i) { T& operator[](size_t i) {
size_t page = i >> kLogPageSize; size_t page = i >> kLogPageSize;
size_t offset = i & (kPageSize - 1); size_t offset = i & (kPageSize - 1);
// It is tempting to add a DCHECK(page < page_count_), but that makes // It is tempting to add a DCHECK(page < page_count_), but that makes
// bsdiff_create run 2x slower (even when compiled optimized.) // bsdiff_create run 2x slower (even when compiled optimized.)
return pages_[page][offset]; return pages_[page][offset];
} }
// Allocates storage for |size| elements. Returns true on success and false if // Allocates storage for |size| elements. Returns true on success and false if
// allocation fails. // allocation fails.
bool Allocate(size_t size) { bool Allocate(size_t size) {
clear(); clear();
size_t pages_needed = (size + kPageSize - 1) >> kLogPageSize; size_t pages_needed = (size + kPageSize - 1) >> kLogPageSize;
pages_ = new(std::nothrow) T*[pages_needed]; pages_ = new(std::nothrow) T*[pages_needed];
if (pages_ == NULL) if (pages_ == NULL)
return false; return false;
for (page_count_ = 0; page_count_ < pages_needed; ++page_count_) { for (page_count_ = 0; page_count_ < pages_needed; ++page_count_) {
T* block = new(std::nothrow) T[kPageSize]; T* block = new(std::nothrow) T[kPageSize];
if (block == NULL) { if (block == NULL) {
clear(); clear();
return false; return false;
} }
pages_[page_count_] = block; pages_[page_count_] = block;
} }
return true; return true;
} }
// Releases all storage. May be called more than once. // Releases all storage. May be called more than once.
void clear() { void clear() {
if (pages_ != NULL) { if (pages_ != NULL) {
while (page_count_ != 0) { while (page_count_ != 0) {
--page_count_; --page_count_;
delete[] pages_[page_count_]; delete[] pages_[page_count_];
} }
delete[] pages_; delete[] pages_;
pages_ = NULL; pages_ = NULL;
} }
} }
private: private:
T** pages_; T** pages_;
size_t page_count_; size_t page_count_;
DISALLOW_COPY_AND_ASSIGN(PagedArray); DISALLOW_COPY_AND_ASSIGN(PagedArray);
}; };
} // namespace } // namespace
#endif // COURGETTE_BSDIFF_PAGED_ARRAY_H_ #endif // COURGETTE_BSDIFF_PAGED_ARRAY_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ppapi/proxy/browser_font_singleton_resource.h" #include "ppapi/proxy/browser_font_singleton_resource.h"
#include "ppapi/proxy/ppapi_messages.h" #include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/var.h" #include "ppapi/shared_impl/var.h"
namespace ppapi { namespace ppapi {
namespace proxy { namespace proxy {
BrowserFontSingletonResource::BrowserFontSingletonResource( BrowserFontSingletonResource::BrowserFontSingletonResource(
Connection connection, Connection connection,
PP_Instance instance) PP_Instance instance)
: PluginResource(connection, instance) { : PluginResource(connection, instance) {
SendCreate(BROWSER, PpapiHostMsg_BrowserFontSingleton_Create()); SendCreate(BROWSER, PpapiHostMsg_BrowserFontSingleton_Create());
} }
BrowserFontSingletonResource::~BrowserFontSingletonResource() { BrowserFontSingletonResource::~BrowserFontSingletonResource() {
} }
thunk::PPB_BrowserFont_Singleton_API* thunk::PPB_BrowserFont_Singleton_API*
BrowserFontSingletonResource::AsPPB_BrowserFont_Singleton_API() { BrowserFontSingletonResource::AsPPB_BrowserFont_Singleton_API() {
return this; return this;
} }
PP_Var BrowserFontSingletonResource::GetFontFamilies(PP_Instance instance) { PP_Var BrowserFontSingletonResource::GetFontFamilies(PP_Instance instance) {
if (families_.empty()) { if (families_.empty()) {
SyncCall<PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply>( SyncCall<PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply>(
BROWSER, PpapiHostMsg_BrowserFontSingleton_GetFontFamilies(), BROWSER, PpapiHostMsg_BrowserFontSingleton_GetFontFamilies(),
&families_); &families_);
} }
return StringVar::StringToPPVar(families_); return StringVar::StringToPPVar(families_);
} }
} // namespace proxy } // namespace proxy
} // namespace ppapi } // namespace ppapi
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_ #ifndef PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_
#define PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_ #define PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_
#include "ppapi/proxy/connection.h" #include "ppapi/proxy/connection.h"
#include "ppapi/proxy/plugin_resource.h" #include "ppapi/proxy/plugin_resource.h"
#include "ppapi/thunk/ppb_browser_font_singleton_api.h" #include "ppapi/thunk/ppb_browser_font_singleton_api.h"
namespace ppapi { namespace ppapi {
namespace proxy { namespace proxy {
// This handles the singleton calls (that don't take a PP_Resource parameter) // This handles the singleton calls (that don't take a PP_Resource parameter)
// on the browser font interface // on the browser font interface
class BrowserFontSingletonResource class BrowserFontSingletonResource
: public PluginResource, : public PluginResource,
public thunk::PPB_BrowserFont_Singleton_API { public thunk::PPB_BrowserFont_Singleton_API {
public: public:
BrowserFontSingletonResource(Connection connection, PP_Instance instance); BrowserFontSingletonResource(Connection connection, PP_Instance instance);
virtual ~BrowserFontSingletonResource(); virtual ~BrowserFontSingletonResource();
// Resource override. // Resource override.
virtual thunk::PPB_BrowserFont_Singleton_API* virtual thunk::PPB_BrowserFont_Singleton_API*
AsPPB_BrowserFont_Singleton_API() OVERRIDE; AsPPB_BrowserFont_Singleton_API() OVERRIDE;
// thunk::PPB_BrowserFontSingleton_API implementation. // thunk::PPB_BrowserFontSingleton_API implementation.
virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE; virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE;
private: private:
// Lazily-filled-in list of font families. // Lazily-filled-in list of font families.
std::string families_; std::string families_;
DISALLOW_COPY_AND_ASSIGN(BrowserFontSingletonResource); DISALLOW_COPY_AND_ASSIGN(BrowserFontSingletonResource);
}; };
} // namespace proxy } // namespace proxy
} // namespace ppapi } // namespace ppapi
#endif // PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_ #endif // PPAPI_PROXY_BROWSER_FONT_SINGLETON_RESOURCE_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_ #ifndef PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_
#define PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_ #define PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_
#include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_var.h" #include "ppapi/c/pp_var.h"
#include "ppapi/shared_impl/singleton_resource_id.h" #include "ppapi/shared_impl/singleton_resource_id.h"
namespace ppapi { namespace ppapi {
namespace thunk { namespace thunk {
class PPB_BrowserFont_Singleton_API { class PPB_BrowserFont_Singleton_API {
public: public:
virtual ~PPB_BrowserFont_Singleton_API() {} virtual ~PPB_BrowserFont_Singleton_API() {}
virtual PP_Var GetFontFamilies(PP_Instance instance) = 0; virtual PP_Var GetFontFamilies(PP_Instance instance) = 0;
static const SingletonResourceID kSingletonResourceID = static const SingletonResourceID kSingletonResourceID =
BROWSER_FONT_SINGLETON_ID; BROWSER_FONT_SINGLETON_ID;
}; };
} // namespace thunk } // namespace thunk
} // namespace ppapi } // namespace ppapi
#endif // PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_ #endif // PPAPI_THUNK_PPB_BROWSER_FONT_SINGLETON_API_H_
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
// This file defines utility functions for working with strings. // This file defines utility functions for working with strings.
#ifndef BASE_STRING_UTIL_H_ #ifndef BASE_STRING_UTIL_H_
#define BASE_STRING_UTIL_H_ #define BASE_STRING_UTIL_H_
#include <string.h> #include <string.h>
namespace base { namespace base {
#ifdef WIN32 #ifdef WIN32
// Compare the two strings s1 and s2 without regard to case using // Compare the two strings s1 and s2 without regard to case using
// the current locale; returns 0 if they are equal, 1 if s1 > s2, and -1 if // the current locale; returns 0 if they are equal, 1 if s1 > s2, and -1 if
// s2 > s1 according to a lexicographic comparison. // s2 > s1 according to a lexicographic comparison.
inline int strcasecmp(const char* s1, const char* s2) { inline int strcasecmp(const char* s1, const char* s2) {
return _stricmp(s1, s2); return _stricmp(s1, s2);
} }
#else #else
inline int strcasecmp(const char* s1, const char* s2) { inline int strcasecmp(const char* s1, const char* s2) {
return ::strcasecmp(s1, s2); return ::strcasecmp(s1, s2);
} }
#endif #endif
} }
#endif // BASE_STRING_UTIL_H_ #endif // BASE_STRING_UTIL_H_
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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