Coverage for /Syzygy/kasko/user_agent.h

CoverageLines executed / instrumented / missingexe / inst / missLanguageGroup
0.0%0028.C++source

Line-by-line coverage:

   1    :  // Copyright 2014 Google Inc. All Rights Reserved.
   2    :  //
   3    :  // Licensed under the Apache License, Version 2.0 (the "License");
   4    :  // you may not use this file except in compliance with the License.
   5    :  // You may obtain a copy of the License at
   6    :  //
   7    :  //     http://www.apache.org/licenses/LICENSE-2.0
   8    :  //
   9    :  // Unless required by applicable law or agreed to in writing, software
  10    :  // distributed under the License is distributed on an "AS IS" BASIS,
  11    :  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12    :  // See the License for the specific language governing permissions and
  13    :  // limitations under the License.
  14    :  
  15    :  #ifndef SYZYGY_KASKO_USER_AGENT_H_
  16    :  #define SYZYGY_KASKO_USER_AGENT_H_
  17    :  
  18    :  #include <stdint.h>
  19    :  #include "base/macros.h"
  20    :  #include "base/strings/string16.h"
  21    :  
  22  m :  namespace kasko {
  23    :  
  24    :  // Collects the various properties that go into the Kasko user-agent string and
  25    :  // formats them.
  26  m :  class UserAgent {
  27  m :   public:
  28  m :    enum Architecture { X86, WOW64, X64, IA64 };
  29    :  
  30    :    // Creates a default-initialized instance. This does not query platform
  31    :    // attributes. The client must do so.
  32    :    // @param product_name The product name.
  33    :    // @param product_version The product version.
  34  m :    UserAgent(const base::string16& product_name,
  35  m :              const base::string16& product_version);
  36  m :    ~UserAgent();
  37    :  
  38    :    // @returns A string suitable for use as the value of a User-Agent header, and
  39    :    //     incorporating the various properties of this class.
  40  m :    base::string16 AsString();
  41    :  
  42    :    // Sets the OS version.
  43    :    // @param major_version The OS major version number.
  44    :    // @param minor_version The OS minor version number.
  45  m :    void set_os_version(int32_t major_version, int32_t minor_version) {
  46  m :      os_major_version_ = major_version;
  47  m :      os_minor_version_ = minor_version;
  48  m :    }
  49    :  
  50    :    // Sets the platform architecture.
  51    :    // @param architecture The platform architecture.
  52  m :    void set_architecture(Architecture architecture) {
  53  m :      architecture_ = architecture;
  54  m :    }
  55    :  
  56    :    // Sets the WinHttp library version.
  57    :    // @winhttp_version The WinHttp library version.
  58  m :    void set_winhttp_version(const base::string16& winhttp_version) {
  59  m :      winhttp_version_ = winhttp_version;
  60  m :    }
  61    :  
  62  m :   private:
  63  m :    base::string16 product_name_;
  64  m :    base::string16 product_version_;
  65  m :    int32_t os_major_version_;
  66  m :    int32_t os_minor_version_;
  67  m :    Architecture architecture_;
  68  m :    base::string16 winhttp_version_;
  69    :  
  70  m :    DISALLOW_COPY_AND_ASSIGN(UserAgent);
  71  m :  };
  72    :  
  73  m :  }  // namespace kasko
  74    :  
  75    :  #endif  // SYZYGY_KASKO_USER_AGENT_H_

Coverage information generated Fri Jul 29 11:00:21 2016.