Introduce QUIC_NO_EXPORT

This CL replaces the /*QUIC_EXPORT_PRIVATE*/ annotation with QUIC_NO_EXPORT and changes the presubmit to allow that.

QUIC_NO_EXPORT was added to Chromium via:
https://chromium-review.googlesource.com/c/chromium/src/+/1885392

gfe-relnote: n/a, comment-only change
PiperOrigin-RevId: 277332771
Change-Id: I2badefc67bae486e5908925daeecb6886b174532
diff --git a/quic/core/chlo_extractor.h b/quic/core/chlo_extractor.h
index 7d6d17d..89dffe1 100644
--- a/quic/core/chlo_extractor.h
+++ b/quic/core/chlo_extractor.h
@@ -12,9 +12,9 @@
 
 // A utility for extracting QUIC Client Hello messages from packets,
 // without needs to spin up a full QuicSession.
-class /*QUIC_EXPORT_PRIVATE*/ ChloExtractor {
+class QUIC_NO_EXPORT ChloExtractor {
  public:
-  class /*QUIC_EXPORT_PRIVATE*/ Delegate {
+  class QUIC_NO_EXPORT Delegate {
    public:
     virtual ~Delegate() {}
 
diff --git a/quic/core/http/quic_spdy_client_session.h b/quic/core/http/quic_spdy_client_session.h
index cf2bad9..b3def0a 100644
--- a/quic/core/http/quic_spdy_client_session.h
+++ b/quic/core/http/quic_spdy_client_session.h
@@ -20,8 +20,7 @@
 class QuicConnection;
 class QuicServerId;
 
-class /*QUIC_EXPORT_PRIVATE*/ QuicSpdyClientSession
-    : public QuicSpdyClientSessionBase {
+class QUIC_NO_EXPORT QuicSpdyClientSession : public QuicSpdyClientSessionBase {
  public:
   // Takes ownership of |connection|. Caller retains ownership of
   // |promised_by_url|.
diff --git a/quic/core/http/quic_spdy_client_stream.h b/quic/core/http/quic_spdy_client_stream.h
index d914506..5cd27d4 100644
--- a/quic/core/http/quic_spdy_client_stream.h
+++ b/quic/core/http/quic_spdy_client_stream.h
@@ -19,7 +19,7 @@
 
 // All this does right now is send an SPDY request, and aggregate the
 // SPDY response.
-class /*QUIC_EXPORT_PRIVATE*/ QuicSpdyClientStream : public QuicSpdyStream {
+class QUIC_NO_EXPORT QuicSpdyClientStream : public QuicSpdyStream {
  public:
   QuicSpdyClientStream(QuicStreamId id,
                        QuicSpdyClientSession* session,
diff --git a/quic/core/http/quic_spdy_server_stream_base.h b/quic/core/http/quic_spdy_server_stream_base.h
index 9d79bca..b66b459 100644
--- a/quic/core/http/quic_spdy_server_stream_base.h
+++ b/quic/core/http/quic_spdy_server_stream_base.h
@@ -9,7 +9,7 @@
 
 namespace quic {
 
-class /*QUIC_EXPORT_PRIVATE*/ QuicSpdyServerStreamBase : public QuicSpdyStream {
+class QUIC_NO_EXPORT QuicSpdyServerStreamBase : public QuicSpdyStream {
  public:
   QuicSpdyServerStreamBase(QuicStreamId id,
                            QuicSpdySession* session,
diff --git a/quic/core/packet_number_indexed_queue.h b/quic/core/packet_number_indexed_queue.h
index 823d9b7..470a58c 100644
--- a/quic/core/packet_number_indexed_queue.h
+++ b/quic/core/packet_number_indexed_queue.h
@@ -35,7 +35,7 @@
 // Because of that, it is not a general-purpose container and should not be used
 // as one.
 template <typename T>
-class /*QUIC_EXPORT_PRIVATE*/ PacketNumberIndexedQueue {
+class QUIC_NO_EXPORT PacketNumberIndexedQueue {
  public:
   PacketNumberIndexedQueue() : number_of_present_entries_(0) {}
 
@@ -86,7 +86,7 @@
 
  private:
   // Wrapper around T used to mark whether the entry is actually in the map.
-  struct /*QUIC_EXPORT_PRIVATE*/ EntryWrapper : T {
+  struct QUIC_NO_EXPORT EntryWrapper : T {
     bool present;
 
     EntryWrapper() : present(false) {}
diff --git a/quic/core/quic_arena_scoped_ptr.h b/quic/core/quic_arena_scoped_ptr.h
index 938ae71..92da3db 100644
--- a/quic/core/quic_arena_scoped_ptr.h
+++ b/quic/core/quic_arena_scoped_ptr.h
@@ -20,7 +20,7 @@
 namespace quic {
 
 template <typename T>
-class /*QUIC_EXPORT_PRIVATE*/ QuicArenaScopedPtr {
+class QUIC_NO_EXPORT QuicArenaScopedPtr {
   static_assert(QUIC_ALIGN_OF(T*) > 1,
                 "QuicArenaScopedPtr can only store objects that are aligned to "
                 "greater than 1 byte.");
diff --git a/quic/core/quic_dispatcher.h b/quic/core/quic_dispatcher.h
index 4c52c5c..e1279fe 100644
--- a/quic/core/quic_dispatcher.h
+++ b/quic/core/quic_dispatcher.h
@@ -34,7 +34,7 @@
 class QuicConfig;
 class QuicCryptoServerConfig;
 
-class /*QUIC_EXPORT_PRIVATE*/ QuicDispatcher
+class QUIC_NO_EXPORT QuicDispatcher
     : public QuicTimeWaitListManager::Visitor,
       public ProcessPacketInterface,
       public QuicBufferedPacketStore::VisitorInterface {
diff --git a/quic/core/quic_interval.h b/quic/core/quic_interval.h
index c2e9033..9e87ecd 100644
--- a/quic/core/quic_interval.h
+++ b/quic/core/quic_interval.h
@@ -68,14 +68,14 @@
 namespace quic {
 
 template <typename T>
-class /*QUIC_EXPORT_PRIVATE*/ QuicInterval {
+class QUIC_NO_EXPORT QuicInterval {
  private:
   // Type trait for deriving the return type for QuicInterval::Length.  If
   // operator-() is not defined for T, then the return type is void.  This makes
   // the signature for Length compile so that the class can be used for such T,
   // but code that calls Length would still generate a compilation error.
   template <typename U>
-  class /*QUIC_EXPORT_PRIVATE*/ DiffTypeOrVoid {
+  class QUIC_NO_EXPORT DiffTypeOrVoid {
    private:
     template <typename V>
     static auto f(const V* v) -> decltype(*v - *v);
diff --git a/quic/core/quic_interval_set.h b/quic/core/quic_interval_set.h
index ea28367..0465a01 100644
--- a/quic/core/quic_interval_set.h
+++ b/quic/core/quic_interval_set.h
@@ -65,12 +65,12 @@
 namespace quic {
 
 template <typename T>
-class /*QUIC_EXPORT_PRIVATE*/ QuicIntervalSet {
+class QUIC_NO_EXPORT QuicIntervalSet {
  public:
   typedef QuicInterval<T> value_type;
 
  private:
-  struct /*QUIC_EXPORT_PRIVATE*/ IntervalLess {
+  struct QUIC_NO_EXPORT IntervalLess {
     bool operator()(const value_type& a, const value_type& b) const;
   };
   typedef std::set<value_type, IntervalLess> Set;
@@ -320,7 +320,7 @@
 
  private:
   // Simple member-wise equality, since all intervals are non-empty.
-  struct /*QUIC_EXPORT_PRIVATE*/ NonemptyIntervalEq {
+  struct QUIC_NO_EXPORT NonemptyIntervalEq {
     bool operator()(const value_type& a, const value_type& b) const {
       return a.min() == b.min() && a.max() == b.max();
     }
diff --git a/quic/core/quic_lru_cache.h b/quic/core/quic_lru_cache.h
index a5a9e1a..2ec089c 100644
--- a/quic/core/quic_lru_cache.h
+++ b/quic/core/quic_lru_cache.h
@@ -19,7 +19,7 @@
 // Value* returned by Lookup() can be invalid if the entry is evicted by other
 // threads.
 template <class K, class V>
-class /*QUIC_EXPORT_PRIVATE*/ QuicLRUCache {
+class QUIC_NO_EXPORT QuicLRUCache {
  public:
   explicit QuicLRUCache(size_t capacity) : capacity_(capacity) {}
   QuicLRUCache(const QuicLRUCache&) = delete;
diff --git a/quic/core/quic_packet_writer_wrapper.h b/quic/core/quic_packet_writer_wrapper.h
index dd437f1..0b331ae 100644
--- a/quic/core/quic_packet_writer_wrapper.h
+++ b/quic/core/quic_packet_writer_wrapper.h
@@ -15,8 +15,7 @@
 // Wraps a writer object to allow dynamically extending functionality. Use
 // cases: replace writer while dispatcher and connections hold on to the
 // wrapper; mix in monitoring; mix in mocks in unit tests.
-class /*QUIC_EXPORT_PRIVATE*/ QuicPacketWriterWrapper
-    : public QuicPacketWriter {
+class QUIC_NO_EXPORT QuicPacketWriterWrapper : public QuicPacketWriter {
  public:
   QuicPacketWriterWrapper();
   QuicPacketWriterWrapper(const QuicPacketWriterWrapper&) = delete;
diff --git a/quic/core/quic_process_packet_interface.h b/quic/core/quic_process_packet_interface.h
index 6bfc85d..3cd87ef 100644
--- a/quic/core/quic_process_packet_interface.h
+++ b/quic/core/quic_process_packet_interface.h
@@ -11,7 +11,7 @@
 namespace quic {
 
 // A class to process each incoming packet.
-class /*QUIC_EXPORT_PRIVATE*/ ProcessPacketInterface {
+class QUIC_NO_EXPORT ProcessPacketInterface {
  public:
   virtual ~ProcessPacketInterface() {}
   virtual void ProcessPacket(const QuicSocketAddress& self_address,
diff --git a/quic/core/quic_time_wait_list_manager.h b/quic/core/quic_time_wait_list_manager.h
index 0221f99..5c75535 100644
--- a/quic/core/quic_time_wait_list_manager.h
+++ b/quic/core/quic_time_wait_list_manager.h
@@ -35,7 +35,7 @@
 // wait state.  After the connection_id expires its time wait period, a new
 // connection/session will be created if a packet is received for this
 // connection_id.
-class /*QUIC_EXPORT_PRIVATE*/ QuicTimeWaitListManager
+class QUIC_NO_EXPORT QuicTimeWaitListManager
     : public QuicBlockedWriterInterface {
  public:
   // Specifies what the time wait list manager should do when processing packets
@@ -50,7 +50,7 @@
     DO_NOTHING,
   };
 
-  class /*QUIC_EXPORT_PRIVATE*/ Visitor : public QuicSession::Visitor {
+  class QUIC_NO_EXPORT Visitor : public QuicSession::Visitor {
    public:
     // Called after the given connection is added to the time-wait list.
     virtual void OnConnectionAddedToTimeWaitList(
@@ -160,7 +160,7 @@
       QuicConnectionId connection_id) const;
 
   // Internal structure to store pending termination packets.
-  class /*QUIC_EXPORT_PRIVATE*/ QueuedPacket {
+  class QUIC_NO_EXPORT QueuedPacket {
    public:
     QueuedPacket(const QuicSocketAddress& self_address,
                  const QuicSocketAddress& peer_address,
@@ -230,7 +230,7 @@
   // A map from a recently closed connection_id to the number of packets
   // received after the termination of the connection bound to the
   // connection_id.
-  struct /*QUIC_EXPORT_PRIVATE*/ ConnectionIdData {
+  struct QUIC_NO_EXPORT ConnectionIdData {
     ConnectionIdData(int num_packets,
                      bool ietf_quic,
                      QuicTime time_added,
diff --git a/quic/core/quic_trace_visitor.h b/quic/core/quic_trace_visitor.h
index 4adc93c..86d7198 100644
--- a/quic/core/quic_trace_visitor.h
+++ b/quic/core/quic_trace_visitor.h
@@ -14,8 +14,7 @@
 // Records a QUIC trace protocol buffer for a QuicConnection.  It's the
 // responsibility of the user of this visitor to process or store the resulting
 // trace, which can be accessed via trace().
-class /*QUIC_EXPORT_PRIVATE*/ QuicTraceVisitor
-    : public QuicConnectionDebugVisitor {
+class QUIC_NO_EXPORT QuicTraceVisitor : public QuicConnectionDebugVisitor {
  public:
   explicit QuicTraceVisitor(const QuicConnection* connection);
 
diff --git a/quic/platform/api/quic_export.h b/quic/platform/api/quic_export.h
index 8ffd676..90696a6 100644
--- a/quic/platform/api/quic_export.h
+++ b/quic/platform/api/quic_export.h
@@ -7,4 +7,11 @@
 
 #include "net/quic/platform/impl/quic_export_impl.h"
 
+// quic_export_impl.h defines the following macros:
+// - QUIC_EXPORT is not meant to be used.
+// - QUIC_EXPORT_PRIVATE is meant for QUIC functionality that is built in
+//   Chromium as part of //net, and not fully contained in headers.
+// - QUIC_NO_EXPORT is meant for QUIC functionality that is either fully defined
+//   in a header, or is built in Chromium as part of tests or tools.
+
 #endif  // QUICHE_QUIC_PLATFORM_API_QUIC_EXPORT_H_
diff --git a/quic/platform/api/quic_reference_counted.h b/quic/platform/api/quic_reference_counted.h
index 9e5a1e0..18f6f37 100644
--- a/quic/platform/api/quic_reference_counted.h
+++ b/quic/platform/api/quic_reference_counted.h
@@ -51,7 +51,7 @@
 // QuicReferenceCountedPointer<T> r_ptr_b = std::move(r_ptr_a);
 
 template <class T>
-class /*QUIC_EXPORT_PRIVATE*/ QuicReferenceCountedPointer {
+class QUIC_NO_EXPORT QuicReferenceCountedPointer {
  public:
   QuicReferenceCountedPointer() = default;
 
diff --git a/quic/platform/api/quic_test_mem_slice_vector.h b/quic/platform/api/quic_test_mem_slice_vector.h
index d06a8ac..734db63 100644
--- a/quic/platform/api/quic_test_mem_slice_vector.h
+++ b/quic/platform/api/quic_test_mem_slice_vector.h
@@ -18,7 +18,7 @@
 // Tests using QuicTestMemSliceVector need to make sure the actual data buffers
 // outlive QuicTestMemSliceVector, and QuicTestMemSliceVector outlive the
 // returned QuicMemSliceSpan.
-class /*QUIC_EXPORT_PRIVATE*/ QuicTestMemSliceVector {
+class QUIC_NO_EXPORT QuicTestMemSliceVector {
  public:
   explicit QuicTestMemSliceVector(std::vector<std::pair<char*, size_t>> buffers)
       : impl_(std::move(buffers)) {}