<commit_before>// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/client/plugin/pepper_port_allocator_session.h"

#include <map>

#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/synchronization/lock.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/trusted/ppb_url_loader_trusted.h"
#include "ppapi/cpp/url_loader.h"
#include "ppapi/cpp/url_request_info.h"
#include "ppapi/cpp/url_response_info.h"
#include "remoting/jingle_glue/http_port_allocator.h"
#include "remoting/client/plugin/chromoting_instance.h"
#include "remoting/client/plugin/pepper_entrypoints.h"

namespace {

static const int kHostPort = 80;
static const int kNumRetries = 5;
static const std::string kCreateSessionURL = "/create_session";

// Define a SessionFactory in the anonymouse namespace so we have a
// shorter name.
// TODO(hclam): Move this to a separate file.
class SessionFactory : public remoting::PortAllocatorSessionFactory {
 public:
  SessionFactory(remoting::ChromotingInstance* instance,
                 base::MessageLoopProxy* pepper_message_loop,
                 base::MessageLoopProxy* network_message_loop)<commit_msg>remoting: Get rid of a static variable of a std::string type, which is forbidden.<commit_after>// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/client/plugin/pepper_port_allocator_session.h"

#include <map>

#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/synchronization/lock.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/trusted/ppb_url_loader_trusted.h"
#include "ppapi/cpp/url_loader.h"
#include "ppapi/cpp/url_request_info.h"
#include "ppapi/cpp/url_response_info.h"
#include "remoting/jingle_glue/http_port_allocator.h"
#include "remoting/client/plugin/chromoting_instance.h"
#include "remoting/client/plugin/pepper_entrypoints.h"

namespace {

static const int kHostPort = 80;
static const int kNumRetries = 5;

// Define a SessionFactory in the anonymouse namespace so we have a
// shorter name.
// TODO(hclam): Move this to a separate file.
class SessionFactory : public remoting::PortAllocatorSessionFactory {
 public:
  SessionFactory(remoting::ChromotingInstance* instance,
                 base::MessageLoopProxy* pepper_message_loop,
                 base::MessageLoopProxy* network_message_loop)
{'fraction_non_alphanumeric': 0.10896057347670252, 'fraction_numerical': 0.005017921146953405, 'mean_word_length': 5.015086206896552, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5277594', 'n_tokens_mistral': 922, 'n_tokens_neox': 897, 'n_words': 227}