Skip to content

Commit

Permalink
Remove redundant specification of the |flutter| namespace in the engi…
Browse files Browse the repository at this point in the history
…ne. (flutter#8523)
  • Loading branch information
chinmaygarde authored Apr 10, 2019
1 parent 56052c7 commit 39e1d00
Show file tree
Hide file tree
Showing 45 changed files with 350 additions and 389 deletions.
4 changes: 2 additions & 2 deletions assets/asset_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void AssetManager::PushBack(std::unique_ptr<AssetResolver> resolver) {
resolvers_.push_back(std::move(resolver));
}

// |flutter::AssetResolver|
// |AssetResolver|
std::unique_ptr<fml::Mapping> AssetManager::GetAsMapping(
const std::string& asset_name) const {
if (asset_name.size() == 0) {
Expand All @@ -47,7 +47,7 @@ std::unique_ptr<fml::Mapping> AssetManager::GetAsMapping(
return nullptr;
}

// |flutter::AssetResolver|
// |AssetResolver|
bool AssetManager::IsValid() const {
return resolvers_.size() > 0;
}
Expand Down
4 changes: 2 additions & 2 deletions assets/asset_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class AssetManager final : public AssetResolver {

void PushBack(std::unique_ptr<AssetResolver> resolver);

// |flutter::AssetResolver|
// |AssetResolver|
bool IsValid() const override;

// |flutter::AssetResolver|
// |AssetResolver|
std::unique_ptr<fml::Mapping> GetAsMapping(
const std::string& asset_name) const override;

Expand Down
4 changes: 2 additions & 2 deletions assets/directory_asset_bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ DirectoryAssetBundle::DirectoryAssetBundle(fml::UniqueFD descriptor)

DirectoryAssetBundle::~DirectoryAssetBundle() = default;

// |flutter::AssetResolver|
// |AssetResolver|
bool DirectoryAssetBundle::IsValid() const {
return is_valid_;
}

// |flutter::AssetResolver|
// |AssetResolver|
std::unique_ptr<fml::Mapping> DirectoryAssetBundle::GetAsMapping(
const std::string& asset_name) const {
if (!is_valid_) {
Expand Down
4 changes: 2 additions & 2 deletions assets/directory_asset_bundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class DirectoryAssetBundle : public AssetResolver {
const fml::UniqueFD descriptor_;
bool is_valid_ = false;

// |flutter::AssetResolver|
// |AssetResolver|
bool IsValid() const override;

// |flutter::AssetResolver|
// |AssetResolver|
std::unique_ptr<fml::Mapping> GetAsMapping(
const std::string& asset_name) const override;

Expand Down
4 changes: 2 additions & 2 deletions assets/zip_asset_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ UniqueUnzipper ZipAssetStore::CreateUnzipper() const {
return UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)};
}

// |flutter::AssetResolver|
// |AssetResolver|
bool ZipAssetStore::IsValid() const {
return stat_cache_.size() > 0;
}

// |flutter::AssetResolver|
// |AssetResolver|
std::unique_ptr<fml::Mapping> ZipAssetStore::GetAsMapping(
const std::string& asset_name) const {
TRACE_EVENT1("flutter", "ZipAssetStore::GetAsMapping", "name",
Expand Down
4 changes: 2 additions & 2 deletions assets/zip_asset_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class ZipAssetStore final : public AssetResolver {

mutable std::map<std::string, CacheEntry> stat_cache_;

// |flutter::AssetResolver|
// |AssetResolver|
bool IsValid() const override;

// |flutter::AssetResolver|
// |AssetResolver|
std::unique_ptr<fml::Mapping> GetAsMapping(
const std::string& asset_name) const override;

Expand Down
8 changes: 4 additions & 4 deletions lib/ui/compositing/scene_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

namespace {

using SceneHostBindings = std::unordered_map<zx_koid_t, flutter::SceneHost*>;
using SceneHostBindings = std::unordered_map<zx_koid_t, SceneHost*>;

FML_THREAD_LOCAL fml::ThreadLocal tls_scene_host_bindings([](intptr_t value) {
delete reinterpret_cast<SceneHostBindings*>(value);
});

void SceneHost_constructor(Dart_NativeArguments args) {
tonic::DartCallConstructor(&flutter::SceneHost::Create, args);
tonic::DartCallConstructor(&SceneHost::Create, args);
}

void SceneHost_constructorViewHolderToken(Dart_NativeArguments args) {
Expand All @@ -36,10 +36,10 @@ void SceneHost_constructorViewHolderToken(Dart_NativeArguments args) {
reinterpret_cast<intptr_t>(new SceneHostBindings()));
}

tonic::DartCallConstructor(&flutter::SceneHost::CreateViewHolder, args);
tonic::DartCallConstructor(&SceneHost::CreateViewHolder, args);
}

flutter::SceneHost* GetSceneHost(scenic::ResourceId id) {
SceneHost* GetSceneHost(scenic::ResourceId id) {
auto* bindings =
reinterpret_cast<SceneHostBindings*>(tls_scene_host_bindings.Get());
FML_DCHECK(bindings);
Expand Down
8 changes: 4 additions & 4 deletions lib/ui/painting/rrect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace tonic {
// Construct an SkRRect from a Dart RRect object.
// The Dart RRect is a Float32List containing
// [left, top, right, bottom, xRadius, yRadius]
RRect DartConverter<RRect>::FromDart(Dart_Handle value) {
RRect DartConverter<flutter::RRect>::FromDart(Dart_Handle value) {
Float32List buffer(value);

RRect result;
Expand All @@ -35,9 +35,9 @@ RRect DartConverter<RRect>::FromDart(Dart_Handle value) {
return result;
}

RRect DartConverter<RRect>::FromArguments(Dart_NativeArguments args,
int index,
Dart_Handle& exception) {
RRect DartConverter<flutter::RRect>::FromArguments(Dart_NativeArguments args,
int index,
Dart_Handle& exception) {
Dart_Handle value = Dart_GetNativeArgument(args, index);
FML_DCHECK(!LogIfError(value));
return FromDart(value);
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/text/asset_manager_font_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void MappingReleaseProc(const void* ptr, void* context) {
} // anonymous namespace

AssetManagerFontProvider::AssetManagerFontProvider(
std::shared_ptr<flutter::AssetManager> asset_manager)
std::shared_ptr<AssetManager> asset_manager)
: asset_manager_(asset_manager) {}

AssetManagerFontProvider::~AssetManagerFontProvider() = default;
Expand Down Expand Up @@ -65,7 +65,7 @@ void AssetManagerFontProvider::RegisterAsset(std::string family_name,
}

AssetManagerFontStyleSet::AssetManagerFontStyleSet(
std::shared_ptr<flutter::AssetManager> asset_manager)
std::shared_ptr<AssetManager> asset_manager)
: asset_manager_(asset_manager) {}

AssetManagerFontStyleSet::~AssetManagerFontStyleSet() = default;
Expand Down
8 changes: 3 additions & 5 deletions lib/ui/text/asset_manager_font_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ namespace flutter {

class AssetManagerFontStyleSet : public SkFontStyleSet {
public:
AssetManagerFontStyleSet(
std::shared_ptr<flutter::AssetManager> asset_manager);
AssetManagerFontStyleSet(std::shared_ptr<AssetManager> asset_manager);

~AssetManagerFontStyleSet() override;

Expand All @@ -40,7 +39,7 @@ class AssetManagerFontStyleSet : public SkFontStyleSet {
SkTypeface* matchStyle(const SkFontStyle& pattern) override;

private:
std::shared_ptr<flutter::AssetManager> asset_manager_;
std::shared_ptr<AssetManager> asset_manager_;

struct TypefaceAsset {
TypefaceAsset(std::string a);
Expand All @@ -59,8 +58,7 @@ class AssetManagerFontStyleSet : public SkFontStyleSet {

class AssetManagerFontProvider : public txt::FontAssetProvider {
public:
AssetManagerFontProvider(
std::shared_ptr<flutter::AssetManager> asset_manager);
AssetManagerFontProvider(std::shared_ptr<AssetManager> asset_manager);

~AssetManagerFontProvider() override;

Expand Down
3 changes: 1 addition & 2 deletions lib/ui/text/paragraph_impl_txt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ std::vector<TextBox> ParagraphImplTxt::getRectsForRange(
std::vector<txt::Paragraph::TextBox> boxes = m_paragraph->GetRectsForRange(
start, end, rect_height_style, rect_width_style);
for (const txt::Paragraph::TextBox& box : boxes) {
result.emplace_back(box.rect,
static_cast<flutter::TextDirection>(box.direction));
result.emplace_back(box.rect, static_cast<TextDirection>(box.direction));
}
return result;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/ui/text/text_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Dart_Handle GetTextBoxType() {

} // anonymous namespace

Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
Dart_Handle DartConverter<flutter::TextBox>::ToDart(
const flutter::TextBox& val) {
constexpr int argc = 5;
Dart_Handle argv[argc] = {
tonic::ToDart(val.rect.fLeft),
Expand All @@ -37,7 +38,7 @@ Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
return Dart_New(GetTextBoxType(), tonic::ToDart("_"), argc, argv);
}

Dart_Handle DartListFactory<TextBox>::NewList(intptr_t length) {
Dart_Handle DartListFactory<flutter::TextBox>::NewList(intptr_t length) {
return Dart_NewListOfType(GetTextBoxType(), length);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/window/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Window final {

// We use id 0 to mean that no response is expected.
int next_response_id_ = 1;
std::unordered_map<int, fml::RefPtr<flutter::PlatformMessageResponse>>
std::unordered_map<int, fml::RefPtr<PlatformMessageResponse>>
pending_responses_;
};

Expand Down
9 changes: 4 additions & 5 deletions runtime/dart_isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,8 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate(
return nullptr;
}

flutter::TaskRunners null_task_runners(
"io.flutter." DART_VM_SERVICE_ISOLATE_NAME, nullptr, nullptr, nullptr,
nullptr);
TaskRunners null_task_runners("io.flutter." DART_VM_SERVICE_ISOLATE_NAME,
nullptr, nullptr, nullptr, nullptr);

flags->load_vmservice_library = true;

Expand Down Expand Up @@ -659,8 +658,8 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair(
if (!is_root_isolate) {
auto* raw_embedder_isolate = embedder_isolate.release();

flutter::TaskRunners null_task_runners(advisory_script_uri, nullptr,
nullptr, nullptr, nullptr);
TaskRunners null_task_runners(advisory_script_uri, nullptr, nullptr,
nullptr, nullptr);

embedder_isolate = std::make_unique<std::shared_ptr<DartIsolate>>(
std::make_shared<DartIsolate>(
Expand Down
6 changes: 3 additions & 3 deletions runtime/dart_isolate_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class AutoIsolateShutdown {
public:
AutoIsolateShutdown() = default;

AutoIsolateShutdown(std::shared_ptr<flutter::DartIsolate> isolate,
AutoIsolateShutdown(std::shared_ptr<DartIsolate> isolate,
fml::RefPtr<fml::TaskRunner> runner)
: isolate_(std::move(isolate)), runner_(std::move(runner)) {}

Expand Down Expand Up @@ -131,13 +131,13 @@ class AutoIsolateShutdown {
return true;
}

flutter::DartIsolate* get() {
DartIsolate* get() {
FML_CHECK(isolate_);
return isolate_.get();
}

private:
std::shared_ptr<flutter::DartIsolate> isolate_;
std::shared_ptr<DartIsolate> isolate_;
fml::RefPtr<fml::TaskRunner> runner_;

FML_DISALLOW_COPY_AND_ASSIGN(AutoIsolateShutdown);
Expand Down
17 changes: 8 additions & 9 deletions runtime/dart_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,14 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data,
// the very first frame gives us a good idea about Flutter's startup time.
// Use a duration event so about:tracing will consider this event when
// deciding the earliest event to use as time 0.
if (flutter::engine_main_enter_ts != 0) {
Dart_TimelineEvent(
"FlutterEngineMainEnter", // label
flutter::engine_main_enter_ts, // timestamp0
flutter::engine_main_enter_ts, // timestamp1_or_async_id
Dart_Timeline_Event_Duration, // event type
0, // argument_count
nullptr, // argument_names
nullptr // argument_values
if (engine_main_enter_ts != 0) {
Dart_TimelineEvent("FlutterEngineMainEnter", // label
engine_main_enter_ts, // timestamp0
engine_main_enter_ts, // timestamp1_or_async_id
Dart_Timeline_Event_Duration, // event type
0, // argument_count
nullptr, // argument_names
nullptr // argument_values
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/embedder_resources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace flutter {

using flutter::runtime::ResourcesEntry;
using runtime::ResourcesEntry;

EmbedderResources::EmbedderResources(ResourcesEntry* resources_table)
: resources_table_(resources_table) {}
Expand Down
6 changes: 3 additions & 3 deletions runtime/embedder_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ namespace flutter {

class EmbedderResources {
public:
EmbedderResources(flutter::runtime::ResourcesEntry* resources_table);
EmbedderResources(runtime::ResourcesEntry* resources_table);

static const int kNoSuchInstance;

int ResourceLookup(const char* path, const char** resource);
const char* Path(int idx);

private:
flutter::runtime::ResourcesEntry* At(int idx);
runtime::ResourcesEntry* At(int idx);

flutter::runtime::ResourcesEntry* resources_table_;
runtime::ResourcesEntry* resources_table_;
};

} // namespace flutter
Expand Down
14 changes: 7 additions & 7 deletions runtime/runtime_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,25 +149,25 @@ class RuntimeController final : public WindowClient {

bool FlushRuntimeStateToIsolate();

// |flutter::WindowClient|
// |WindowClient|
std::string DefaultRouteName() override;

// |flutter::WindowClient|
// |WindowClient|
void ScheduleFrame() override;

// |flutter::WindowClient|
// |WindowClient|
void Render(Scene* scene) override;

// |flutter::WindowClient|
// |WindowClient|
void UpdateSemantics(SemanticsUpdate* update) override;

// |flutter::WindowClient|
// |WindowClient|
void HandlePlatformMessage(fml::RefPtr<PlatformMessage> message) override;

// |flutter::WindowClient|
// |WindowClient|
FontCollection& GetFontCollection() override;

// |flutter::WindowClient|
// |WindowClient|
void UpdateIsolateDescription(const std::string isolate_name,
int64_t isolate_port) override;

Expand Down
5 changes: 2 additions & 3 deletions runtime/runtime_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ class RuntimeDelegate {

virtual void Render(std::unique_ptr<flow::LayerTree> layer_tree) = 0;

virtual void UpdateSemantics(
flutter::SemanticsNodeUpdates update,
flutter::CustomAccessibilityActionUpdates actions) = 0;
virtual void UpdateSemantics(SemanticsNodeUpdates update,
CustomAccessibilityActionUpdates actions) = 0;

virtual void HandlePlatformMessage(fml::RefPtr<PlatformMessage> message) = 0;

Expand Down
2 changes: 1 addition & 1 deletion shell/common/animator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ constexpr fml::TimeDelta kNotifyIdleTaskWaitTime =
} // namespace

Animator::Animator(Delegate& delegate,
flutter::TaskRunners task_runners,
TaskRunners task_runners,
std::unique_ptr<VsyncWaiter> waiter)
: delegate_(delegate),
task_runners_(std::move(task_runners)),
Expand Down
Loading

0 comments on commit 39e1d00

Please sign in to comment.