diff --git a/src/base/BUILD.bazel b/src/base/BUILD.bazel index f3bfdd0c6..f121b3401 100644 --- a/src/base/BUILD.bazel +++ b/src/base/BUILD.bazel @@ -644,19 +644,12 @@ cc_test_mozc( ], ) -cc_library_mozc( - name = "mmap_sync_interface", - hdrs = ["mmap_sync_interface.h"], - visibility = ["//visibility:private"], -) - cc_library_mozc( name = "mmap", srcs = ["mmap.cc"], hdrs = ["mmap.h"], deps = [ ":logging", - ":mmap_sync_interface", ":port", ":scoped_handle", ":util", diff --git a/src/base/mmap.h b/src/base/mmap.h index 93b52642b..f7ced76fe 100644 --- a/src/base/mmap.h +++ b/src/base/mmap.h @@ -30,18 +30,18 @@ #ifndef MOZC_BASE_MMAP_H_ #define MOZC_BASE_MMAP_H_ -#include - -#include "base/mmap_sync_interface.h" -#include "base/port.h" - +#include namespace mozc { -class Mmap : public MmapSyncInterface { +class Mmap final { public: Mmap(); - ~Mmap() override { Close(); } + + Mmap(const Mmap &) = delete; + Mmap &operator=(const Mmap &) = delete; + + ~Mmap() { Close(); } bool Open(const char *filename, const char *mode = "r"); void Close(); @@ -73,8 +73,6 @@ class Mmap : public MmapSyncInterface { private: char *text_; size_t size_; - - DISALLOW_COPY_AND_ASSIGN(Mmap); }; } // namespace mozc diff --git a/src/base/mmap_sync_interface.h b/src/base/mmap_sync_interface.h deleted file mode 100644 index 907a38c3c..000000000 --- a/src/base/mmap_sync_interface.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2010-2021, 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 MOZC_BASE_MMAP_SYNC_INTERFACE_H_ -#define MOZC_BASE_MMAP_SYNC_INTERFACE_H_ - -namespace mozc { - -// This interface is used to resolve a cyclic dependency between PepperFileUtil -// and Mmap. -class MmapSyncInterface { - public: - virtual ~MmapSyncInterface() {} -}; - -} // namespace mozc - -#endif // MOZC_BASE_MMAP_SYNC_INTERFACE_H_