Commit d460c016 authored by bratell's avatar bratell Committed by Commit Bot

Avoid "using namespace blink" in global scope

With jumbo (unity builds, merged translation units) a "using blink"
statement intended for just the local translation unit will affect
many other translation units which causes various issues.

There is also (with jumbo) a warning about such usage that will prevent
things from compiling.

Without this patch this file will have to be manually excluded from
jumbo builds and I am trying to avoid such exclusion lists for
performance and maintenance.

Review-Url: https://codereview.chromium.org/2965323002
Cr-Commit-Position: refs/heads/master@{#487501}
parent 6a100c0f
......@@ -287,13 +287,6 @@ blink_core_sources("editing") {
sources += [ "commands/SmartReplaceCF.cpp" ]
}
if (is_mac) {
jumbo_excluded_sources = [
# Using "using blink" in global scope.
"WebSubstringUtil.mm",
]
}
configs += [
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
......
......@@ -58,11 +58,12 @@
#include "public/web/WebHitTestResult.h"
#include "public/web/WebLocalFrame.h"
using namespace blink;
namespace blink {
namespace {
static NSAttributedString* attributedSubstringFromRange(
const EphemeralRange& range,
float fontScale) {
NSAttributedString* attributedSubstringFromRange(const EphemeralRange& range,
float fontScale) {
NSMutableAttributedString* string = [[NSMutableAttributedString alloc] init];
NSMutableDictionary* attrs = [NSMutableDictionary dictionary];
size_t length = range.EndPosition().ComputeOffsetInContainerNode() -
......@@ -149,7 +150,7 @@ WebPoint getBaselinePoint(LocalFrameView* frameView,
return stringPoint;
}
namespace blink {
} // namespace
NSAttributedString* WebSubstringUtil::AttributedWordAtPoint(
WebFrameWidget* frame_widget,
......
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