mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Remove a bunch of dead files found by missing_from_gn
I also fixed several errors in our BUILD.gn files including bad script dependencies found by missing_from_gn and gn check. Still need to figure out how best to handle :libraries deps being private to :core, etc. R=abarth@chromium.org Review URL: https://codereview.chromium.org/678703004
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Google Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "bindings/core/v8/V8JavaScriptCallFrame.h"
|
||||
|
||||
#include "bindings/core/v8/V8Binding.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
void V8JavaScriptCallFrame::evaluateWithExceptionDetailsMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
|
||||
String expression = toCoreStringWithUndefinedOrNullCheck(info[0]);
|
||||
v8SetReturnValue(info, impl->evaluateWithExceptionDetails(expression));
|
||||
}
|
||||
|
||||
void V8JavaScriptCallFrame::restartMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
|
||||
v8SetReturnValue(info, impl->restart());
|
||||
}
|
||||
|
||||
void V8JavaScriptCallFrame::scopeChainAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
|
||||
v8SetReturnValue(info, impl->scopeChain());
|
||||
}
|
||||
|
||||
void V8JavaScriptCallFrame::scopeTypeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
|
||||
int scopeIndex = info[0]->Int32Value();
|
||||
v8SetReturnValue(info, impl->scopeType(scopeIndex));
|
||||
}
|
||||
|
||||
void V8JavaScriptCallFrame::thisObjectAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
|
||||
v8SetReturnValue(info, impl->thisObject());
|
||||
}
|
||||
|
||||
void V8JavaScriptCallFrame::returnValueAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
|
||||
v8SetReturnValue(info, impl->returnValue());
|
||||
}
|
||||
|
||||
void V8JavaScriptCallFrame::typeAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
v8SetReturnValue(info, v8AtomicString(info.GetIsolate(), "function"));
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Copyright (C) 2011 Google Inc. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following disclaimer
|
||||
# in the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# * Neither the name of Google Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# This script checks a WebCore static library for potential Objective-C
|
||||
# class name collisions with the system's copy of the WebCore framework.
|
||||
# See the postbuild action that calls it from ../WebCore.gyp for details.
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ $# -ne 2 ]]; then
|
||||
echo "usage: ${0} class_whitelist_pattern category_whitelist_pattern" >& 2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
lib="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}"
|
||||
nm_pattern='[atsATS] ([+-]\[|\.objc_class_name_)'
|
||||
|
||||
class_whitelist_pattern="${1}"
|
||||
category_whitelist_pattern="${2}"
|
||||
|
||||
# Send nm's stderr in the pipeline to /dev/null to avoid spewing
|
||||
# "nm: no name list" messages. This means that if the pipelined nm fails, there
|
||||
# won't be any output, so if the entire assignment fails, run nm again to get
|
||||
# some output.
|
||||
violators=$(nm -p "${lib}" 2> /dev/null | \
|
||||
(grep -E "${nm_pattern}" || true) | \
|
||||
(grep -Ev "${nm_pattern}(${class_whitelist_pattern})" || true) | \
|
||||
(grep -Ev "\((${category_whitelist_pattern})\)" || true)) || nm -p "${lib}"
|
||||
|
||||
if [[ -z "${violators}" ]]; then
|
||||
# An empty list means that everything's clean.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cat << __EOF__ >&2
|
||||
These Objective-C symbols may clash with those provided by the system's own
|
||||
WebCore framework:
|
||||
${violators}
|
||||
|
||||
These symbols were found in:
|
||||
${lib}
|
||||
|
||||
This should be corrected by adding the appropriate definitions to
|
||||
$(dirname ${0})/../WebCore.gyp
|
||||
or by updating the whitelist in
|
||||
${0}
|
||||
__EOF__
|
||||
|
||||
exit 1
|
||||
+13
-14
@@ -12,13 +12,14 @@ rel_sky_core_gen_dir = rebase_path(sky_core_output_dir, root_build_dir)
|
||||
|
||||
source_set("libraries") {
|
||||
deps = [
|
||||
"//base:base",
|
||||
"//gin",
|
||||
"//gpu/command_buffer/client:gles2_c_lib",
|
||||
"//mojo/common",
|
||||
"//mojo/application",
|
||||
"//mojo/common",
|
||||
"//mojo/public/c/system:for_shared_library",
|
||||
"//mojo/public/cpp/bindings",
|
||||
"//mojo/public/cpp/utility",
|
||||
"//mojo/public/c/system:for_shared_library",
|
||||
"//skia",
|
||||
"//sky/engine/wtf",
|
||||
"//third_party/angle:translator",
|
||||
@@ -110,9 +111,6 @@ source_set("core_generated") {
|
||||
|
||||
# Additional .cpp files from the make_core_generated rules.
|
||||
"$sky_core_output_dir/CSSGrammar.cpp",
|
||||
|
||||
# Generated from make_css_property_metadata.py
|
||||
"$sky_core_output_dir/CSSPropertyMetadata.cpp",
|
||||
]
|
||||
|
||||
configs += [
|
||||
@@ -191,20 +189,21 @@ group("core_names") {
|
||||
group("make_core_generated") {
|
||||
deps = [
|
||||
":core_names",
|
||||
":make_core_generated_bison",
|
||||
":make_core_generated_css_property_metadata",
|
||||
":make_core_generated_css_value_keywords",
|
||||
":make_core_generated_event_factory",
|
||||
":make_core_generated_html_element_lookup_trie",
|
||||
":make_core_generated_html_element_type_helpers",
|
||||
":make_core_generated_html_entity_table",
|
||||
":make_core_generated_make_parser",
|
||||
":make_core_generated_make_token_matcher",
|
||||
":make_core_generated_make_token_matcher_for_viewport",
|
||||
":make_core_generated_media_feature_names",
|
||||
":make_core_generated_media_features",
|
||||
":make_core_generated_media_query_tokenizer_codepoints",
|
||||
":make_core_generated_style_property_shorthand",
|
||||
":make_core_generated_style_builder",
|
||||
":make_core_generated_css_value_keywords",
|
||||
":make_core_generated_html_element_type_helpers",
|
||||
":make_core_generated_event_factory",
|
||||
":make_core_generated_make_token_matcher",
|
||||
":make_core_generated_make_parser",
|
||||
":make_core_generated_make_token_matcher_for_viewport",
|
||||
":make_core_generated_html_element_lookup_trie",
|
||||
":make_core_generated_bison",
|
||||
":make_core_generated_style_property_shorthand",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -989,6 +989,8 @@ sky_core_files = [
|
||||
"inspector/IdentifiersFactory.h",
|
||||
"inspector/InspectorTraceEvents.cpp",
|
||||
"inspector/InspectorTraceEvents.h",
|
||||
"inspector/ScriptProfile.cpp",
|
||||
"inspector/ScriptProfile.h",
|
||||
"inspector/ScriptArguments.cpp",
|
||||
"inspector/ScriptArguments.h",
|
||||
"inspector/ScriptAsyncCallStack.cpp",
|
||||
|
||||
@@ -20,4 +20,4 @@ public:
|
||||
|
||||
} // namespace blink
|
||||
|
||||
#endif // CSSPropertyMetadata
|
||||
#endif // CSSPropertyMetadata_h
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Google Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "core/inspector/TraceEventDispatcher.h"
|
||||
|
||||
#include "wtf/CurrentTime.h"
|
||||
#include "wtf/Functional.h"
|
||||
#include "wtf/MainThread.h"
|
||||
#include "wtf/text/StringHash.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
void TraceEventDispatcher::dispatchEventOnAnyThread(char phase, const unsigned char*, const char* name, unsigned long long id,
|
||||
int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
|
||||
unsigned char flags, double timestamp)
|
||||
{
|
||||
TraceEventDispatcher* self = instance();
|
||||
{
|
||||
MutexLocker locker(self->m_mutex);
|
||||
if (self->m_listeners->find(std::make_pair(name, phase)) == self->m_listeners->end())
|
||||
return;
|
||||
}
|
||||
self->enqueueEvent(TraceEvent(timestamp, phase, name, id, currentThread(), numArgs, argNames, argTypes, argValues));
|
||||
if (isMainThread())
|
||||
self->processBackgroundEvents();
|
||||
}
|
||||
|
||||
void TraceEventDispatcher::enqueueEvent(const TraceEvent& event)
|
||||
{
|
||||
const float eventProcessingThresholdInSeconds = 0.1;
|
||||
{
|
||||
MutexLocker locker(m_mutex);
|
||||
m_backgroundEvents.append(event);
|
||||
if (m_processEventsTaskInFlight || event.timestamp() - m_lastEventProcessingTime <= eventProcessingThresholdInSeconds)
|
||||
return;
|
||||
}
|
||||
m_processEventsTaskInFlight = true;
|
||||
callOnMainThread(bind(&TraceEventDispatcher::processBackgroundEventsTask, this));
|
||||
}
|
||||
|
||||
void TraceEventDispatcher::processBackgroundEventsTask()
|
||||
{
|
||||
m_processEventsTaskInFlight = false;
|
||||
processBackgroundEvents();
|
||||
}
|
||||
|
||||
void TraceEventDispatcher::processBackgroundEvents()
|
||||
{
|
||||
ASSERT(isMainThread());
|
||||
Vector<TraceEvent> events;
|
||||
{
|
||||
MutexLocker locker(m_mutex);
|
||||
m_lastEventProcessingTime = WTF::monotonicallyIncreasingTime();
|
||||
if (m_backgroundEvents.isEmpty())
|
||||
return;
|
||||
events.reserveCapacity(m_backgroundEvents.capacity());
|
||||
m_backgroundEvents.swap(events);
|
||||
}
|
||||
for (size_t eventIndex = 0, size = events.size(); eventIndex < size; ++eventIndex) {
|
||||
const TraceEvent& event = events[eventIndex];
|
||||
ListenersMap::iterator it = m_listeners->find(std::make_pair(event.name(), event.phase()));
|
||||
if (it == m_listeners->end())
|
||||
continue;
|
||||
WillBeHeapVector<OwnPtrWillBeMember<TraceEventListener> >& listeners = *it->value.get();
|
||||
for (size_t listenerIndex = 0; listenerIndex < listeners.size(); ++listenerIndex)
|
||||
listeners[listenerIndex]->call(event);
|
||||
}
|
||||
}
|
||||
|
||||
void TraceEventDispatcher::addListener(const char* name, char phase, PassOwnPtrWillBeRawPtr<TraceEventListener> listener, InspectorClient* client)
|
||||
{
|
||||
static const char CategoryFilter[] = "-*," TRACE_DISABLED_BY_DEFAULT("devtools.timeline") "," TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame");
|
||||
|
||||
ASSERT(isMainThread());
|
||||
MutexLocker locker(m_mutex);
|
||||
if (m_listeners->isEmpty())
|
||||
client->setTraceEventCallback(CategoryFilter, dispatchEventOnAnyThread);
|
||||
ListenersMap::iterator it = m_listeners->find(std::make_pair(name, phase));
|
||||
if (it == m_listeners->end())
|
||||
m_listeners->add(std::make_pair(name, phase), adoptPtrWillBeNoop(new WillBeHeapVector<OwnPtrWillBeMember<TraceEventListener> >())).storedValue->value->append(listener);
|
||||
else
|
||||
it->value->append(listener);
|
||||
}
|
||||
|
||||
void TraceEventDispatcher::removeAllListeners(void* eventTarget, InspectorClient* client)
|
||||
{
|
||||
ASSERT(isMainThread());
|
||||
processBackgroundEvents();
|
||||
{
|
||||
MutexLocker locker(m_mutex);
|
||||
|
||||
ListenersMap remainingListeners;
|
||||
for (ListenersMap::iterator it = m_listeners->begin(); it != m_listeners->end(); ++it) {
|
||||
WillBeHeapVector<OwnPtrWillBeMember<TraceEventListener> >& listeners = *it->value.get();
|
||||
for (size_t j = 0; j < listeners.size();) {
|
||||
if (listeners[j]->target() == eventTarget)
|
||||
listeners.remove(j);
|
||||
else
|
||||
++j;
|
||||
}
|
||||
if (!listeners.isEmpty())
|
||||
remainingListeners.add(it->key, it->value.release());
|
||||
}
|
||||
m_listeners->swap(remainingListeners);
|
||||
}
|
||||
if (m_listeners->isEmpty())
|
||||
client->resetTraceEventCallback();
|
||||
}
|
||||
|
||||
size_t TraceEventDispatcher::TraceEvent::findParameter(const char* name) const
|
||||
{
|
||||
for (int i = 0; i < m_argumentCount; ++i) {
|
||||
if (!strcmp(name, m_argumentNames[i]))
|
||||
return i;
|
||||
}
|
||||
return kNotFound;
|
||||
}
|
||||
|
||||
const TraceEvent::TraceValueUnion& TraceEventDispatcher::TraceEvent::parameter(const char* name, unsigned char expectedType) const
|
||||
{
|
||||
static blink::TraceEvent::TraceValueUnion missingValue;
|
||||
size_t index = findParameter(name);
|
||||
ASSERT(isMainThread());
|
||||
if (index == kNotFound || m_argumentTypes[index] != expectedType) {
|
||||
ASSERT_NOT_REACHED();
|
||||
return missingValue;
|
||||
}
|
||||
return m_argumentValues[index];
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Google Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef TraceEventDispatcher_h
|
||||
#define TraceEventDispatcher_h
|
||||
|
||||
#include "platform/TraceEvent.h"
|
||||
#include "platform/heap/Handle.h"
|
||||
#include "wtf/HashMap.h"
|
||||
#include "wtf/Threading.h"
|
||||
#include "wtf/ThreadingPrimitives.h"
|
||||
#include "wtf/Vector.h"
|
||||
#include "wtf/text/StringHash.h"
|
||||
#include "wtf/text/WTFString.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
class InspectorClient;
|
||||
|
||||
class TraceEventDispatcher {
|
||||
WTF_MAKE_NONCOPYABLE(TraceEventDispatcher);
|
||||
public:
|
||||
class TraceEvent {
|
||||
public:
|
||||
TraceEvent()
|
||||
: m_name(0)
|
||||
, m_argumentCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
TraceEvent(double timestamp, char phase, const char* name, unsigned long long id, ThreadIdentifier threadIdentifier,
|
||||
int argumentCount, const char* const* argumentNames, const unsigned char* argumentTypes, const unsigned long long* argumentValues)
|
||||
: m_timestamp(timestamp)
|
||||
, m_phase(phase)
|
||||
, m_name(name)
|
||||
, m_id(id)
|
||||
, m_threadIdentifier(threadIdentifier)
|
||||
, m_argumentCount(argumentCount)
|
||||
{
|
||||
if (m_argumentCount > MaxArguments) {
|
||||
ASSERT_NOT_REACHED();
|
||||
m_argumentCount = MaxArguments;
|
||||
}
|
||||
for (int i = 0; i < m_argumentCount; ++i) {
|
||||
m_argumentNames[i] = argumentNames[i];
|
||||
if (argumentTypes[i] == TRACE_VALUE_TYPE_COPY_STRING) {
|
||||
m_stringArguments[i] = reinterpret_cast<const char*>(argumentValues[i]);
|
||||
m_argumentValues[i].m_string = reinterpret_cast<const char*>(m_stringArguments[i].characters8());
|
||||
m_argumentTypes[i] = TRACE_VALUE_TYPE_STRING;
|
||||
} else {
|
||||
m_argumentValues[i].m_int = argumentValues[i];
|
||||
m_argumentTypes[i] = argumentTypes[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double timestamp() const { return m_timestamp; }
|
||||
char phase() const { return m_phase; }
|
||||
const char* name() const { return m_name; }
|
||||
unsigned long long id() const { return m_id; }
|
||||
ThreadIdentifier threadIdentifier() const { return m_threadIdentifier; }
|
||||
int argumentCount() const { return m_argumentCount; }
|
||||
bool isNull() const { return !m_name; }
|
||||
|
||||
bool asBool(const char* name) const
|
||||
{
|
||||
return parameter(name, TRACE_VALUE_TYPE_BOOL).m_bool;
|
||||
}
|
||||
long long asInt(const char* name) const
|
||||
{
|
||||
size_t index = findParameter(name);
|
||||
if (index == kNotFound || (m_argumentTypes[index] != TRACE_VALUE_TYPE_INT && m_argumentTypes[index] != TRACE_VALUE_TYPE_UINT)) {
|
||||
ASSERT_NOT_REACHED();
|
||||
return 0;
|
||||
}
|
||||
return reinterpret_cast<const blink::TraceEvent::TraceValueUnion*>(m_argumentValues + index)->m_int;
|
||||
}
|
||||
unsigned long long asUInt(const char* name) const
|
||||
{
|
||||
return asInt(name);
|
||||
}
|
||||
double asDouble(const char* name) const
|
||||
{
|
||||
return parameter(name, TRACE_VALUE_TYPE_DOUBLE).m_double;
|
||||
}
|
||||
const char* asString(const char* name) const
|
||||
{
|
||||
return parameter(name, TRACE_VALUE_TYPE_STRING).m_string;
|
||||
}
|
||||
|
||||
private:
|
||||
enum { MaxArguments = 2 };
|
||||
|
||||
size_t findParameter(const char*) const;
|
||||
const blink::TraceEvent::TraceValueUnion& parameter(const char* name, unsigned char expectedType) const;
|
||||
|
||||
double m_timestamp;
|
||||
char m_phase;
|
||||
const char* m_name;
|
||||
unsigned long long m_id;
|
||||
ThreadIdentifier m_threadIdentifier;
|
||||
int m_argumentCount;
|
||||
const char* m_argumentNames[MaxArguments];
|
||||
unsigned char m_argumentTypes[MaxArguments];
|
||||
blink::TraceEvent::TraceValueUnion m_argumentValues[MaxArguments];
|
||||
// These are only used as buffers for TRACE_VALUE_TYPE_COPY_STRING.
|
||||
// Consider allocating the entire vector of buffered trace events and their copied arguments out of a special arena
|
||||
// to make things more compact.
|
||||
String m_stringArguments[MaxArguments];
|
||||
};
|
||||
|
||||
class TraceEventListener : public NoBaseWillBeGarbageCollected<TraceEventListener> {
|
||||
public:
|
||||
#if !ENABLE(OILPAN)
|
||||
virtual ~TraceEventListener() { }
|
||||
#endif
|
||||
virtual void call(const TraceEventDispatcher::TraceEvent&) = 0;
|
||||
virtual void* target() = 0;
|
||||
virtual void trace(Visitor*) { }
|
||||
};
|
||||
|
||||
static TraceEventDispatcher* instance()
|
||||
{
|
||||
DEFINE_STATIC_LOCAL(TraceEventDispatcher, instance, ());
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void addListener(const char* name, char phase, PassOwnPtrWillBeRawPtr<TraceEventListener>, InspectorClient*);
|
||||
|
||||
void removeAllListeners(void*, InspectorClient*);
|
||||
void processBackgroundEvents();
|
||||
|
||||
private:
|
||||
typedef std::pair<String, int> EventSelector;
|
||||
typedef WillBeHeapHashMap<EventSelector, OwnPtrWillBeMember<WillBeHeapVector<OwnPtrWillBeMember<TraceEventListener> > > > ListenersMap;
|
||||
|
||||
TraceEventDispatcher()
|
||||
: m_listeners(adoptPtrWillBeNoop(new ListenersMap()))
|
||||
, m_processEventsTaskInFlight(false)
|
||||
, m_lastEventProcessingTime(0)
|
||||
{
|
||||
}
|
||||
|
||||
static void dispatchEventOnAnyThread(char phase, const unsigned char*, const char* name, unsigned long long id,
|
||||
int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
|
||||
unsigned char flags, double timestamp);
|
||||
|
||||
void enqueueEvent(const TraceEvent&);
|
||||
void processBackgroundEventsTask();
|
||||
|
||||
Mutex m_mutex;
|
||||
OwnPtrWillBePersistent<ListenersMap> m_listeners;
|
||||
Vector<TraceEvent> m_backgroundEvents;
|
||||
bool m_processEventsTaskInFlight;
|
||||
double m_lastEventProcessingTime;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
||||
#endif // TraceEventDispatcher_h
|
||||
@@ -212,7 +212,6 @@ component("platform") {
|
||||
"clipboard/ClipboardUtilities.cpp",
|
||||
"clipboard/ClipboardUtilities.h",
|
||||
"clipboard/ClipboardUtilitiesPosix.cpp",
|
||||
"clipboard/ClipboardUtilitiesWin.cpp",
|
||||
"exported/Platform.cpp",
|
||||
"exported/WebActiveGestureAnimation.cpp",
|
||||
"exported/WebActiveGestureAnimation.h",
|
||||
@@ -306,8 +305,6 @@ component("platform") {
|
||||
"fonts/opentype/OpenTypeSanitizer.cpp",
|
||||
"fonts/opentype/OpenTypeSanitizer.h",
|
||||
"fonts/opentype/OpenTypeTypes.h",
|
||||
"fonts/opentype/OpenTypeUtilities.cpp",
|
||||
"fonts/opentype/OpenTypeUtilities.h",
|
||||
"fonts/opentype/OpenTypeVerticalData.cpp",
|
||||
"fonts/opentype/OpenTypeVerticalData.h",
|
||||
"fonts/skia/FontCacheSkia.cpp",
|
||||
@@ -582,8 +579,6 @@ component("platform") {
|
||||
"text/LocaleICU.h",
|
||||
"text/LocaleToScriptMapping.cpp",
|
||||
"text/LocaleToScriptMapping.h",
|
||||
"text/LocaleWin.cpp",
|
||||
"text/LocaleWin.h",
|
||||
"text/NonCJKGlyphOrientation.h",
|
||||
"text/ParserUtilities.h",
|
||||
"text/PlatformLocale.cpp",
|
||||
@@ -715,26 +710,6 @@ component("platform") {
|
||||
"fonts/harfbuzz/HarfBuzzFaceCoreText.cpp",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
sources -= [
|
||||
# Uses LocaleWin instead.
|
||||
"text/LocaleICU.cpp",
|
||||
"text/LocaleICU.h",
|
||||
]
|
||||
cflags = [
|
||||
"/wd4267", # Conversion from 'size_t' to 'type', possible loss of data.
|
||||
"/wd4334", # Result of 32-bit shift implicitly converted to 64 bits.
|
||||
"/wd4724", # Modulo by 0.
|
||||
]
|
||||
} else {
|
||||
sources -= [
|
||||
"clipboard/ClipboardUtilitiesWin.cpp",
|
||||
"fonts/opentype/OpenTypeUtilities.cpp",
|
||||
"fonts/opentype/OpenTypeUtilities.h",
|
||||
"text/LocaleWin.cpp",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
# Add in some Linux files also shared with Android.
|
||||
set_sources_assignment_filter([])
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Apple Inc. All rights reserved.
|
||||
* Copyright (C) 2009 Google Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "platform/clipboard/ClipboardUtilities.h"
|
||||
|
||||
#include "wtf/text/StringBuilder.h"
|
||||
#include "wtf/text/WTFString.h"
|
||||
|
||||
#include <shlwapi.h>
|
||||
|
||||
namespace blink {
|
||||
|
||||
// FAT32 and NTFS both limit filenames to a maximum of 255 characters.
|
||||
static const unsigned maxFilenameLength = 255;
|
||||
|
||||
// Returns true if the specified character is not valid in a file name. This
|
||||
// is intended for use with removeCharacters.
|
||||
static bool isInvalidFileCharacter(UChar c)
|
||||
{
|
||||
return !(PathGetCharType(c) & (GCT_LFNCHAR | GCT_SHORTCHAR));
|
||||
}
|
||||
|
||||
void replaceNewlinesWithWindowsStyleNewlines(String& str)
|
||||
{
|
||||
DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n"));
|
||||
StringBuilder result;
|
||||
for (unsigned index = 0; index < str.length(); ++index) {
|
||||
if (str[index] != '\n' || (index > 0 && str[index - 1] == '\r'))
|
||||
result.append(str[index]);
|
||||
else
|
||||
result.append(windowsNewline);
|
||||
}
|
||||
str = result.toString();
|
||||
}
|
||||
|
||||
void validateFilename(String& name, String& extension)
|
||||
{
|
||||
// Remove any invalid file system characters.
|
||||
name = name.removeCharacters(&isInvalidFileCharacter);
|
||||
extension = extension.removeCharacters(&isInvalidFileCharacter);
|
||||
|
||||
if (extension.length() >= maxFilenameLength)
|
||||
extension = String();
|
||||
|
||||
// Truncate overly-long filenames, reserving one character for a dot.
|
||||
name.truncate(maxFilenameLength - extension.length() - 1);
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
|
||||
* Copyright (C) 2009 Torch Mobile, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "platform/fonts/opentype/OpenTypeUtilities.h"
|
||||
|
||||
#include "platform/SharedBuffer.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
struct BigEndianUShort {
|
||||
operator unsigned short() const { return (v & 0x00ff) << 8 | v >> 8; }
|
||||
BigEndianUShort(unsigned short u) : v((u & 0x00ff) << 8 | u >> 8) { }
|
||||
unsigned short v;
|
||||
};
|
||||
|
||||
struct BigEndianULong {
|
||||
operator unsigned() const { return (v & 0xff) << 24 | (v & 0xff00) << 8 | (v & 0xff0000) >> 8 | v >> 24; }
|
||||
BigEndianULong(unsigned u) : v((u & 0xff) << 24 | (u & 0xff00) << 8 | (u & 0xff0000) >> 8 | u >> 24) { }
|
||||
unsigned v;
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
struct TableDirectoryEntry {
|
||||
BigEndianULong tag;
|
||||
BigEndianULong checkSum;
|
||||
BigEndianULong offset;
|
||||
BigEndianULong length;
|
||||
};
|
||||
|
||||
// Fixed type is not defined on non-CG and Windows platforms. |version| in sfntHeader
|
||||
// and headTable and |fontRevision| in headTable are of Fixed, but they're
|
||||
// not actually refered to anywhere. Therefore, we just have to match
|
||||
// the size (4 bytes). For the definition of Fixed type, see
|
||||
// http://developer.apple.com/documentation/mac/Legacy/GXEnvironment/GXEnvironment-356.html#HEADING356-6.
|
||||
typedef int32_t Fixed;
|
||||
|
||||
struct sfntHeader {
|
||||
Fixed version;
|
||||
BigEndianUShort numTables;
|
||||
BigEndianUShort searchRange;
|
||||
BigEndianUShort entrySelector;
|
||||
BigEndianUShort rangeShift;
|
||||
TableDirectoryEntry tables[1];
|
||||
};
|
||||
|
||||
struct OS2Table {
|
||||
BigEndianUShort version;
|
||||
BigEndianUShort avgCharWidth;
|
||||
BigEndianUShort weightClass;
|
||||
BigEndianUShort widthClass;
|
||||
BigEndianUShort fsType;
|
||||
BigEndianUShort subscriptXSize;
|
||||
BigEndianUShort subscriptYSize;
|
||||
BigEndianUShort subscriptXOffset;
|
||||
BigEndianUShort subscriptYOffset;
|
||||
BigEndianUShort superscriptXSize;
|
||||
BigEndianUShort superscriptYSize;
|
||||
BigEndianUShort superscriptXOffset;
|
||||
BigEndianUShort superscriptYOffset;
|
||||
BigEndianUShort strikeoutSize;
|
||||
BigEndianUShort strikeoutPosition;
|
||||
BigEndianUShort familyClass;
|
||||
uint8_t panose[10];
|
||||
BigEndianULong unicodeRange[4];
|
||||
uint8_t vendID[4];
|
||||
BigEndianUShort fsSelection;
|
||||
BigEndianUShort firstCharIndex;
|
||||
BigEndianUShort lastCharIndex;
|
||||
BigEndianUShort typoAscender;
|
||||
BigEndianUShort typoDescender;
|
||||
BigEndianUShort typoLineGap;
|
||||
BigEndianUShort winAscent;
|
||||
BigEndianUShort winDescent;
|
||||
BigEndianULong codePageRange[2];
|
||||
BigEndianUShort xHeight;
|
||||
BigEndianUShort capHeight;
|
||||
BigEndianUShort defaultChar;
|
||||
BigEndianUShort breakChar;
|
||||
BigEndianUShort maxContext;
|
||||
};
|
||||
|
||||
struct headTable {
|
||||
Fixed version;
|
||||
Fixed fontRevision;
|
||||
BigEndianULong checkSumAdjustment;
|
||||
BigEndianULong magicNumber;
|
||||
BigEndianUShort flags;
|
||||
BigEndianUShort unitsPerEm;
|
||||
long long created;
|
||||
long long modified;
|
||||
BigEndianUShort xMin;
|
||||
BigEndianUShort xMax;
|
||||
BigEndianUShort yMin;
|
||||
BigEndianUShort yMax;
|
||||
BigEndianUShort macStyle;
|
||||
BigEndianUShort lowestRectPPEM;
|
||||
BigEndianUShort fontDirectionHint;
|
||||
BigEndianUShort indexToLocFormat;
|
||||
BigEndianUShort glyphDataFormat;
|
||||
};
|
||||
|
||||
struct nameRecord {
|
||||
BigEndianUShort platformID;
|
||||
BigEndianUShort encodingID;
|
||||
BigEndianUShort languageID;
|
||||
BigEndianUShort nameID;
|
||||
BigEndianUShort length;
|
||||
BigEndianUShort offset;
|
||||
};
|
||||
|
||||
struct nameTable {
|
||||
BigEndianUShort format;
|
||||
BigEndianUShort count;
|
||||
BigEndianUShort stringOffset;
|
||||
nameRecord nameRecords[1];
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
// adds fontName to the font table in fontData, and writes the new font table to rewrittenFontTable
|
||||
// returns the size of the name table (which is used by renameAndActivateFont), or 0 on early abort
|
||||
static size_t renameFont(SharedBuffer* fontData, const String& fontName, Vector<char> &rewrittenFontData)
|
||||
{
|
||||
size_t originalDataSize = fontData->size();
|
||||
const sfntHeader* sfnt = reinterpret_cast<const sfntHeader*>(fontData->data());
|
||||
|
||||
unsigned t;
|
||||
for (t = 0; t < sfnt->numTables; ++t) {
|
||||
if (sfnt->tables[t].tag == 'name')
|
||||
break;
|
||||
}
|
||||
if (t == sfnt->numTables)
|
||||
return 0;
|
||||
|
||||
const int nameRecordCount = 5;
|
||||
|
||||
// Rounded up to a multiple of 4 to simplify the checksum calculation.
|
||||
size_t nameTableSize = ((offsetof(nameTable, nameRecords) + nameRecordCount * sizeof(nameRecord) + fontName.length() * sizeof(UChar)) & ~3) + 4;
|
||||
|
||||
rewrittenFontData.resize(fontData->size() + nameTableSize);
|
||||
char* data = rewrittenFontData.data();
|
||||
memcpy(data, fontData->data(), originalDataSize);
|
||||
|
||||
// Make the table directory entry point to the new 'name' table.
|
||||
sfntHeader* rewrittenSfnt = reinterpret_cast<sfntHeader*>(data);
|
||||
rewrittenSfnt->tables[t].length = nameTableSize;
|
||||
rewrittenSfnt->tables[t].offset = originalDataSize;
|
||||
|
||||
// Write the new 'name' table after the original font data.
|
||||
nameTable* name = reinterpret_cast<nameTable*>(data + originalDataSize);
|
||||
name->format = 0;
|
||||
name->count = nameRecordCount;
|
||||
name->stringOffset = offsetof(nameTable, nameRecords) + nameRecordCount * sizeof(nameRecord);
|
||||
for (unsigned i = 0; i < nameRecordCount; ++i) {
|
||||
name->nameRecords[i].platformID = 3;
|
||||
name->nameRecords[i].encodingID = 1;
|
||||
name->nameRecords[i].languageID = 0x0409;
|
||||
name->nameRecords[i].offset = 0;
|
||||
name->nameRecords[i].length = fontName.length() * sizeof(UChar);
|
||||
}
|
||||
|
||||
// The required 'name' record types: Family, Style, Unique, Full and PostScript.
|
||||
name->nameRecords[0].nameID = 1;
|
||||
name->nameRecords[1].nameID = 2;
|
||||
name->nameRecords[2].nameID = 3;
|
||||
name->nameRecords[3].nameID = 4;
|
||||
name->nameRecords[4].nameID = 6;
|
||||
|
||||
for (unsigned i = 0; i < fontName.length(); ++i)
|
||||
reinterpret_cast<BigEndianUShort*>(data + originalDataSize + name->stringOffset)[i] = fontName[i];
|
||||
|
||||
// Update the table checksum in the directory entry.
|
||||
rewrittenSfnt->tables[t].checkSum = 0;
|
||||
for (unsigned i = 0; i * sizeof(BigEndianULong) < nameTableSize; ++i)
|
||||
rewrittenSfnt->tables[t].checkSum = rewrittenSfnt->tables[t].checkSum + reinterpret_cast<BigEndianULong*>(name)[i];
|
||||
|
||||
return nameTableSize;
|
||||
}
|
||||
|
||||
// Rename the font and install the new font data into the system
|
||||
HANDLE renameAndActivateFont(SharedBuffer* fontData, const String& fontName)
|
||||
{
|
||||
Vector<char> rewrittenFontData;
|
||||
size_t nameTableSize = renameFont(fontData, fontName, rewrittenFontData);
|
||||
if (!nameTableSize)
|
||||
return 0;
|
||||
|
||||
DWORD numFonts = 0;
|
||||
HANDLE fontHandle = AddFontMemResourceEx(rewrittenFontData.data(), fontData->size() + nameTableSize, 0, &numFonts);
|
||||
|
||||
if (fontHandle && numFonts < 1) {
|
||||
RemoveFontMemResourceEx(fontHandle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return fontHandle;
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
|
||||
* Copyright (C) 2009 Torch Mobile, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef OpenTypeUtilities_h
|
||||
#define OpenTypeUtilities_h
|
||||
|
||||
#include <windows.h>
|
||||
#include "wtf/text/WTFString.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
class SharedBuffer;
|
||||
|
||||
HANDLE renameAndActivateFont(SharedBuffer*, const String&);
|
||||
|
||||
} // namespace blink
|
||||
|
||||
#endif // OpenTypeUtilities_h
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,11 +23,9 @@ def stripped_lines_from_command(cmd, cwd=None):
|
||||
def gn_desc(*args):
|
||||
# GN doesn't understand absolute paths yet, so use a relative BUILD_DIR
|
||||
# and pass ROOT_DIR as the CWD.
|
||||
cmd = [
|
||||
'gn', 'desc',
|
||||
# Hard-coding Debug for now:
|
||||
os.path.join('out', 'Debug'),
|
||||
] + list(args)
|
||||
# Hard-coding Debug for now:
|
||||
BUILD_DIR = '//out/Debug' # // means repository root-relative.
|
||||
cmd = ['gn', 'desc', BUILD_DIR] + list(args)
|
||||
return stripped_lines_from_command(cmd, cwd=ROOT_DIR)
|
||||
|
||||
|
||||
@@ -40,7 +38,9 @@ def used_files(target):
|
||||
logging.info(target)
|
||||
sources = map(lambda s: s[2:], gn_desc(target, 'sources'))
|
||||
inputs = map(lambda s: s[2:], gn_desc(target, 'inputs'))
|
||||
return sources + inputs
|
||||
public = map(lambda s: s[2:], gn_desc(target, 'public'))
|
||||
script = map(lambda s: s[2:], gn_desc(target, 'script'))
|
||||
return sources + inputs + public + script
|
||||
|
||||
|
||||
def find_on_disk(path):
|
||||
|
||||
Reference in New Issue
Block a user