Bug 909028 - Remove dead chromium code; r=ehsan, rs=bent
authorMs2ger <ms2ger@gmail.com>
Fri, 06 Sep 2013 08:42:41 +0200
changeset 145763 baa61f505393abb1359eec90cd7d626e87835f57
parent 145762 4a89871f5c4b657eb47de4809d2d451b2e6690f2
child 145764 2faa6e031add81eea8ba514b6990403c45b65a17
push id25224
push userMs2ger@gmail.com
push dateFri, 06 Sep 2013 06:44:32 +0000
treeherdermozilla-central@ab5f29823236 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, bent
bugs909028
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 909028 - Remove dead chromium code; r=ehsan, rs=bent
ipc/chromium/moz.build
ipc/chromium/src/base/DEPS
ipc/chromium/src/base/base_drag_source.cc
ipc/chromium/src/base/base_drop_target.cc
ipc/chromium/src/base/bzip2_error_handler.cc
ipc/chromium/src/base/data_pack.cc
ipc/chromium/src/base/data_pack.h
ipc/chromium/src/base/debug_message.cc
ipc/chromium/src/base/directory_watcher.h
ipc/chromium/src/base/directory_watcher_inotify.cc
ipc/chromium/src/base/directory_watcher_mac.cc
ipc/chromium/src/base/directory_watcher_stub.cc
ipc/chromium/src/base/directory_watcher_win.cc
ipc/chromium/src/base/field_trial.cc
ipc/chromium/src/base/field_trial.h
ipc/chromium/src/base/file_util.cc
ipc/chromium/src/base/file_util.h
ipc/chromium/src/base/file_util_icu.cc
ipc/chromium/src/base/file_util_posix.cc
ipc/chromium/src/base/file_util_win.cc
ipc/chromium/src/base/fix_wp64.h
ipc/chromium/src/base/float_util.h
ipc/chromium/src/base/gfx/DEPS
ipc/chromium/src/base/gfx/gdi_util.h
ipc/chromium/src/base/gfx/native_widget_types.h
ipc/chromium/src/base/gfx/png_encoder.h
ipc/chromium/src/base/gfx/point.h
ipc/chromium/src/base/hmac_nss.cc
ipc/chromium/src/base/hmac_win.cc
ipc/chromium/src/base/iat_patch.cc
ipc/chromium/src/base/iat_patch.h
ipc/chromium/src/base/icu_util.cc
ipc/chromium/src/base/icu_util.h
ipc/chromium/src/base/linux_util.cc
ipc/chromium/src/base/md5.cc
ipc/chromium/src/base/md5.h
ipc/chromium/src/base/multiprocess_test.h
ipc/chromium/src/base/native_library.h
ipc/chromium/src/base/native_library_linux.cc
ipc/chromium/src/base/native_library_mac.mm
ipc/chromium/src/base/native_library_win.cc
ipc/chromium/src/base/no_windows2000_unittest.h
ipc/chromium/src/base/nss_init.cc
ipc/chromium/src/base/nss_init.h
ipc/chromium/src/base/pe_image.cc
ipc/chromium/src/base/pe_image.h
ipc/chromium/src/base/perf_test_suite.h
ipc/chromium/src/base/perftimer.cc
ipc/chromium/src/base/perftimer.h
ipc/chromium/src/base/process_util.h
ipc/chromium/src/base/process_util_bsd.cc
ipc/chromium/src/base/process_util_linux.cc
ipc/chromium/src/base/process_util_mac.mm
ipc/chromium/src/base/process_util_posix.cc
ipc/chromium/src/base/process_util_win.cc
ipc/chromium/src/base/profiler.cc
ipc/chromium/src/base/profiler.h
ipc/chromium/src/base/resource_util.cc
ipc/chromium/src/base/resource_util.h
ipc/chromium/src/base/run_all_perftests.cc
ipc/chromium/src/base/run_all_unittests.cc
ipc/chromium/src/base/scoped_bstr_win.cc
ipc/chromium/src/base/scoped_clipboard_writer.cc
ipc/chromium/src/base/scoped_clipboard_writer.h
ipc/chromium/src/base/scoped_comptr_win.h
ipc/chromium/src/base/scoped_variant_win.cc
ipc/chromium/src/base/scoped_variant_win.h
ipc/chromium/src/base/shared_memory_posix.cc
ipc/chromium/src/base/spin_wait.h
ipc/chromium/src/base/string_util.cc
ipc/chromium/src/base/string_util.h
ipc/chromium/src/base/string_util_icu.cc
ipc/chromium/src/base/sys_string_conversions_linux.cc
ipc/chromium/src/base/test_file_util.h
ipc/chromium/src/base/test_file_util_linux.cc
ipc/chromium/src/base/test_file_util_mac.cc
ipc/chromium/src/base/test_file_util_posix.cc
ipc/chromium/src/base/test_file_util_win.cc
ipc/chromium/src/base/test_suite.h
ipc/chromium/src/base/time_format.cc
ipc/chromium/src/base/tracked_objects.cc
ipc/chromium/src/base/tracked_objects.h
ipc/chromium/src/base/values.cc
ipc/chromium/src/base/values.h
ipc/chromium/src/base/version.cc
ipc/chromium/src/base/version.h
ipc/chromium/src/base/watchdog.cc
ipc/chromium/src/base/watchdog.h
ipc/chromium/src/base/windows_message_list.h
ipc/chromium/src/base/wmi_util.cc
ipc/chromium/src/base/wmi_util.h
ipc/chromium/src/base/word_iterator.cc
ipc/chromium/src/base/word_iterator.h
ipc/chromium/src/base/worker_pool_linux.cc
ipc/chromium/src/base/worker_pool_win.cc
ipc/chromium/src/chrome/common/DEPS
ipc/chromium/src/chrome/common/bindings_policy.h
ipc/chromium/src/chrome/common/bzip2_unittest.cc
ipc/chromium/src/chrome/common/chrome_paths_linux.cc
ipc/chromium/src/chrome/common/common.vcproj
ipc/chromium/src/chrome/common/common.vsprops
ipc/chromium/src/chrome/common/common_glue.cc
ipc/chromium/src/chrome/common/common_resources.grd
ipc/chromium/src/chrome/common/devtools_messages.h
ipc/chromium/src/chrome/common/devtools_messages_internal.h
ipc/chromium/src/chrome/common/extra_defines.vsprops
ipc/chromium/src/chrome/common/file_descriptor_set_unittest.cc
ipc/chromium/src/chrome/common/filter_policy.h
ipc/chromium/src/chrome/common/gears_api.h
ipc/chromium/src/chrome/common/ipc_fuzzing_tests.cc
ipc/chromium/src/chrome/common/ipc_maybe.h
ipc/chromium/src/chrome/common/ipc_message_macros.h
ipc/chromium/src/chrome/common/ipc_message_unittest.cc
ipc/chromium/src/chrome/common/ipc_message_utils.h
ipc/chromium/src/chrome/common/ipc_send_fds_test.cc
ipc/chromium/src/chrome/common/ipc_sync_channel_unittest.cc
ipc/chromium/src/chrome/common/ipc_sync_message_unittest.cc
ipc/chromium/src/chrome/common/ipc_sync_message_unittest.h
ipc/chromium/src/chrome/common/ipc_test_sink.cc
ipc/chromium/src/chrome/common/ipc_test_sink.h
ipc/chromium/src/chrome/common/ipc_tests.cc
ipc/chromium/src/chrome/common/ipc_tests.h
ipc/chromium/src/chrome/common/ipc_tests.vcproj
ipc/chromium/src/chrome/common/main_function_params.h
ipc/chromium/src/chrome/common/modal_dialog_event.h
ipc/chromium/src/chrome/common/navigation_types.h
ipc/chromium/src/chrome/common/notification_registrar.cc
ipc/chromium/src/chrome/common/notification_service_unittest.cc
ipc/chromium/src/chrome/common/owned_widget_gtk.cc
ipc/chromium/src/chrome/common/owned_widget_gtk.h
ipc/chromium/src/chrome/common/platform_util.h
ipc/chromium/src/chrome/common/platform_util_linux.cc
ipc/chromium/src/chrome/common/platform_util_mac.mm
ipc/chromium/src/chrome/common/platform_util_win.cc
ipc/chromium/src/chrome/common/process_watcher_posix.cc
ipc/chromium/src/chrome/common/ref_counted_util.h
ipc/chromium/src/chrome/common/render_messages.h
ipc/chromium/src/chrome/common/render_messages_internal.h
ipc/chromium/src/chrome/common/resource_dispatcher.cc
ipc/chromium/src/chrome/common/resource_dispatcher.h
ipc/chromium/src/chrome/common/resource_dispatcher_unittest.cc
ipc/chromium/src/chrome/common/sandbox_init_wrapper.cc
ipc/chromium/src/chrome/common/sandbox_init_wrapper.h
ipc/chromium/src/chrome/common/thumbnail_score.cc
ipc/chromium/src/chrome/common/time_format.cc
ipc/chromium/src/chrome/common/time_format.h
ipc/chromium/src/chrome/common/time_format_unittest.cc
ipc/chromium/src/chrome/common/transport_dib_linux.cc
ipc/chromium/src/chrome/common/webkit_param_traits.h
ipc/chromium/src/chrome/common/win_util.cc
ipc/chromium/src/chrome/common/win_util.h
ipc/chromium/src/chrome/common/win_util_unittest.cc
ipc/chromium/src/chrome/common/x11_util.cc
ipc/chromium/src/chrome/common/x11_util_internal.h
ipc/glue/StringUtil.cpp
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -171,17 +171,16 @@ if os_macosx:
         'chrome_application_mac.mm',
         'chrome_paths_mac.mm',
         'file_util_mac.mm',
         'file_version_info_mac.mm',
         'mac_util.mm',
         'mach_ipc_mac.mm',
         'message_pump_mac.mm',
         'platform_thread_mac.mm',
-        'platform_util_mac.mm',
         'process_util_mac.mm',
         'scoped_nsautorelease_pool.mm',
         'sys_string_conversions_mac.mm',
         'worker_pool_mac.mm',
     ]
 
 if os_linux:
     CPP_SOURCES += [
deleted file mode 100644
--- a/ipc/chromium/src/base/DEPS
+++ /dev/null
@@ -1,6 +0,0 @@
-include_rules = [
-  "+third_party/zlib",
-  "+third_party/libevent",
-  "+third_party/libjpeg",
-  "+third_party/dmg_fp",
-]
deleted file mode 100644
--- a/ipc/chromium/src/base/base_drag_source.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/base_drag_source.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// BaseDragSource, public:
-
-BaseDragSource::BaseDragSource() : ref_count_(0) {
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// BaseDragSource, IDropSource implementation:
-
-HRESULT BaseDragSource::QueryContinueDrag(BOOL escape_pressed,
-                                          DWORD key_state) {
-  if (escape_pressed) {
-    OnDragSourceCancel();
-    return DRAGDROP_S_CANCEL;
-  }
-
-  if (!(key_state & MK_LBUTTON)) {
-    OnDragSourceDrop();
-    return DRAGDROP_S_DROP;
-  }
-
-  OnDragSourceMove();
-  return S_OK;
-}
-
-HRESULT BaseDragSource::GiveFeedback(DWORD effect) {
-  return DRAGDROP_S_USEDEFAULTCURSORS;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// BaseDragSource, IUnknown implementation:
-
-HRESULT BaseDragSource::QueryInterface(const IID& iid, void** object) {
-  *object = NULL;
-  if (IsEqualIID(iid, IID_IUnknown) || IsEqualIID(iid, IID_IDropSource)) {
-    *object = this;
-  } else {
-    return E_NOINTERFACE;
-  }
-  AddRef();
-  return S_OK;
-}
-
-ULONG BaseDragSource::AddRef() {
-  return ++ref_count_;
-}
-
-ULONG BaseDragSource::Release() {
-  if (--ref_count_ == 0) {
-    delete this;
-    return 0U;
-  }
-  return ref_count_;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/base_drop_target.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/base_drop_target.h"
-
-#include <shlobj.h>
-
-#include "base/logging.h"
-
-///////////////////////////////////////////////////////////////////////////////
-
-IDropTargetHelper* BaseDropTarget::cached_drop_target_helper_ = NULL;
-int32_t BaseDropTarget::drag_identity_ = 0;
-
-BaseDropTarget::BaseDropTarget(HWND hwnd)
-    : hwnd_(hwnd),
-      suspend_(false),
-      ref_count_(0) {
-  DCHECK(hwnd);
-  HRESULT result = RegisterDragDrop(hwnd, this);
-  DCHECK(SUCCEEDED(result));
-}
-
-BaseDropTarget::~BaseDropTarget() {
-}
-
-// static
-IDropTargetHelper* BaseDropTarget::DropHelper() {
-  if (!cached_drop_target_helper_) {
-    CoCreateInstance(CLSID_DragDropHelper, 0, CLSCTX_INPROC_SERVER,
-                     IID_IDropTargetHelper,
-                     reinterpret_cast<void**>(&cached_drop_target_helper_));
-  }
-  return cached_drop_target_helper_;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// BaseDropTarget, IDropTarget implementation:
-
-HRESULT BaseDropTarget::DragEnter(IDataObject* data_object,
-                                  DWORD key_state,
-                                  POINTL cursor_position,
-                                  DWORD* effect) {
-  // Tell the helper that we entered so it can update the drag image.
-  IDropTargetHelper* drop_helper = DropHelper();
-  if (drop_helper) {
-    drop_helper->DragEnter(GetHWND(), data_object,
-                           reinterpret_cast<POINT*>(&cursor_position), *effect);
-  }
-
-  // You can't drag and drop within the same HWND.
-  if (suspend_) {
-    *effect = DROPEFFECT_NONE;
-    return S_OK;
-  }
-
-  // Update the drag identity, skipping 0.
-  if (++drag_identity_ == 0)
-    ++drag_identity_;
-
-  current_data_object_ = data_object;
-  POINT screen_pt = { cursor_position.x, cursor_position.y };
-  *effect = OnDragEnter(current_data_object_, key_state, screen_pt, *effect);
-  return S_OK;
-}
-
-HRESULT BaseDropTarget::DragOver(DWORD key_state,
-                                 POINTL cursor_position,
-                                 DWORD* effect) {
-  // Tell the helper that we moved over it so it can update the drag image.
-  IDropTargetHelper* drop_helper = DropHelper();
-  if (drop_helper)
-    drop_helper->DragOver(reinterpret_cast<POINT*>(&cursor_position), *effect);
-
-  if (suspend_) {
-    *effect = DROPEFFECT_NONE;
-    return S_OK;
-  }
-
-  POINT screen_pt = { cursor_position.x, cursor_position.y };
-  *effect = OnDragOver(current_data_object_, key_state, screen_pt, *effect);
-  return S_OK;
-}
-
-HRESULT BaseDropTarget::DragLeave() {
-  // Tell the helper that we moved out of it so it can update the drag image.
-  IDropTargetHelper* drop_helper = DropHelper();
-  if (drop_helper)
-    drop_helper->DragLeave();
-
-  OnDragLeave(current_data_object_);
-
-  current_data_object_ = NULL;
-  return S_OK;
-}
-
-HRESULT BaseDropTarget::Drop(IDataObject* data_object,
-                             DWORD key_state,
-                             POINTL cursor_position,
-                             DWORD* effect) {
-  // Tell the helper that we dropped onto it so it can update the drag image.
-  IDropTargetHelper* drop_helper = DropHelper();
-  if (drop_helper) {
-    drop_helper->Drop(current_data_object_,
-                      reinterpret_cast<POINT*>(&cursor_position), *effect);
-  }
-
-  if (suspend_) {
-    *effect = DROPEFFECT_NONE;
-    return S_OK;
-  }
-
-  POINT screen_pt = { cursor_position.x, cursor_position.y };
-  *effect = OnDrop(current_data_object_, key_state, screen_pt, *effect);
-  return S_OK;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// BaseDropTarget, IUnknown implementation:
-
-HRESULT BaseDropTarget::QueryInterface(const IID& iid, void** object) {
-  *object = NULL;
-  if (IsEqualIID(iid, IID_IUnknown) || IsEqualIID(iid, IID_IDropTarget)) {
-    *object = this;
-  } else {
-    return E_NOINTERFACE;
-  }
-  AddRef();
-  return S_OK;
-}
-
-ULONG BaseDropTarget::AddRef() {
-  return ++ref_count_;
-}
-
-ULONG BaseDropTarget::Release() {
-  if (--ref_count_ == 0) {
-    delete this;
-    return 0U;
-  }
-  return ref_count_;
-}
-
-DWORD BaseDropTarget::OnDragEnter(IDataObject* data_object,
-                                  DWORD key_state,
-                                  POINT cursor_position,
-                                  DWORD effect) {
-  return DROPEFFECT_NONE;
-}
-
-DWORD BaseDropTarget::OnDragOver(IDataObject* data_object,
-                                 DWORD key_state,
-                                 POINT cursor_position,
-                                 DWORD effect) {
-  return DROPEFFECT_NONE;
-}
-
-void BaseDropTarget::OnDragLeave(IDataObject* data_object) {
-}
-
-DWORD BaseDropTarget::OnDrop(IDataObject* data_object,
-                             DWORD key_state,
-                             POINT cursor_position,
-                             DWORD effect) {
-  return DROPEFFECT_NONE;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/bzip2_error_handler.cc
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/logging.h"
-
-// We define BZ_NO_STDIO in third_party/bzip2 to remove its internal STDERR
-// error reporting.  This requires us to export our own error handler.
-extern "C"
-void bz_internal_error(int errcode) {
-  CHECK(false) << "bzip2 internal error: " << errcode;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/data_pack.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) 2008 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 "base/data_pack.h"
-
-#include "base/file_util.h"
-#include "base/logging.h"
-#include "base/string_piece.h"
-
-// For details of the file layout, see
-// http://dev.chromium.org/developers/design-documents/linuxresourcesandlocalizedstrings
-
-namespace {
-static const uint32_t kFileFormatVersion = 1;
-// Length of file header: version and entry count.
-static const size_t kHeaderLength = 2 * sizeof(uint32_t);
-
-struct DataPackEntry {
-  uint32_t resource_id;
-  uint32_t file_offset;
-  uint32_t length;
-
-  static int CompareById(const void* void_key, const void* void_entry) {
-    uint32_t key = *reinterpret_cast<const uint32_t*>(void_key);
-    const DataPackEntry* entry =
-        reinterpret_cast<const DataPackEntry*>(void_entry);
-    if (key < entry->resource_id) {
-      return -1;
-    } else if (key > entry->resource_id) {
-      return 1;
-    } else {
-      return 0;
-    }
-  }
-}  __attribute((packed));
-
-}  // anonymous namespace
-
-namespace base {
-
-// In .cc for MemoryMappedFile dtor.
-DataPack::DataPack() : resource_count_(0) {
-}
-DataPack::~DataPack() {
-}
-
-bool DataPack::Load(const FilePath& path) {
-  mmap_.reset(new file_util::MemoryMappedFile);
-  if (!mmap_->Initialize(path)) {
-    mmap_.reset();
-    return false;
-  }
-
-  // Parse the header of the file.
-  // First uint32_t: version; second: resource count.
-  const uint32_t* ptr = reinterpret_cast<const uint32_t*>(mmap_->data());
-  uint32_t version = ptr[0];
-  if (version != kFileFormatVersion) {
-    LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-               << kFileFormatVersion;
-    mmap_.reset();
-    return false;
-  }
-  resource_count_ = ptr[1];
-
-  // Sanity check the file.
-  // 1) Check we have enough entries.
-  if (kHeaderLength + resource_count_ * sizeof(DataPackEntry) >
-      mmap_->length()) {
-    LOG(ERROR) << "Data pack file corruption: too short for number of "
-                  "entries specified.";
-    mmap_.reset();
-    return false;
-  }
-  // 2) Verify the entries are within the appropriate bounds.
-  for (size_t i = 0; i < resource_count_; ++i) {
-    const DataPackEntry* entry = reinterpret_cast<const DataPackEntry*>(
-        mmap_->data() + kHeaderLength + (i * sizeof(DataPackEntry)));
-    if (entry->file_offset + entry->length > mmap_->length()) {
-      LOG(ERROR) << "Entry #" << i << " in data pack points off end of file. "
-                 << "Was the file corrupted?";
-      mmap_.reset();
-      return false;
-    }
-  }
-
-  return true;
-}
-
-bool DataPack::Get(uint32_t resource_id, StringPiece* data) {
-  // It won't be hard to make this endian-agnostic, but it's not worth
-  // bothering to do right now.
-#if defined(__BYTE_ORDER)
-  // Linux check
-  COMPILE_ASSERT(__BYTE_ORDER == __LITTLE_ENDIAN,
-                 datapack_assumes_little_endian);
-#elif defined(__BIG_ENDIAN__)
-  // Mac check
-  #error DataPack assumes little endian
-#endif
-
-  DataPackEntry* target = reinterpret_cast<DataPackEntry*>(
-      bsearch(&resource_id, mmap_->data() + kHeaderLength, resource_count_,
-              sizeof(DataPackEntry), DataPackEntry::CompareById));
-  if (!target) {
-    LOG(ERROR) << "No resource found with id: " << resource_id;
-    return false;
-  }
-
-  data->set(mmap_->data() + target->file_offset, target->length);
-  return true;
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/data_pack.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2008 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.
-
-// DataPack represents a read-only view onto an on-disk file that contains
-// (key, value) pairs of data.  It's used to store static resources like
-// translation strings and images.
-
-#ifndef BASE_DATA_PACK_H_
-#define BASE_DATA_PACK_H_
-
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-
-namespace file_util {
-  class MemoryMappedFile;
-}
-class FilePath;
-class StringPiece;
-
-namespace base {
-
-class DataPack {
- public:
-  DataPack();
-  ~DataPack();
-
-  // Load a pack file from |path|, returning false on error.
-  bool Load(const FilePath& path);
-
-  // Get resource by id |resource_id|, filling in |data|.
-  // The data is owned by the DataPack object and should not be modified.
-  // Returns false if the resource id isn't found.
-  bool Get(uint32_t resource_id, StringPiece* data);
-
- private:
-  // The memory-mapped data.
-  scoped_ptr<file_util::MemoryMappedFile> mmap_;
-
-  // Number of resources in the data.
-  size_t resource_count_;
-
-  DISALLOW_COPY_AND_ASSIGN(DataPack);
-};
-
-}  // namespace base
-
-#endif  // BASE_DATA_PACK_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/debug_message.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) 2006-2008 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 <windows.h>
-
-// Display the command line. This program is designed to be called from
-// another process to display assertions. Since the other process has
-// complete control of our command line, we assume that it did *not*
-// add the program name as the first parameter. This allows us to just
-// show the command line directly as the message.
-int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
-                     LPSTR lpCmdLine, int nCmdShow) {
-  LPWSTR cmdline = GetCommandLineW();
-  MessageBox(NULL, cmdline, L"Kr\x00d8m", MB_TOPMOST);
-  return 0;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/directory_watcher.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This module provides a way to monitor a directory for changes.
-
-#ifndef BASE_DIRECTORY_WATCHER_H_
-#define BASE_DIRECTORY_WATCHER_H_
-
-#include "base/basictypes.h"
-#include "base/ref_counted.h"
-
-class FilePath;
-
-// This class lets you register interest in changes on a directory.
-// The delegate will get called whenever a file is added or changed in the
-// directory.
-class DirectoryWatcher {
- public:
-  class Delegate {
-   public:
-    virtual void OnDirectoryChanged(const FilePath& path) = 0;
-  };
-
-  DirectoryWatcher();
-  ~DirectoryWatcher() {}
-
-  // Register interest in any changes in the directory |path|.
-  // OnDirectoryChanged will be called back for each change within the dir.
-  // If |recursive| is true, the delegate will be notified for each change
-  // within the directory tree starting at |path|. Returns false on error.
-  //
-  // Note: on Windows you may got more notifications for non-recursive watch
-  // than you expect, especially on versions earlier than Vista. The behavior
-  // is consistent on any particular version of Windows, but not across
-  // different versions.
-  bool Watch(const FilePath& path, Delegate* delegate, bool recursive) {
-    return impl_->Watch(path, delegate, recursive);
-  }
-
-  // Used internally to encapsulate different members on different platforms.
-  class PlatformDelegate : public base::RefCounted<PlatformDelegate> {
-   public:
-    virtual ~PlatformDelegate() {}
-    virtual bool Watch(const FilePath& path, Delegate* delegate,
-                       bool recursive) = 0;
-  };
-
- private:
-  scoped_refptr<PlatformDelegate> impl_;
-
-  DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher);
-};
-
-#endif  // BASE_DIRECTORY_WATCHER_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/directory_watcher_inotify.cc
+++ /dev/null
@@ -1,321 +0,0 @@
-// Copyright (c) 2009 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 "base/directory_watcher.h"
-
-#include <errno.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/inotify.h>
-#include <sys/select.h>
-#include <unistd.h>
-
-#include <algorithm>
-#include <set>
-#include <utility>
-#include <vector>
-
-#include "base/eintr_wrapper.h"
-#include "base/file_path.h"
-#include "base/hash_tables.h"
-#include "base/lock.h"
-#include "base/logging.h"
-#include "base/message_loop.h"
-#include "base/scoped_ptr.h"
-#include "base/singleton.h"
-#include "base/task.h"
-#include "base/thread.h"
-
-namespace {
-
-// Singleton to manage all inotify watches.
-class InotifyReader {
- public:
-  typedef int Watch;  // Watch descriptor used by AddWatch and RemoveWatch.
-  static const Watch kInvalidWatch = -1;
-
-  // Watch |path| for changes. |delegate| will be notified on each change. Does
-  // not check for duplicates. If you call it n times with same |path|
-  // and |delegate|, it will receive n notifications for each change
-  // in |path|. It makes implementation of DirectoryWatcher simple.
-  // Returns kInvalidWatch on failure.
-  Watch AddWatch(const FilePath& path, DirectoryWatcher::Delegate* delegate);
-
-  // Remove |watch| for |delegate|. If you had n watches for same |delegate|
-  // and path, after calling this function you will have n - 1.
-  // Returns true on success.
-  bool RemoveWatch(Watch watch, DirectoryWatcher::Delegate* delegate);
-
-  // Callback for InotifyReaderTask.
-  void OnInotifyEvent(inotify_event* event);
-
- private:
-  friend struct DefaultSingletonTraits<InotifyReader>;
-
-  typedef std::pair<DirectoryWatcher::Delegate*, MessageLoop*> DelegateInfo;
-  typedef std::multiset<DelegateInfo> DelegateSet;
-
-  InotifyReader();
-  ~InotifyReader();
-
-  // We keep track of which delegates want to be notified on which watches.
-  // Multiset is used because there may be many DirectoryWatchers for same path
-  // and delegate.
-  base::hash_map<Watch, DelegateSet> delegates_;
-
-  // For each watch we also want to know the path it's watching.
-  base::hash_map<Watch, FilePath> paths_;
-
-  // Lock to protect delegates_ and paths_.
-  Lock lock_;
-
-  // Separate thread on which we run blocking read for inotify events.
-  base::Thread thread_;
-
-  // File descriptor returned by inotify_init.
-  const int inotify_fd_;
-
-  // Use self-pipe trick to unblock select during shutdown.
-  int shutdown_pipe_[2];
-
-  // Flag set to true when startup was successful.
-  bool valid_;
-
-  DISALLOW_COPY_AND_ASSIGN(InotifyReader);
-};
-
-class InotifyReaderTask : public Task {
- public:
-  InotifyReaderTask(InotifyReader* reader, int inotify_fd, int shutdown_fd)
-      : reader_(reader),
-        inotify_fd_(inotify_fd),
-        shutdown_fd_(shutdown_fd) {
-  }
-
-  virtual void Run() {
-    while (true) {
-      fd_set rfds;
-      FD_ZERO(&rfds);
-      FD_SET(inotify_fd_, &rfds);
-      FD_SET(shutdown_fd_, &rfds);
-
-      // Wait until some inotify events are available.
-      int select_result =
-        HANDLE_EINTR(select(std::max(inotify_fd_, shutdown_fd_) + 1,
-                            &rfds, NULL, NULL, NULL));
-      if (select_result < 0) {
-        DLOG(WARNING) << "select failed: " << strerror(errno);
-        return;
-      }
-
-      if (FD_ISSET(shutdown_fd_, &rfds))
-        return;
-
-      // Adjust buffer size to current event queue size.
-      int buffer_size;
-      int ioctl_result = HANDLE_EINTR(ioctl(inotify_fd_, FIONREAD,
-                                            &buffer_size));
-
-      if (ioctl_result != 0) {
-        DLOG(WARNING) << "ioctl failed: " << strerror(errno);
-        return;
-      }
-
-      std::vector<char> buffer(buffer_size);
-
-      ssize_t bytes_read = HANDLE_EINTR(read(inotify_fd_, &buffer[0],
-                                             buffer_size));
-
-      if (bytes_read < 0) {
-        DLOG(WARNING) << "read from inotify fd failed: " << strerror(errno);
-        return;
-      }
-
-      ssize_t i = 0;
-      while (i < bytes_read) {
-        inotify_event* event = reinterpret_cast<inotify_event*>(&buffer[i]);
-        size_t event_size = sizeof(inotify_event) + event->len;
-        DCHECK(i + event_size <= static_cast<size_t>(bytes_read));
-        reader_->OnInotifyEvent(event);
-        i += event_size;
-      }
-    }
-  }
-
- private:
-  InotifyReader* reader_;
-  int inotify_fd_;
-  int shutdown_fd_;
-
-  DISALLOW_COPY_AND_ASSIGN(InotifyReaderTask);
-};
-
-class InotifyReaderNotifyTask : public Task {
- public:
-  InotifyReaderNotifyTask(DirectoryWatcher::Delegate* delegate,
-                          const FilePath& path)
-      : delegate_(delegate),
-        path_(path) {
-  }
-
-  virtual void Run() {
-    delegate_->OnDirectoryChanged(path_);
-  }
-
- private:
-  DirectoryWatcher::Delegate* delegate_;
-  FilePath path_;
-
-  DISALLOW_COPY_AND_ASSIGN(InotifyReaderNotifyTask);
-};
-
-InotifyReader::InotifyReader()
-    : thread_("inotify_reader"),
-      inotify_fd_(inotify_init()),
-      valid_(false) {
-  shutdown_pipe_[0] = -1;
-  shutdown_pipe_[1] = -1;
-  if (inotify_fd_ >= 0 && pipe(shutdown_pipe_) == 0 && thread_.Start()) {
-    thread_.message_loop()->PostTask(
-        FROM_HERE, new InotifyReaderTask(this, inotify_fd_, shutdown_pipe_[0]));
-    valid_ = true;
-  }
-}
-
-InotifyReader::~InotifyReader() {
-  if (valid_) {
-    // Write to the self-pipe so that the select call in InotifyReaderTask
-    // returns.
-    HANDLE_EINTR(write(shutdown_pipe_[1], "", 1));
-    thread_.Stop();
-  }
-  if (inotify_fd_ >= 0)
-    close(inotify_fd_);
-  if (shutdown_pipe_[0] >= 0)
-    close(shutdown_pipe_[0]);
-  if (shutdown_pipe_[1] >= 0)
-    close(shutdown_pipe_[1]);
-}
-
-InotifyReader::Watch InotifyReader::AddWatch(
-    const FilePath& path, DirectoryWatcher::Delegate* delegate) {
-  if (!valid_)
-    return kInvalidWatch;
-
-  AutoLock auto_lock(lock_);
-
-  Watch watch = inotify_add_watch(inotify_fd_, path.value().c_str(),
-                                  IN_CREATE | IN_DELETE |
-                                  IN_CLOSE_WRITE | IN_MOVE);
-  if (watch == kInvalidWatch)
-    return kInvalidWatch;
-
-  if (paths_[watch].empty())
-    paths_[watch] = path;  // We don't yet watch this path.
-
-  delegates_[watch].insert(std::make_pair(delegate, MessageLoop::current()));
-
-  return watch;
-}
-
-bool InotifyReader::RemoveWatch(Watch watch,
-                                DirectoryWatcher::Delegate* delegate) {
-  if (!valid_)
-    return false;
-
-  AutoLock auto_lock(lock_);
-
-  if (paths_[watch].empty())
-    return false;  // We don't recognize this watch.
-
-  // Only erase one occurrence of delegate (there may be more).
-  delegates_[watch].erase(
-      delegates_[watch].find(std::make_pair(delegate, MessageLoop::current())));
-
-  if (delegates_[watch].empty()) {
-    paths_.erase(watch);
-    delegates_.erase(watch);
-
-    return (inotify_rm_watch(inotify_fd_, watch) == 0);
-  }
-
-  return true;
-}
-
-void InotifyReader::OnInotifyEvent(inotify_event* event) {
-  if (event->mask & IN_IGNORED)
-    return;
-
-  DelegateSet delegates_to_notify;
-  FilePath changed_path;
-
-  {
-    AutoLock auto_lock(lock_);
-    changed_path = paths_[event->wd];
-    delegates_to_notify.insert(delegates_[event->wd].begin(),
-                               delegates_[event->wd].end());
-  }
-
-  DelegateSet::iterator i;
-  for (i = delegates_to_notify.begin(); i != delegates_to_notify.end(); ++i) {
-    DirectoryWatcher::Delegate* delegate = i->first;
-    MessageLoop* loop = i->second;
-    loop->PostTask(FROM_HERE,
-                   new InotifyReaderNotifyTask(delegate, changed_path));
-  }
-}
-
-class DirectoryWatcherImpl : public DirectoryWatcher::PlatformDelegate {
- public:
-  DirectoryWatcherImpl() : watch_(InotifyReader::kInvalidWatch) {}
-  ~DirectoryWatcherImpl();
-
-  virtual bool Watch(const FilePath& path, DirectoryWatcher::Delegate* delegate,
-                     bool recursive);
-
- private:
-  // Delegate to notify upon changes.
-  DirectoryWatcher::Delegate* delegate_;
-
-  // Path we're watching (passed to delegate).
-  FilePath path_;
-
-  // Watch returned by InotifyReader.
-  InotifyReader::Watch watch_;
-
-  DISALLOW_COPY_AND_ASSIGN(DirectoryWatcherImpl);
-};
-
-DirectoryWatcherImpl::~DirectoryWatcherImpl() {
-  if (watch_ != InotifyReader::kInvalidWatch)
-    Singleton<InotifyReader>::get()->RemoveWatch(watch_, delegate_);
-}
-
-bool DirectoryWatcherImpl::Watch(const FilePath& path,
-    DirectoryWatcher::Delegate* delegate, bool recursive) {
-  DCHECK(watch_ == InotifyReader::kInvalidWatch);  // Can only watch one path.
-
-  if (recursive) {
-    // TODO(phajdan.jr): Support recursive watches.
-    // Unfortunately inotify has no "native" support for them, but it can be
-    // emulated by walking the directory tree and setting up watches for each
-    // directory. Of course this is ineffective for large directory trees.
-    // For the algorithm, see the link below:
-    // http://osdir.com/ml/gnome.dashboard.devel/2004-10/msg00022.html
-    NOTIMPLEMENTED();
-    return false;
-  }
-
-  delegate_ = delegate;
-  path_ = path;
-  watch_ = Singleton<InotifyReader>::get()->AddWatch(path, delegate_);
-
-  return watch_ != InotifyReader::kInvalidWatch;
-}
-
-}  // namespace
-
-DirectoryWatcher::DirectoryWatcher() {
-  impl_ = new DirectoryWatcherImpl();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/directory_watcher_mac.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) 2009 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 "base/directory_watcher.h"
-
-#include <CoreServices/CoreServices.h>
-
-#include "base/file_path.h"
-#include "base/file_util.h"
-#include "base/logging.h"
-#include "base/message_loop.h"
-#include "base/scoped_cftyperef.h"
-
-namespace {
-
-const CFAbsoluteTime kEventLatencySeconds = 0.3;
-
-class DirectoryWatcherImpl : public DirectoryWatcher::PlatformDelegate {
- public:
-  DirectoryWatcherImpl() {}
-  ~DirectoryWatcherImpl() {
-    if (!path_.value().empty()) {
-      FSEventStreamStop(fsevent_stream_);
-      FSEventStreamInvalidate(fsevent_stream_);
-      FSEventStreamRelease(fsevent_stream_);
-    }
-  }
-
-  virtual bool Watch(const FilePath& path, DirectoryWatcher::Delegate* delegate,
-                     bool recursive);
-
-  void OnFSEventsCallback(const FilePath& event_path) {
-    DCHECK(!path_.value().empty());
-    if (!recursive_) {
-      FilePath absolute_event_path = event_path;
-      if (!file_util::AbsolutePath(&absolute_event_path))
-        return;
-      if (absolute_event_path != path_)
-        return;
-    }
-    delegate_->OnDirectoryChanged(path_);
-  }
-
- private:
-  // Delegate to notify upon changes.
-  DirectoryWatcher::Delegate* delegate_;
-
-  // Path we're watching (passed to delegate).
-  FilePath path_;
-
-  // Indicates recursive watch.
-  bool recursive_;
-
-  // Backend stream we receive event callbacks from (strong reference).
-  FSEventStreamRef fsevent_stream_;
-
-  DISALLOW_COPY_AND_ASSIGN(DirectoryWatcherImpl);
-};
-
-void FSEventsCallback(ConstFSEventStreamRef stream,
-                      void* event_watcher, size_t num_events,
-                      void* event_paths, const FSEventStreamEventFlags flags[],
-                      const FSEventStreamEventId event_ids[]) {
-  char** paths = reinterpret_cast<char**>(event_paths);
-  DirectoryWatcherImpl* watcher =
-      reinterpret_cast<DirectoryWatcherImpl*> (event_watcher);
-  for (size_t i = 0; i < num_events; i++) {
-    watcher->OnFSEventsCallback(FilePath(paths[i]));
-  }
-}
-
-bool DirectoryWatcherImpl::Watch(const FilePath& path,
-                                 DirectoryWatcher::Delegate* delegate,
-                                 bool recursive) {
-  DCHECK(path_.value().empty());  // Can only watch one path.
-
-  DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI);
-
-  if (!file_util::PathExists(path))
-    return false;
-
-  path_ = path;
-  if (!file_util::AbsolutePath(&path_)) {
-    path_ = FilePath();  // Make sure we're marked as not-in-use.
-    return false;
-  }
-  delegate_ = delegate;
-  recursive_ = recursive;
-
-  scoped_cftyperef<CFStringRef> cf_path(CFStringCreateWithCString(
-      NULL, path.value().c_str(), kCFStringEncodingMacHFS));
-  CFStringRef path_for_array = cf_path.get();
-  scoped_cftyperef<CFArrayRef> watched_paths(CFArrayCreate(
-      NULL, reinterpret_cast<const void**>(&path_for_array), 1,
-      &kCFTypeArrayCallBacks));
-
-  FSEventStreamContext context;
-  context.version = 0;
-  context.info = this;
-  context.retain = NULL;
-  context.release = NULL;
-  context.copyDescription = NULL;
-
-  fsevent_stream_ = FSEventStreamCreate(NULL, &FSEventsCallback, &context,
-                                        watched_paths,
-                                        kFSEventStreamEventIdSinceNow,
-                                        kEventLatencySeconds,
-                                        kFSEventStreamCreateFlagNone);
-  FSEventStreamScheduleWithRunLoop(fsevent_stream_, CFRunLoopGetCurrent(),
-                                   kCFRunLoopDefaultMode);
-  FSEventStreamStart(fsevent_stream_);
-
-  return true;
-}
-
-}  // namespace
-
-DirectoryWatcher::DirectoryWatcher() {
-  impl_ = new DirectoryWatcherImpl();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/directory_watcher_stub.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2009 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.
-
-// This file exists for Linux systems which don't have the inotify headers, and
-// thus cannot build directory_watcher_inotify.cc
-
-#include "base/directory_watcher.h"
-
-class DirectoryWatcherImpl : public DirectoryWatcher::PlatformDelegate {
- public:
-  virtual bool Watch(const FilePath& path, DirectoryWatcher::Delegate* delegate,
-                     bool recursive) {
-    return false;
-  }
-};
-
-DirectoryWatcher::DirectoryWatcher() {
-  impl_ = new DirectoryWatcherImpl();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/directory_watcher_win.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/directory_watcher.h"
-
-#include "base/file_path.h"
-#include "base/logging.h"
-#include "base/object_watcher.h"
-#include "base/ref_counted.h"
-
-namespace {
-
-class DirectoryWatcherImpl : public DirectoryWatcher::PlatformDelegate,
-                             public base::ObjectWatcher::Delegate {
- public:
-  DirectoryWatcherImpl() : handle_(INVALID_HANDLE_VALUE) {}
-  virtual ~DirectoryWatcherImpl();
-
-  virtual bool Watch(const FilePath& path, DirectoryWatcher::Delegate* delegate,
-                     bool recursive);
-
-  // Callback from MessageLoopForIO.
-  virtual void OnObjectSignaled(HANDLE object);
-
- private:
-  // Delegate to notify upon changes.
-  DirectoryWatcher::Delegate* delegate_;
-  // Path we're watching (passed to delegate).
-  FilePath path_;
-  // Handle for FindFirstChangeNotification.
-  HANDLE handle_;
-  // ObjectWatcher to watch handle_ for events.
-  base::ObjectWatcher watcher_;
-
-  DISALLOW_COPY_AND_ASSIGN(DirectoryWatcherImpl);
-};
-
-DirectoryWatcherImpl::~DirectoryWatcherImpl() {
-  if (handle_ != INVALID_HANDLE_VALUE) {
-    watcher_.StopWatching();
-    FindCloseChangeNotification(handle_);
-  }
-}
-
-bool DirectoryWatcherImpl::Watch(const FilePath& path,
-    DirectoryWatcher::Delegate* delegate, bool recursive) {
-  DCHECK(path_.value().empty());  // Can only watch one path.
-
-  handle_ = FindFirstChangeNotification(
-      path.value().c_str(),
-      recursive,
-      FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE |
-      FILE_NOTIFY_CHANGE_LAST_WRITE);
-  if (handle_ == INVALID_HANDLE_VALUE)
-    return false;
-
-  delegate_ = delegate;
-  path_ = path;
-  watcher_.StartWatching(handle_, this);
-
-  return true;
-}
-
-void DirectoryWatcherImpl::OnObjectSignaled(HANDLE object) {
-  DCHECK(object == handle_);
-  // Make sure we stay alive through the body of this function.
-  scoped_refptr<DirectoryWatcherImpl> keep_alive(this);
-
-  delegate_->OnDirectoryChanged(path_);
-
-  // Register for more notifications on file change.
-  BOOL ok = FindNextChangeNotification(object);
-  DCHECK(ok);
-  watcher_.StartWatching(object, this);
-}
-
-}  // namespace
-
-DirectoryWatcher::DirectoryWatcher() {
-  impl_ = new DirectoryWatcherImpl();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/field_trial.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/field_trial.h"
-#include "base/logging.h"
-#include "base/rand_util.h"
-#include "base/string_util.h"
-
-using base::Time;
-
-// static
-const int FieldTrial::kNotParticipating = -1;
-
-//------------------------------------------------------------------------------
-// FieldTrial methods and members.
-
-FieldTrial::FieldTrial(const std::string& name,
-                       const Probability total_probability)
-  : name_(name),
-    divisor_(total_probability),
-    random_(static_cast<Probability>(divisor_ * base::RandDouble())),
-    accumulated_group_probability_(0),
-    next_group_number_(0),
-    group_(kNotParticipating) {
-  FieldTrialList::Register(this);
-}
-
-int FieldTrial::AppendGroup(const std::string& name,
-                            Probability group_probability) {
-  DCHECK(group_probability <= divisor_);
-  accumulated_group_probability_ += group_probability;
-  DCHECK(accumulated_group_probability_ <= divisor_);
-  if (group_ == kNotParticipating && accumulated_group_probability_ > random_) {
-    // This is the group that crossed the random line, so we do teh assignment.
-    group_ = next_group_number_;
-    if (name.empty())
-      StringAppendF(&group_name_, "_%d", group_);
-    else
-      group_name_ = name;
-  }
-  return next_group_number_++;
-}
-
-// static
-std::string FieldTrial::MakeName(const std::string& name_prefix,
-                                 const std::string& trial_name) {
-  std::string big_string(name_prefix);
-  return big_string.append(FieldTrialList::FindFullName(trial_name));
-}
-
-//------------------------------------------------------------------------------
-// FieldTrialList methods and members.
-
-// static
-FieldTrialList* FieldTrialList::global_ = NULL;
-
-FieldTrialList::FieldTrialList()
-  : application_start_time_(Time::Now()) {
-  DCHECK(!global_);
-  global_ = this;
-}
-
-FieldTrialList::~FieldTrialList() {
-  AutoLock auto_lock(lock_);
-  while (!registered_.empty()) {
-    RegistrationList::iterator it = registered_.begin();
-    it->second->Release();
-    registered_.erase(it->first);
-  }
-  DCHECK(this == global_);
-  global_ = NULL;
-}
-
-// static
-void FieldTrialList::Register(FieldTrial* trial) {
-  AutoLock auto_lock(global_->lock_);
-  DCHECK(!global_->PreLockedFind(trial->name()));
-  trial->AddRef();
-  global_->registered_[trial->name()] = trial;
-}
-
-// static
-int FieldTrialList::FindValue(const std::string& name) {
-  FieldTrial* field_trial = Find(name);
-  if (field_trial)
-    return field_trial->group();
-  return FieldTrial::kNotParticipating;
-}
-
-// static
-std::string FieldTrialList::FindFullName(const std::string& name) {
-  FieldTrial* field_trial = Find(name);
-  if (field_trial)
-    return field_trial->group_name();
-  return "";
-}
-
-// static
-FieldTrial* FieldTrialList::Find(const std::string& name) {
-  if (!global_)
-    return NULL;
-  AutoLock auto_lock(global_->lock_);
-  return global_->PreLockedFind(name);
-}
-
-FieldTrial* FieldTrialList::PreLockedFind(const std::string& name) {
-  RegistrationList::iterator it = registered_.find(name);
-  if (registered_.end() == it)
-    return NULL;
-  return it->second;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/field_trial.h
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// FieldTrial is a class for handling details of statistical experiments
-// performed by actual users in the field (i.e., in a shipped or beta product).
-// All code is called exclusively on the UI thread currently.
-//
-// The simplest example is an experiment to see whether one of two options
-// produces "better" results across our user population.  In that scenario, UMA
-// data is uploaded to aggregate the test results, and this FieldTrial class
-// manages the state of each such experiment (state == which option was
-// pseudo-randomly selected).
-//
-// States are typically generated randomly, either based on a one time
-// randomization (generated randomly once, and then persistently reused in the
-// client during each future run of the program), or by a startup randomization
-// (generated each time the application starts up, but held constant during the
-// duration of the process), or by continuous randomization across a run (where
-// the state can be recalculated again and again, many times during a process).
-// Only startup randomization is implemented thus far.
-
-//------------------------------------------------------------------------------
-// Example:  Suppose we have an experiment involving memory, such as determining
-// the impact of memory model command line flags actual memory use.
-// We assume that we already have a histogram of memory usage, such as:
-
-//   HISTOGRAM_COUNTS("Memory.RendererTotal", count);
-
-// Somewhere in main thread initialization code, we'd probably define an
-// instance of a FieldTrial, with code such as:
-
-// // Note, FieldTrials are reference counted, and persist automagically until
-// // process teardown, courtesy of their automatic registration in
-// // FieldTrialList.
-// scoped_refptr<FieldTrial> trial = new FieldTrial("MemoryExperiment", 1000);
-// int group1 = trial->AppendGroup("_high_mem", 20);  // 2% in _high_mem group.
-// int group2 = trial->AppendGroup("_low_mem", 20);   // 2% in _low_mem group.
-// // Take action depending of which group we randomly land in.
-// if (trial->group() == group1)
-//   SetMemoryModel(HIGH);  // Sample setting of browser state.
-// else if (trial->group() == group2)
-//   SetMemoryModel(LOW);  // Sample alternate setting.
-
-// We then modify any histograms we wish to correlate with our experiment to
-// have slighly different names, depending on what group the trial instance
-// happened (randomly) to be assigned to:
-
-// HISTOGRAM_COUNTS(FieldTrial::MakeName("Memory.RendererTotal",
-//                                       "MemoryExperiment").data(), count);
-
-// The above code will create 3 distinct histograms, with each run of the
-// application being assigned to of of teh three groups, and for each group, the
-// correspondingly named histogram will be populated:
-
-// Memory.RendererTotal            // 96% of users still fill this histogram.
-// Memory.RendererTotal_high_mem   // 2% of users will fill this histogram.
-// Memory.RendererTotal_low_mem    // 2% of users will fill this histogram.
-
-//------------------------------------------------------------------------------
-
-#ifndef BASE_FIELD_TRIAL_H_
-#define BASE_FIELD_TRIAL_H_
-
-#include <map>
-#include <string>
-
-#include "base/lock.h"
-#include "base/non_thread_safe.h"
-#include "base/ref_counted.h"
-#include "base/time.h"
-
-
-class FieldTrial : public base::RefCounted<FieldTrial> {
- public:
-  static const int kNotParticipating;
-
-  typedef int Probability;  // Use scaled up probability.
-
-  // The name is used to register the instance with the FieldTrialList class,
-  // and can be used to find the trial (only one trial can be present for each
-  // name).
-  // Group probabilities that are later supplied must sum to less than or equal
-  // to the total_probability.
-  FieldTrial(const std::string& name, Probability total_probability);
-
-  // Establish the name and probability of the next group in this trial.
-  // Sometimes, based on construction randomization, this call may causes the
-  // provided group to be *THE* group selected for use in this instance.
-  int AppendGroup(const std::string& name, Probability group_probability);
-
-  // Return the name of the FieldTrial (excluding the group name).
-  std::string name() const { return name_; }
-
-  // Return the randomly selected group number that was assigned.
-  // Return kNotParticipating if the instance is not participating in the
-  // experiment.
-  int group() const { return group_; }
-
-  // If the field trial is not in an experiment, this returns the empty string.
-  // if the group's name is empty, a name of "_" concatenated with the group
-  // number is used as the group name.
-  std::string group_name() const { return group_name_; }
-
-  // Helper function for the most common use: as an argument to specifiy the
-  // name of a HISTOGRAM.  Use the original histogram name as the name_prefix.
-  static std::string MakeName(const std::string& name_prefix,
-                              const std::string& trial_name);
-
- private:
-  // The name of the field trial, as can be found via the FieldTrialList.
-  // This is empty of the trial is not in the experiment.
-  const std::string name_;
-
-  // The maximu sum of all probabilities supplied, which corresponds to 100%.
-  // This is the scaling factor used to adjust supplied probabilities.
-  Probability divisor_;
-
-  // The randomly selected probability that is used to select a group (or have
-  // the instance not participate).  It is the product of divisor_ and a random
-  // number between [0, 1).
-  Probability random_;
-
-  // Sum of the probabilities of all appended groups.
-  Probability accumulated_group_probability_;
-
-  int next_group_number_;
-
-  // The pseudo-randomly assigned group number.
-  // This is kNotParticipating if no group has been assigned.
-  int group_;
-
-  // A textual name for the randomly selected group, including the Trial name.
-  // If this Trial is not a member of an group, this string is empty.
-  std::string group_name_;
-
-  DISALLOW_COPY_AND_ASSIGN(FieldTrial);
-};
-
-//------------------------------------------------------------------------------
-// Class with a list of all active field trials.  A trial is active if it has
-// been registered, which includes evaluating its state based on its probaility.
-// Only one instance of this class exists.
-class FieldTrialList {
- public:
-  // This singleton holds the global list of registered FieldTrials.
-  FieldTrialList();
-  // Destructor Release()'s references to all registered FieldTrial instances.
-  ~FieldTrialList();
-
-  // Register() stores a pointer to the given trial in a global map.
-  // This method also AddRef's the indicated trial.
-  static void Register(FieldTrial* trial);
-
-  // The Find() method can be used to test to see if a named Trial was already
-  // registered, or to retrieve a pointer to it from the global map.
-  static FieldTrial* Find(const std::string& name);
-
-  static int FindValue(const std::string& name);
-
-  static std::string FindFullName(const std::string& name);
-
-  // The time of construction of the global map is recorded in a static variable
-  // and is commonly used by experiments to identify the time since the start
-  // of the application.  In some experiments it may be useful to discount
-  // data that is gathered before the application has reached sufficient
-  // stability (example: most DLL have loaded, etc.)
-  static base::Time application_start_time() {
-    if (global_)
-      return global_->application_start_time_;
-    // For testing purposes only, or when we don't yet have a start time.
-    return base::Time::Now();
-  }
-
- private:
-  // Helper function should be called only while holding lock_.
-  FieldTrial* PreLockedFind(const std::string& name);
-
-  typedef std::map<std::string, FieldTrial*> RegistrationList;
-
-  static FieldTrialList* global_;  // The singleton of this class.
-
-  base::Time application_start_time_;
-
-  // Lock for access to registered_.
-  Lock lock_;
-  RegistrationList registered_;
-
-  DISALLOW_COPY_AND_ASSIGN(FieldTrialList);
-};
-
-#endif  // BASE_FIELD_TRIAL_H_
--- a/ipc/chromium/src/base/file_util.cc
+++ b/ipc/chromium/src/base/file_util.cc
@@ -24,66 +24,24 @@
 namespace {
 
 const FilePath::CharType kExtensionSeparator = FILE_PATH_LITERAL('.');
 
 }  // namespace
 
 namespace file_util {
 
-void PathComponents(const FilePath& path,
-                    std::vector<FilePath::StringType>* components) {
-  DCHECK(components);
-  if (!components)
-    return;
-
-  FilePath::StringType path_str = path.value();
-  FilePath::StringType::size_type start = 0;
-  FilePath::StringType::size_type end =
-      path_str.find_first_of(FilePath::kSeparators);
-
-  // If the path starts with a separator, add it to components.
-  if (end == start) {
-    components->push_back(FilePath::StringType(path_str, 0, 1));
-    start = end + 1;
-    end = path_str.find_first_of(FilePath::kSeparators, start);
-  }
-  while (end != FilePath::StringType::npos) {
-    FilePath::StringType component =
-        FilePath::StringType(path_str, start, end - start);
-    components->push_back(component);
-    start = end + 1;
-    end = path_str.find_first_of(FilePath::kSeparators, start);
-  }
-
-  components->push_back(FilePath::StringType(path_str, start));
-}
-
 bool EndsWithSeparator(const FilePath& path) {
   FilePath::StringType value = path.value();
   if (value.empty())
     return false;
 
   return FilePath::IsSeparator(value[value.size() - 1]);
 }
 
-bool EnsureEndsWithSeparator(FilePath* path) {
-  if (!DirectoryExists(*path))
-    return false;
-
-  if (EndsWithSeparator(*path))
-    return true;
-
-  FilePath::StringType& path_str =
-      const_cast<FilePath::StringType&>(path->value());
-  path_str.append(&FilePath::kSeparators[0], 1);
-
-  return true;
-}
-
 void TrimTrailingSeparator(std::wstring* dir) {
   while (dir->length() > 1 && EndsWithSeparator(dir))
     dir->resize(dir->length() - 1);
 }
 
 FilePath::StringType GetFileExtensionFromPath(const FilePath& path) {
   FilePath::StringType file_name = path.BaseName().value();
   const FilePath::StringType::size_type last_dot =
@@ -135,67 +93,16 @@ void ReplaceExtension(FilePath* path, co
   if ((last_dot > last_separator ||
       last_separator == FilePath::StringType::npos) &&
       last_dot != FilePath::StringType::npos)
     value.erase(last_dot);
 
   value.append(clean_extension);
 }
 
-bool ContentsEqual(const FilePath& filename1, const FilePath& filename2) {
-  // We open the file in binary format even if they are text files because
-  // we are just comparing that bytes are exactly same in both files and not
-  // doing anything smart with text formatting.
-  std::ifstream file1, file2;
-
-  filename1.OpenInputStream(file1);
-  filename2.OpenInputStream(file2);
-
-  // Even if both files aren't openable (and thus, in some sense, "equal"),
-  // any unusable file yields a result of "false".
-  if (!file1.is_open() || !file2.is_open())
-    return false;
-
-  const int BUFFER_SIZE = 2056;
-  char buffer1[BUFFER_SIZE], buffer2[BUFFER_SIZE];
-  do {
-    file1.read(buffer1, BUFFER_SIZE);
-    file2.read(buffer2, BUFFER_SIZE);
-
-    if ((file1.eof() && !file2.eof()) ||
-        (!file1.eof() && file2.eof()) ||
-        (file1.gcount() != file2.gcount()) ||
-        (memcmp(buffer1, buffer2, file1.gcount()))) {
-      file1.close();
-      file2.close();
-      return false;
-    }
-  } while (!file1.eof() && !file2.eof());
-
-  file1.close();
-  file2.close();
-  return true;
-}
-
-bool ReadFileToString(const FilePath& path, std::string* contents) {
-  FILE* file = OpenFile(path, "rb");
-  if (!file) {
-    return false;
-  }
-
-  char buf[1 << 16];
-  size_t len;
-  while ((len = fread(buf, 1, sizeof(buf), file)) > 0) {
-    contents->append(buf, len);
-  }
-  CloseFile(file);
-
-  return true;
-}
-
 FILE* CreateAndOpenTemporaryFile(FilePath* path) {
   FilePath directory;
   if (!GetTempDir(&directory))
     return NULL;
 
   return CreateAndOpenTemporaryFileInDir(directory, path);
 }
 
@@ -208,90 +115,18 @@ bool GetFileSize(const FilePath& file_pa
 }
 
 bool CloseFile(FILE* file) {
   if (file == NULL)
     return true;
   return fclose(file) == 0;
 }
 
-bool TruncateFile(FILE* file) {
-  if (file == NULL)
-    return false;
-  long current_offset = ftell(file);
-  if (current_offset == -1)
-    return false;
-#if defined(OS_WIN)
-  int fd = _fileno(file);
-  if (_chsize(fd, current_offset) != 0)
-    return false;
-#else
-  int fd = fileno(file);
-  if (ftruncate(fd, current_offset) != 0)
-    return false;
-#endif
-  return true;
-}
-
-bool ContainsPath(const FilePath &parent, const FilePath& child) {
-  FilePath abs_parent = FilePath(parent);
-  FilePath abs_child = FilePath(child);
-
-  if (!file_util::AbsolutePath(&abs_parent) ||
-      !file_util::AbsolutePath(&abs_child))
-    return false;
-
-#if defined(OS_WIN)
-  // file_util::AbsolutePath() does not flatten case on Windows, so we must do
-  // a case-insensitive compare.
-  if (!StartsWith(abs_child.value(), abs_parent.value(), false))
-#else
-  if (!StartsWithASCII(abs_child.value(), abs_parent.value(), true))
-#endif
-    return false;
-
-  // file_util::AbsolutePath() normalizes '/' to '\' on Windows, so we only need
-  // to check kSeparators[0].
-  if (abs_child.value().length() <= abs_parent.value().length() ||
-      abs_child.value()[abs_parent.value().length()] !=
-          FilePath::kSeparators[0])
-    return false;
-
-  return true;
-}
-
-///////////////////////////////////////////////
-// MemoryMappedFile
-
-MemoryMappedFile::~MemoryMappedFile() {
-  CloseHandles();
-}
-
-bool MemoryMappedFile::Initialize(const FilePath& file_name) {
-  if (IsValid())
-    return false;
-
-  if (!MapFileToMemory(file_name)) {
-    CloseHandles();
-    return false;
-  }
-
-  return true;
-}
-
-bool MemoryMappedFile::IsValid() {
-  return data_ != NULL;
-}
-
 // Deprecated functions ----------------------------------------------------
 
-bool ReadFileToString(const std::wstring& path, std::string* contents) {
-  return ReadFileToString(FilePath::FromWStringHack(path), contents);
-}
-
 bool AbsolutePath(std::wstring* path_str) {
   FilePath path(FilePath::FromWStringHack(*path_str));
   if (!AbsolutePath(&path))
     return false;
   *path_str = path.ToWStringHack();
   return true;
 }
 void AppendToPath(std::wstring* path, const std::wstring& new_ending) {
@@ -305,21 +140,16 @@ void AppendToPath(std::wstring* path, co
   path->append(new_ending);
 }
 bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path,
                    bool recursive) {
   return CopyDirectory(FilePath::FromWStringHack(from_path),
                        FilePath::FromWStringHack(to_path),
                        recursive);
 }
-bool ContentsEqual(const std::wstring& filename1,
-                   const std::wstring& filename2) {
-  return ContentsEqual(FilePath::FromWStringHack(filename1),
-                       FilePath::FromWStringHack(filename2));
-}
 bool CopyFile(const std::wstring& from_path, const std::wstring& to_path) {
   return CopyFile(FilePath::FromWStringHack(from_path),
                   FilePath::FromWStringHack(to_path));
 }
 bool CreateDirectory(const std::wstring& full_path) {
   return CreateDirectory(FilePath::FromWStringHack(full_path));
 }
 bool CreateNewTempDirectory(const std::wstring& prefix,
@@ -384,20 +214,16 @@ bool GetFileSize(const std::wstring& fil
 }
 bool GetTempDir(std::wstring* path_str) {
   FilePath path;
   if (!GetTempDir(&path))
     return false;
   *path_str = path.ToWStringHack();
   return true;
 }
-bool Move(const std::wstring& from_path, const std::wstring& to_path) {
-  return Move(FilePath::FromWStringHack(from_path),
-              FilePath::FromWStringHack(to_path));
-}
 FILE* OpenFile(const std::wstring& filename, const char* mode) {
   return OpenFile(FilePath::FromWStringHack(filename), mode);
 }
 bool PathExists(const std::wstring& path) {
   return PathExists(FilePath::FromWStringHack(path));
 }
 bool PathIsWritable(const std::wstring& path) {
   return PathIsWritable(FilePath::FromWStringHack(path));
@@ -411,22 +237,12 @@ bool SetCurrentDirectory(const std::wstr
 void UpOneDirectory(std::wstring* dir) {
   FilePath path = FilePath::FromWStringHack(*dir);
   FilePath directory = path.DirName();
   // If there is no separator, we will get back kCurrentDirectory.
   // In this case don't change |dir|.
   if (directory.value() != FilePath::kCurrentDirectory)
     *dir = directory.ToWStringHack();
 }
-void UpOneDirectoryOrEmpty(std::wstring* dir) {
-  FilePath path = FilePath::FromWStringHack(*dir);
-  FilePath directory = path.DirName();
-  // If there is no separator, we will get back kCurrentDirectory.
-  // In this case, clear dir.
-  if (directory == path || directory.value() == FilePath::kCurrentDirectory)
-    dir->clear();
-  else
-    *dir = directory.ToWStringHack();
-}
 int WriteFile(const std::wstring& filename, const char* data, int size) {
   return WriteFile(FilePath::FromWStringHack(filename), data, size);
 }
 }  // namespace
--- a/ipc/chromium/src/base/file_util.h
+++ b/ipc/chromium/src/base/file_util.h
@@ -25,148 +25,84 @@
 #include <stack>
 #include <string>
 #include <vector>
 
 #include "base/basictypes.h"
 #include "base/scoped_ptr.h"
 #include "base/file_path.h"
 
-namespace base {
-class Time;
-}
-
 namespace file_util {
 
 //-----------------------------------------------------------------------------
 // Functions that operate purely on a path string w/o touching the filesystem:
 
-// Returns a vector of all of the components of the provided path.
-void PathComponents(const FilePath& path,
-                    std::vector<FilePath::StringType>* components);
-#if defined(OS_WIN)
-// Deprecated temporary compatibility function.
-void PathComponents(const std::wstring& path,
-                    std::vector<std::wstring>* components);
-#endif
-
 // Returns true if the given path ends with a path separator character.
 bool EndsWithSeparator(const FilePath& path);
 // These two versions are both deprecated. TODO(estade): remove them.
 bool EndsWithSeparator(std::wstring* path);
 bool EndsWithSeparator(const std::wstring& path);
 
-// Makes sure that |path| ends with a separator IFF path is a directory that
-// exists. Returns true if |path| is an existing directory, false otherwise.
-bool EnsureEndsWithSeparator(FilePath* path);
-
 // Modifies a string by trimming all trailing separators from the end.
 // Deprecated. FilePath does this automatically, and if it's constructed from a
 // path with a trailing separator, StripTrailingSeparators() may be used.
 void TrimTrailingSeparator(std::wstring* dir);
 
 // Strips the topmost directory from the end of 'dir'.  Assumes 'dir' does not
 // refer to a file.
 // If 'dir' is a root directory, return without change.
 // Deprecated. Use FilePath::DirName instead.
 void UpOneDirectory(std::wstring* dir);
-// Strips the topmost directory from the end of 'dir'.  Assumes 'dir' does not
-// refer to a file.
-// If 'dir' is a root directory, the result becomes empty string.
-// Deprecated. Use FilePath::DirName instead.
-void UpOneDirectoryOrEmpty(std::wstring* dir);
 
 // Returns the filename portion of 'path', without any leading \'s or /'s.
 // Deprecated. Use FilePath::BaseName instead.
 std::wstring GetFilenameFromPath(const std::wstring& path);
 
 // Deprecated compatibility function.  Use FilePath::Extension.
 FilePath::StringType GetFileExtensionFromPath(const FilePath& path);
 // Deprecated temporary compatibility function.
 std::wstring GetFileExtensionFromPath(const std::wstring& path);
 
-// Returns the directory component of a path, without the trailing
-// path separator, or an empty string on error. The function does not
-// check for the existence of the path, so if it is passed a directory
-// without the trailing \, it will interpret the last component of the
-// path as a file and chomp it. This does not support relative paths.
-// Examples:
-// path == "C:\pics\jojo.jpg",     returns "C:\pics"
-// path == "C:\Windows\system32\", returns "C:\Windows\system32"
-// path == "C:\Windows\system32",  returns "C:\Windows"
-std::wstring GetDirectoryFromPath(const std::wstring& path);
-
 // Appends new_ending to path, adding a separator between the two if necessary.
 void AppendToPath(std::wstring* path, const std::wstring& new_ending);
 
 // Convert provided relative path into an absolute path.  Returns false on
 // error. On POSIX, this function fails if the path does not exist.
 bool AbsolutePath(FilePath* path);
 // Deprecated temporary compatibility function.
 bool AbsolutePath(std::wstring* path);
 
-// Returns true if |parent| contains |child|. Both paths are converted to
-// absolute paths before doing the comparison.
-bool ContainsPath(const FilePath& parent, const FilePath& child);
-
 // Deprecated compatibility function.  Use FilePath::InsertBeforeExtension.
 void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix);
 
 // Deprecated compatibility function.  Use FilePath::ReplaceExtension.
 void ReplaceExtension(FilePath* file_name,
                       const FilePath::StringType& extension);
 
 #if defined(OS_WIN)
 // Deprecated temporary compatibility functions.
 void InsertBeforeExtension(std::wstring* path, const std::wstring& suffix);
 void ReplaceExtension(std::wstring* file_name, const std::wstring& extension);
 #endif
 
-// Replaces characters in 'file_name' that are illegal for file names with
-// 'replace_char'. 'file_name' must not be a full or relative path, but just the
-// file name component. Any leading or trailing whitespace in 'file_name' is
-// removed.
-// Example:
-//   file_name == "bad:file*name?.txt", changed to: "bad-file-name-.txt" when
-//   'replace_char' is '-'.
-void ReplaceIllegalCharacters(std::wstring* file_name, int replace_char);
-
 //-----------------------------------------------------------------------------
 // Functions that involve filesystem access or modification:
 
-// created on or after the given |file_time|.  Doesn't count ".." or ".".
-//
-// Note for POSIX environments: a file created before |file_time|
-// can be mis-detected as a newer file due to low precision of
-// timestmap of file creation time. If you need to avoid such
-// mis-detection perfectly, you should wait one second before
-// obtaining |file_time|.
-int CountFilesCreatedAfter(const FilePath& path,
-                           const base::Time& file_time);
-
 // Deletes the given path, whether it's a file or a directory.
 // If it's a directory, it's perfectly happy to delete all of the
 // directory's contents.  Passing true to recursive deletes
 // subdirectories and their contents as well.
 // Returns true if successful, false otherwise.
 //
 // WARNING: USING THIS WITH recursive==true IS EQUIVALENT
 //          TO "rm -rf", SO USE WITH CAUTION.
 bool Delete(const FilePath& path, bool recursive);
 // Deprecated temporary compatibility function.
 bool Delete(const std::wstring& path, bool recursive);
 
-// Moves the given path, whether it's a file or a directory.
-// If a simple rename is not possible, such as in the case where the paths are
-// on different volumes, this will attempt to copy and delete. Returns
-// true for success.
-bool Move(const FilePath& from_path, const FilePath& to_path);
-// Deprecated temporary compatibility function.
-bool Move(const std::wstring& from_path, const std::wstring& to_path);
-
 // Copies a single file. Use CopyDirectory to copy directories.
 bool CopyFile(const FilePath& from_path, const FilePath& to_path);
 // Deprecated temporary compatibility function.
 bool CopyFile(const std::wstring& from_path, const std::wstring& to_path);
 
 // Copies the given path, and optionally all subdirectories and their contents
 // as well.
 // If there are files existing under to_path, always overwrite.
@@ -191,94 +127,23 @@ bool PathIsWritable(const FilePath& path
 // Deprecated temporary compatibility function.
 bool PathIsWritable(const std::wstring& path);
 
 // Returns true if the given path exists and is a directory, false otherwise.
 bool DirectoryExists(const FilePath& path);
 // Deprecated temporary compatibility function.
 bool DirectoryExists(const std::wstring& path);
 
-#if defined(OS_WIN)
-// Gets the creation time of the given file (expressed in the local timezone),
-// and returns it via the creation_time parameter.  Returns true if successful,
-// false otherwise.
-bool GetFileCreationLocalTime(const std::wstring& filename,
-                              LPSYSTEMTIME creation_time);
-
-// Same as above, but takes a previously-opened file handle instead of a name.
-bool GetFileCreationLocalTimeFromHandle(HANDLE file_handle,
-                                        LPSYSTEMTIME creation_time);
-#endif  // defined(OS_WIN)
-
-// Returns true if the contents of the two files given are equal, false
-// otherwise.  If either file can't be read, returns false.
-bool ContentsEqual(const FilePath& filename1,
-                   const FilePath& filename2);
-// Deprecated temporary compatibility function.
-bool ContentsEqual(const std::wstring& filename1,
-                   const std::wstring& filename2);
-
-// Read the file at |path| into |contents|, returning true on success.
-// Useful for unit tests.
-bool ReadFileToString(const FilePath& path, std::string* contents);
-// Deprecated version.
-bool ReadFileToString(const std::wstring& path, std::string* contents);
-
 #if defined(OS_POSIX)
 // Read exactly |bytes| bytes from file descriptor |fd|, storing the result
 // in |buffer|. This function is protected against EINTR and partial reads.
 // Returns true iff |bytes| bytes have been successfuly read from |fd|.
 bool ReadFromFD(int fd, char* buffer, size_t bytes);
 #endif  // defined(OS_POSIX)
 
-#if defined(OS_WIN)
-// Resolve Windows shortcut (.LNK file)
-// Argument path specifies a valid LNK file. On success, return true and put
-// the URL into path. If path is a invalid .LNK file, return false.
-bool ResolveShortcut(FilePath* path);
-// Deprecated temporary compatibility function.
-bool ResolveShortcut(std::wstring* path);
-
-// Create a Windows shortcut (.LNK file)
-// This method creates a shortcut link using the information given. Ensure
-// you have initialized COM before calling into this function. 'source'
-// and 'destination' parameters are required, everything else can be NULL.
-// 'source' is the existing file, 'destination' is the new link file to be
-// created; for best results pass the filename with the .lnk extension.
-// The 'icon' can specify a dll or exe in which case the icon index is the
-// resource id.
-// Note that if the shortcut exists it will overwrite it.
-bool CreateShortcutLink(const wchar_t *source, const wchar_t *destination,
-                        const wchar_t *working_dir, const wchar_t *arguments,
-                        const wchar_t *description, const wchar_t *icon,
-                        int icon_index);
-
-// Update a Windows shortcut (.LNK file). This method assumes the shortcut
-// link already exists (otherwise false is returned). Ensure you have
-// initialized COM before calling into this function. Only 'destination'
-// parameter is required, everything else can be NULL (but if everything else
-// is NULL no changes are made to the shortcut). 'destination' is the link
-// file to be updated. For best results pass the filename with the .lnk
-// extension.
-bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination,
-                        const wchar_t *working_dir, const wchar_t *arguments,
-                        const wchar_t *description, const wchar_t *icon,
-                        int icon_index);
-
-// Return true if the given directory is empty
-bool IsDirectoryEmpty(const std::wstring& dir_path);
-
-// Copy from_path to to_path recursively and then delete from_path recursively.
-// Returns true if all operations succeed.
-// This function simulates Move(), but unlike Move() it works across volumes.
-// This fuction is not transactional.
-bool CopyAndDeleteDirectory(const FilePath& from_path,
-                            const FilePath& to_path);
-#endif
-
 // Get the temporary directory provided by the system.
 bool GetTempDir(FilePath* path);
 // Deprecated temporary compatibility function.
 bool GetTempDir(std::wstring* path);
 // Get a temporary directory for shared memory files.
 // Only useful on POSIX; redirects to GetTempDir() on Windows.
 bool GetShmemTempDir(FilePath* path);
 
@@ -349,20 +214,16 @@ bool GetFileInfo(const std::wstring& fil
 FILE* OpenFile(const FilePath& filename, const char* mode);
 // Deprecated temporary compatibility functions.
 FILE* OpenFile(const std::string& filename, const char* mode);
 FILE* OpenFile(const std::wstring& filename, const char* mode);
 
 // Closes file opened by OpenFile. Returns true on success.
 bool CloseFile(FILE* file);
 
-// Truncates an open file to end at the location of the current file pointer.
-// This is a cross-platform analog to Windows' SetEndOfFile() function.
-bool TruncateFile(FILE* file);
-
 // Reads the given number of bytes from the file into the buffer.  Returns
 // the number of read bytes, or -1 on error.
 int ReadFile(const FilePath& filename, char* data, int size);
 // Deprecated temporary compatibility function.
 int ReadFile(const std::wstring& filename, char* data, int size);
 
 // Writes the given buffer into the file, overwriting any data that was
 // previously there.  Returns the number of bytes written, or -1 on error.
@@ -375,153 +236,11 @@ bool GetCurrentDirectory(FilePath* path)
 // Deprecated temporary compatibility function.
 bool GetCurrentDirectory(std::wstring* path);
 
 // Sets the current working directory for the process.
 bool SetCurrentDirectory(const FilePath& path);
 // Deprecated temporary compatibility function.
 bool SetCurrentDirectory(const std::wstring& current_directory);
 
-// A class to handle auto-closing of FILE*'s.
-class ScopedFILEClose {
- public:
-  inline void operator()(FILE* x) const {
-    if (x) {
-      fclose(x);
-    }
-  }
-};
-
-typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE;
-
-// A class for enumerating the files in a provided path. The order of the
-// results is not guaranteed.
-//
-// DO NOT USE FROM THE MAIN THREAD of your application unless it is a test
-// program where latency does not matter. This class is blocking.
-class FileEnumerator {
- public:
-#if defined(OS_WIN)
-  typedef WIN32_FIND_DATA FindInfo;
-#elif defined(OS_POSIX)
-  typedef struct {
-    struct stat stat;
-    std::string filename;
-  } FindInfo;
-#endif
-
-  enum FILE_TYPE {
-    FILES                 = 0x1,
-    DIRECTORIES           = 0x2,
-    FILES_AND_DIRECTORIES = 0x3
-  };
-
-  // |root_path| is the starting directory to search for. It may or may not end
-  // in a slash.
-  //
-  // If |recursive| is true, this will enumerate all matches in any
-  // subdirectories matched as well. It does a breadth-first search, so all
-  // files in one directory will be returned before any files in a
-  // subdirectory.
-  //
-  // |file_type| specifies whether the enumerator should match files,
-  // directories, or both.
-  //
-  // |pattern| is an optional pattern for which files to match. This
-  // works like shell globbing. For example, "*.txt" or "Foo???.doc".
-  // However, be careful in specifying patterns that aren't cross platform
-  // since the underlying code uses OS-specific matching routines.  In general,
-  // Windows matching is less featureful than others, so test there first.
-  // If unspecified, this will match all files.
-  // NOTE: the pattern only matches the contents of root_path, not files in
-  // recursive subdirectories.
-  // TODO(erikkay): Fix the pattern matching to work at all levels.
-  FileEnumerator(const FilePath& root_path,
-                 bool recursive,
-                 FileEnumerator::FILE_TYPE file_type);
-  FileEnumerator(const FilePath& root_path,
-                 bool recursive,
-                 FileEnumerator::FILE_TYPE file_type,
-                 const FilePath::StringType& pattern);
-  ~FileEnumerator();
-
-  // Returns an empty string if there are no more results.
-  FilePath Next();
-
-  // Write the file info into |info|.
-  void GetFindInfo(FindInfo* info);
-
- private:
-  FilePath root_path_;
-  bool recursive_;
-  FILE_TYPE file_type_;
-  FilePath pattern_;  // Empty when we want to find everything.
-
-  // Set to true when there is a find operation open. This way, we can lazily
-  // start the operations when the caller calls Next().
-  bool is_in_find_op_;
-
-  // A stack that keeps track of which subdirectories we still need to
-  // enumerate in the breadth-first search.
-  std::stack<FilePath> pending_paths_;
-
-#if defined(OS_WIN)
-  WIN32_FIND_DATA find_data_;
-  HANDLE find_handle_;
-#elif defined(ANDROID)
-  void *fts_;
-#elif defined(OS_POSIX)
-  FTS* fts_;
-  FTSENT* fts_ent_;
-#endif
-
-  DISALLOW_EVIL_CONSTRUCTORS(FileEnumerator);
-};
-
-class MemoryMappedFile {
- public:
-  // The default constructor sets all members to invalid/null values.
-  MemoryMappedFile();
-  ~MemoryMappedFile();
-
-  // Opens an existing file and maps it into memory. Access is restricted to
-  // read only. If this object already points to a valid memory mapped file
-  // then this method will fail and return false. If it cannot open the file,
-  // the file does not exist, or the memory mapping fails, it will return false.
-  // Later we may want to allow the user to specify access.
-  bool Initialize(const FilePath& file_name);
-
-  const uint8_t* data() const { return data_; }
-  size_t length() const { return length_; }
-
-  // Is file_ a valid file handle that points to an open, memory mapped file?
-  bool IsValid();
-
- private:
-  // Map the file to memory, set data_ to that memory address. Return true on
-  // success, false on any kind of failure. This is a helper for Initialize().
-  bool MapFileToMemory(const FilePath& file_name);
-
-  // Closes all open handles. Later we may want to make this public.
-  void CloseHandles();
-
-#if defined(OS_WIN)
-  HANDLE file_;
-  HANDLE file_mapping_;
-#elif defined(OS_POSIX)
-  // The file descriptor.
-  int file_;
-#endif
-  uint8_t* data_;
-  size_t length_;
-
-  DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile);
-};
-
-// Renames a file using the SHFileOperation API to ensure that the target file
-// gets the correct default security descriptor in the new path.
-bool RenameFileAndResetSecurityDescriptor(
-    const FilePath& source_file_path,
-    const FilePath& target_file_path);
-
 }  // namespace file_util
 
 #endif  // BASE_FILE_UTIL_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/file_util_icu.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2009 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.
-
-// File utilities that use the ICU library go in this file.  Functions using ICU
-// are separated from the other functions to prevent ICU being pulled in by the
-// linker if there is a false dependency.
-//
-// (The VS2005 linker finds such a false dependency and adds ~300K of ICU to
-// chrome.exe if this code lives in file_util.cc, even though none of this code
-// is called.)
-
-#include "base/file_util.h"
-
-#include "base/string_util.h"
-#include "unicode/uniset.h"
-
-namespace file_util {
-
-void ReplaceIllegalCharacters(std::wstring* file_name, int replace_char) {
-  DCHECK(file_name);
-
-  // Control characters, formatting characters, non-characters, and
-  // some printable ASCII characters regarded as dangerous ('"*/:<>?\\').
-  // See  http://blogs.msdn.com/michkap/archive/2006/11/03/941420.aspx
-  // and http://msdn2.microsoft.com/en-us/library/Aa365247.aspx
-  // TODO(jungshik): Revisit the set. ZWJ and ZWNJ are excluded because they
-  // are legitimate in Arabic and some S/SE Asian scripts. However, when used
-  // elsewhere, they can be confusing/problematic.
-  // Also, consider wrapping the set with our Singleton class to create and
-  // freeze it only once. Note that there's a trade-off between memory and
-  // speed.
-
-  UErrorCode status = U_ZERO_ERROR;
-#if defined(WCHAR_T_IS_UTF16)
-  UnicodeSet illegal_characters(UnicodeString(
-      L"[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\u200c\u200d]]"), status);
-#else
-  UnicodeSet illegal_characters(UNICODE_STRING_SIMPLE(
-      "[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\\u200c\\u200d]]").unescape(), status);
-#endif
-  DCHECK(U_SUCCESS(status));
-  // Add non-characters. If this becomes a performance bottleneck by
-  // any chance, check |ucs4 & 0xFFFEu == 0xFFFEu|, instead.
-  illegal_characters.add(0xFDD0, 0xFDEF);
-  for (int i = 0; i <= 0x10; ++i) {
-    int plane_base = 0x10000 * i;
-    illegal_characters.add(plane_base + 0xFFFE, plane_base + 0xFFFF);
-  }
-  illegal_characters.freeze();
-  DCHECK(!illegal_characters.contains(replace_char) && replace_char < 0x10000);
-
-  // Remove leading and trailing whitespace.
-  TrimWhitespace(*file_name, TRIM_ALL, file_name);
-
-  std::wstring::size_type i = 0;
-  std::wstring::size_type length = file_name->size();
-  const wchar_t* wstr = file_name->data();
-#if defined(WCHAR_T_IS_UTF16)
-  // Using |span| method of UnicodeSet might speed things up a bit, but
-  // it's not likely to matter here.
-  std::wstring temp;
-  temp.reserve(length);
-  while (i < length) {
-    UChar32 ucs4;
-    std::wstring::size_type prev = i;
-    U16_NEXT(wstr, i, length, ucs4);
-    if (illegal_characters.contains(ucs4)) {
-      temp.push_back(replace_char);
-    } else if (ucs4 < 0x10000) {
-      temp.push_back(ucs4);
-    } else {
-      temp.push_back(wstr[prev]);
-      temp.push_back(wstr[prev + 1]);
-    }
-  }
-  file_name->swap(temp);
-#elif defined(WCHAR_T_IS_UTF32)
-  while (i < length) {
-    if (illegal_characters.contains(wstr[i])) {
-      (*file_name)[i] = replace_char;
-    }
-    ++i;
-  }
-#else
-#error wchar_t* should be either UTF-16 or UTF-32
-#endif
-}
-
-}  // namespace
--- a/ipc/chromium/src/base/file_util_posix.cc
+++ b/ipc/chromium/src/base/file_util_posix.cc
@@ -36,78 +36,24 @@
 namespace file_util {
 
 #if defined(GOOGLE_CHROME_BUILD)
 static const char* kTempFileName = "com.google.chrome.XXXXXX";
 #else
 static const char* kTempFileName = "org.chromium.XXXXXX";
 #endif
 
-std::wstring GetDirectoryFromPath(const std::wstring& path) {
-  if (EndsWithSeparator(path)) {
-    std::wstring dir = path;
-    TrimTrailingSeparator(&dir);
-    return dir;
-  } else {
-    char full_path[PATH_MAX];
-    base::strlcpy(full_path, WideToUTF8(path).c_str(), arraysize(full_path));
-    return UTF8ToWide(dirname(full_path));
-  }
-}
-
 bool AbsolutePath(FilePath* path) {
   char full_path[PATH_MAX];
   if (realpath(path->value().c_str(), full_path) == NULL)
     return false;
   *path = FilePath(full_path);
   return true;
 }
 
-int CountFilesCreatedAfter(const FilePath& path,
-                           const base::Time& comparison_time) {
-  int file_count = 0;
-
-  DIR* dir = opendir(path.value().c_str());
-  if (dir) {
-    struct dirent ent_buf;
-    struct dirent* ent;
-    while (readdir_r(dir, &ent_buf, &ent) == 0 && ent) {
-      if ((strcmp(ent->d_name, ".") == 0) ||
-          (strcmp(ent->d_name, "..") == 0))
-        continue;
-
-      struct stat st;
-      int test = stat(path.Append(ent->d_name).value().c_str(), &st);
-      if (test != 0) {
-        LOG(ERROR) << "stat failed: " << strerror(errno);
-        continue;
-      }
-      // Here, we use Time::TimeT(), which discards microseconds. This
-      // means that files which are newer than |comparison_time| may
-      // be considered older. If we don't discard microseconds, it
-      // introduces another issue. Suppose the following case:
-      //
-      // 1. Get |comparison_time| by Time::Now() and the value is 10.1 (secs).
-      // 2. Create a file and the current time is 10.3 (secs).
-      //
-      // As POSIX doesn't have microsecond precision for |st_ctime|,
-      // the creation time of the file created in the step 2 is 10 and
-      // the file is considered older than |comparison_time|. After
-      // all, we may have to accept either of the two issues: 1. files
-      // which are older than |comparison_time| are considered newer
-      // (current implementation) 2. files newer than
-      // |comparison_time| are considered older.
-      if (st.st_ctime >= comparison_time.ToTimeT())
-        ++file_count;
-    }
-    closedir(dir);
-  }
-  return file_count;
-}
-
 // TODO(erikkay): The Windows version of this accepts paths like "foo/bar/*"
 // which works both with and without the recursive flag.  I'm not sure we need
 // that functionality. If not, remove from file_util_win.cc, otherwise add it
 // here.
 bool Delete(const FilePath& path, bool recursive) {
   const char* path_str = path.value().c_str();
   struct stat file_info;
   int test = stat(path_str, &file_info);
@@ -315,44 +261,16 @@ bool PathIsWritable(const FilePath& path
 
 bool DirectoryExists(const FilePath& path) {
   struct stat file_info;
   if (stat(path.value().c_str(), &file_info) == 0)
     return S_ISDIR(file_info.st_mode);
   return false;
 }
 
-// TODO(erikkay): implement
-#if 0
-bool GetFileCreationLocalTimeFromHandle(int fd,
-                                        LPSYSTEMTIME creation_time) {
-  if (!file_handle)
-    return false;
-
-  FILETIME utc_filetime;
-  if (!GetFileTime(file_handle, &utc_filetime, NULL, NULL))
-    return false;
-
-  FILETIME local_filetime;
-  if (!FileTimeToLocalFileTime(&utc_filetime, &local_filetime))
-    return false;
-
-  return !!FileTimeToSystemTime(&local_filetime, creation_time);
-}
-
-bool GetFileCreationLocalTime(const std::string& filename,
-                              LPSYSTEMTIME creation_time) {
-  ScopedHandle file_handle(
-      CreateFile(filename.c_str(), GENERIC_READ,
-                 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
-                 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL));
-  return GetFileCreationLocalTimeFromHandle(file_handle.Get(), creation_time);
-}
-#endif
-
 bool ReadFromFD(int fd, char* buffer, size_t bytes) {
   size_t total_read = 0;
   while (total_read < bytes) {
     ssize_t bytes_read =
         HANDLE_EINTR(read(fd, buffer + total_read, bytes - total_read));
     if (bytes_read <= 0)
       break;
     total_read += bytes_read;
@@ -578,158 +496,9 @@ bool CopyFile(const FilePath& from_path,
     result = false;
   if (HANDLE_EINTR(close(outfile)) < 0)
     result = false;
 
   return result;
 }
 #endif // !defined(OS_MACOSX)
 
-///////////////////////////////////////////////
-// FileEnumerator
-
-FileEnumerator::FileEnumerator(const FilePath& root_path,
-                               bool recursive,
-                               FileEnumerator::FILE_TYPE file_type)
-    : recursive_(recursive),
-      file_type_(file_type),
-      is_in_find_op_(false),
-      fts_(NULL) {
-  pending_paths_.push(root_path);
-}
-
-FileEnumerator::FileEnumerator(const FilePath& root_path,
-                               bool recursive,
-                               FileEnumerator::FILE_TYPE file_type,
-                               const FilePath::StringType& pattern)
-    : recursive_(recursive),
-      file_type_(file_type),
-      pattern_(root_path.value()),
-      is_in_find_op_(false),
-      fts_(NULL) {
-  // The Windows version of this code only matches against items in the top-most
-  // directory, and we're comparing fnmatch against full paths, so this is the
-  // easiest way to get the right pattern.
-  pattern_ = pattern_.Append(pattern);
-  pending_paths_.push(root_path);
-}
-
-FileEnumerator::~FileEnumerator() {
-#ifndef ANDROID
-  if (fts_)
-    fts_close(fts_);
-#endif
-}
-
-void FileEnumerator::GetFindInfo(FindInfo* info) {
-  DCHECK(info);
-
-  if (!is_in_find_op_)
-    return;
-
-#ifndef ANDROID
-  memcpy(&(info->stat), fts_ent_->fts_statp, sizeof(info->stat));
-  info->filename.assign(fts_ent_->fts_name);
-#endif
-}
-
-// As it stands, this method calls itself recursively when the next item of
-// the fts enumeration doesn't match (type, pattern, etc.).  In the case of
-// large directories with many files this can be quite deep.
-// TODO(erikkay) - get rid of this recursive pattern
-FilePath FileEnumerator::Next() {
-#ifdef ANDROID
-  return FilePath();
-#else
-  if (!is_in_find_op_) {
-    if (pending_paths_.empty())
-      return FilePath();
-
-    // The last find FindFirstFile operation is done, prepare a new one.
-    root_path_ = pending_paths_.top();
-    root_path_ = root_path_.StripTrailingSeparators();
-    pending_paths_.pop();
-
-    // Start a new find operation.
-    int ftsflags = FTS_LOGICAL;
-    char top_dir[PATH_MAX];
-    base::strlcpy(top_dir, root_path_.value().c_str(), arraysize(top_dir));
-    char* dir_list[2] = { top_dir, NULL };
-    fts_ = fts_open(dir_list, ftsflags, NULL);
-    if (!fts_)
-      return Next();
-    is_in_find_op_ = true;
-  }
-
-  fts_ent_ = fts_read(fts_);
-  if (fts_ent_ == NULL) {
-    fts_close(fts_);
-    fts_ = NULL;
-    is_in_find_op_ = false;
-    return Next();
-  }
-
-  // Level 0 is the top, which is always skipped.
-  if (fts_ent_->fts_level == 0)
-    return Next();
-
-  // Patterns are only matched on the items in the top-most directory.
-  // (see Windows implementation)
-  if (fts_ent_->fts_level == 1 && pattern_.value().length() > 0) {
-    if (fnmatch(pattern_.value().c_str(), fts_ent_->fts_path, 0) != 0) {
-      if (fts_ent_->fts_info == FTS_D)
-        fts_set(fts_, fts_ent_, FTS_SKIP);
-      return Next();
-    }
-  }
-
-  FilePath cur_file(fts_ent_->fts_path);
-  if (fts_ent_->fts_info == FTS_D) {
-    // If not recursive, then prune children.
-    if (!recursive_)
-      fts_set(fts_, fts_ent_, FTS_SKIP);
-    return (file_type_ & FileEnumerator::DIRECTORIES) ? cur_file : Next();
-  } else if (fts_ent_->fts_info == FTS_F) {
-    return (file_type_ & FileEnumerator::FILES) ? cur_file : Next();
-  }
-  // TODO(erikkay) - verify that the other fts_info types aren't interesting
-  return Next();
-#endif
-}
-
-///////////////////////////////////////////////
-// MemoryMappedFile
-
-MemoryMappedFile::MemoryMappedFile()
-    : file_(-1),
-      data_(NULL),
-      length_(0) {
-}
-
-bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
-  file_ = open(file_name.value().c_str(), O_RDONLY);
-  if (file_ == -1)
-    return false;
-
-  struct stat file_stat;
-  if (fstat(file_, &file_stat) == -1)
-    return false;
-  length_ = file_stat.st_size;
-
-  data_ = static_cast<uint8_t*>(
-      mmap(NULL, length_, PROT_READ, MAP_SHARED, file_, 0));
-  if (data_ == MAP_FAILED)
-    data_ = NULL;
-  return data_ != NULL;
-}
-
-void MemoryMappedFile::CloseHandles() {
-  if (data_ != NULL)
-    munmap(data_, length_);
-  if (file_ != -1)
-    close(file_);
-
-  data_ = NULL;
-  length_ = 0;
-  file_ = -1;
-}
-
 } // namespace file_util
--- a/ipc/chromium/src/base/file_util_win.cc
+++ b/ipc/chromium/src/base/file_util_win.cc
@@ -14,65 +14,24 @@
 #include "base/logging.h"
 #include "base/scoped_handle.h"
 #include "base/string_util.h"
 #include "base/time.h"
 #include "base/win_util.h"
 
 namespace file_util {
 
-std::wstring GetDirectoryFromPath(const std::wstring& path) {
-  wchar_t path_buffer[MAX_PATH];
-  wchar_t* file_ptr = NULL;
-  if (GetFullPathName(path.c_str(), MAX_PATH, path_buffer, &file_ptr) == 0)
-    return L"";
-
-  std::wstring::size_type length =
-      file_ptr ? file_ptr - path_buffer : path.length();
-  std::wstring directory(path, 0, length);
-  TrimTrailingSeparator(&directory);
-  return directory;
-}
-
 bool AbsolutePath(FilePath* path) {
   wchar_t file_path_buf[MAX_PATH];
   if (!_wfullpath(file_path_buf, path->value().c_str(), MAX_PATH))
     return false;
   *path = FilePath(file_path_buf);
   return true;
 }
 
-int CountFilesCreatedAfter(const FilePath& path,
-                           const base::Time& comparison_time) {
-  int file_count = 0;
-  FILETIME comparison_filetime(comparison_time.ToFileTime());
-
-  WIN32_FIND_DATA find_file_data;
-  // All files in given dir
-  std::wstring filename_spec = path.Append(L"*").value();
-  HANDLE find_handle = FindFirstFile(filename_spec.c_str(), &find_file_data);
-  if (find_handle != INVALID_HANDLE_VALUE) {
-    do {
-      // Don't count current or parent directories.
-      if ((wcscmp(find_file_data.cFileName, L"..") == 0) ||
-          (wcscmp(find_file_data.cFileName, L".") == 0))
-        continue;
-
-      long result = CompareFileTime(&find_file_data.ftCreationTime,
-                                    &comparison_filetime);
-      // File was created after or on comparison time
-      if ((result == 1) || (result == 0))
-        ++file_count;
-    } while (FindNextFile(find_handle,  &find_file_data));
-    FindClose(find_handle);
-  }
-
-  return file_count;
-}
-
 bool Delete(const FilePath& path, bool recursive) {
   if (path.value().length() >= MAX_PATH)
     return false;
 
   // If we're not recursing use DeleteFile; it should be faster. DeleteFile
   // fails if passed a directory though, which is why we fall through on
   // failure to the SHFileOperation.
   if (!recursive && DeleteFile(path.value().c_str()) != 0)
@@ -92,35 +51,16 @@ bool Delete(const FilePath& path, bool r
   if (!recursive)
     file_operation.fFlags |= FOF_NORECURSION | FOF_FILESONLY;
   int err = SHFileOperation(&file_operation);
   // Some versions of Windows return ERROR_FILE_NOT_FOUND when
   // deleting an empty directory.
   return (err == 0 || err == ERROR_FILE_NOT_FOUND);
 }
 
-bool Move(const FilePath& from_path, const FilePath& to_path) {
-  // NOTE: I suspect we could support longer paths, but that would involve
-  // analyzing all our usage of files.
-  if (from_path.value().length() >= MAX_PATH ||
-      to_path.value().length() >= MAX_PATH) {
-    return false;
-  }
-  if (MoveFileEx(from_path.value().c_str(), to_path.value().c_str(),
-                 MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING) != 0)
-    return true;
-  if (DirectoryExists(from_path)) {
-    // MoveFileEx fails if moving directory across volumes. We will simulate
-    // the move by using Copy and Delete. Ideally we could check whether
-    // from_path and to_path are indeed in different volumes.
-    return CopyAndDeleteDirectory(from_path, to_path);
-  }
-  return false;
-}
-
 bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
   // NOTE: I suspect we could support longer paths, but that would involve
   // analyzing all our usage of files.
   if (from_path.value().length() >= MAX_PATH ||
       to_path.value().length() >= MAX_PATH) {
     return false;
   }
   return (::CopyFile(from_path.value().c_str(), to_path.value().c_str(),
@@ -173,31 +113,16 @@ bool CopyDirectory(const FilePath& from_
     else
       ShellCopy(from_path, to_path, false);
   }
 
   FilePath directory = from_path.Append(L"*.*");
   return ShellCopy(directory, to_path, false);
 }
 
-bool CopyAndDeleteDirectory(const FilePath& from_path,
-                            const FilePath& to_path) {
-  if (CopyDirectory(from_path, to_path, true)) {
-    if (Delete(from_path, true)) {
-      return true;
-    }
-    // Like Move, this function is not transactional, so we just
-    // leave the copied bits behind if deleting from_path fails.
-    // If to_path exists previously then we have already overwritten
-    // it by now, we don't get better off by deleting the new bits.
-  }
-  return false;
-}
-
-
 bool PathExists(const FilePath& path) {
   return (GetFileAttributes(path.value().c_str()) != INVALID_FILE_ATTRIBUTES);
 }
 
 bool PathIsWritable(const FilePath& path) {
   HANDLE dir =
       CreateFile(path.value().c_str(), FILE_ADD_FILE,
                  FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
@@ -212,213 +137,16 @@ bool PathIsWritable(const FilePath& path
 
 bool DirectoryExists(const FilePath& path) {
   DWORD fileattr = GetFileAttributes(path.value().c_str());
   if (fileattr != INVALID_FILE_ATTRIBUTES)
     return (fileattr & FILE_ATTRIBUTE_DIRECTORY) != 0;
   return false;
 }
 
-bool GetFileCreationLocalTimeFromHandle(HANDLE file_handle,
-                                        LPSYSTEMTIME creation_time) {
-  if (!file_handle)
-    return false;
-
-  FILETIME utc_filetime;
-  if (!GetFileTime(file_handle, &utc_filetime, NULL, NULL))
-    return false;
-
-  FILETIME local_filetime;
-  if (!FileTimeToLocalFileTime(&utc_filetime, &local_filetime))
-    return false;
-
-  return !!FileTimeToSystemTime(&local_filetime, creation_time);
-}
-
-bool GetFileCreationLocalTime(const std::wstring& filename,
-                              LPSYSTEMTIME creation_time) {
-  ScopedHandle file_handle(
-      CreateFile(filename.c_str(), GENERIC_READ,
-                 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
-                 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL));
-  return GetFileCreationLocalTimeFromHandle(file_handle.Get(), creation_time);
-}
-
-bool ResolveShortcut(std::wstring* path) {
-  FilePath file_path(*path);
-  bool result = ResolveShortcut(&file_path);
-  *path = file_path.value();
-  return result;
-}
-
-bool ResolveShortcut(FilePath* path) {
-  HRESULT result;
-  IShellLink *shell = NULL;
-  bool is_resolved = false;
-
-  // Get pointer to the IShellLink interface
-  result = CoCreateInstance(CLSID_ShellLink, NULL,
-                            CLSCTX_INPROC_SERVER, IID_IShellLink,
-                            reinterpret_cast<LPVOID*>(&shell));
-  if (SUCCEEDED(result)) {
-    IPersistFile *persist = NULL;
-    // Query IShellLink for the IPersistFile interface
-    result = shell->QueryInterface(IID_IPersistFile,
-                                   reinterpret_cast<LPVOID*>(&persist));
-    if (SUCCEEDED(result)) {
-      WCHAR temp_path[MAX_PATH];
-      // Load the shell link
-      result = persist->Load(path->value().c_str(), STGM_READ);
-      if (SUCCEEDED(result)) {
-        // Try to find the target of a shortcut
-        result = shell->Resolve(0, SLR_NO_UI);
-        if (SUCCEEDED(result)) {
-          result = shell->GetPath(temp_path, MAX_PATH,
-                                  NULL, SLGP_UNCPRIORITY);
-          *path = FilePath(temp_path);
-          is_resolved = true;
-        }
-      }
-    }
-    if (persist)
-      persist->Release();
-  }
-  if (shell)
-    shell->Release();
-
-  return is_resolved;
-}
-
-bool CreateShortcutLink(const wchar_t *source, const wchar_t *destination,
-                        const wchar_t *working_dir, const wchar_t *arguments,
-                        const wchar_t *description, const wchar_t *icon,
-                        int icon_index) {
-  IShellLink *i_shell_link = NULL;
-  IPersistFile *i_persist_file = NULL;
-
-  // Get pointer to the IShellLink interface
-  HRESULT result = CoCreateInstance(CLSID_ShellLink, NULL,
-                                    CLSCTX_INPROC_SERVER, IID_IShellLink,
-                                    reinterpret_cast<LPVOID*>(&i_shell_link));
-  if (FAILED(result))
-    return false;
-
-  // Query IShellLink for the IPersistFile interface
-  result = i_shell_link->QueryInterface(IID_IPersistFile,
-      reinterpret_cast<LPVOID*>(&i_persist_file));
-  if (FAILED(result)) {
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (FAILED(i_shell_link->SetPath(source))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (working_dir && FAILED(i_shell_link->SetWorkingDirectory(working_dir))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (arguments && FAILED(i_shell_link->SetArguments(arguments))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (description && FAILED(i_shell_link->SetDescription(description))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (icon && FAILED(i_shell_link->SetIconLocation(icon, icon_index))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  result = i_persist_file->Save(destination, TRUE);
-  i_persist_file->Release();
-  i_shell_link->Release();
-  return SUCCEEDED(result);
-}
-
-
-bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination,
-                        const wchar_t *working_dir, const wchar_t *arguments,
-                        const wchar_t *description, const wchar_t *icon,
-                        int icon_index) {
-  // Get pointer to the IPersistFile interface and load existing link
-  IShellLink *i_shell_link = NULL;
-  if (FAILED(CoCreateInstance(CLSID_ShellLink, NULL,
-                              CLSCTX_INPROC_SERVER, IID_IShellLink,
-                              reinterpret_cast<LPVOID*>(&i_shell_link))))
-    return false;
-
-  IPersistFile *i_persist_file = NULL;
-  if (FAILED(i_shell_link->QueryInterface(
-      IID_IPersistFile, reinterpret_cast<LPVOID*>(&i_persist_file)))) {
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (FAILED(i_persist_file->Load(destination, 0))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (source && FAILED(i_shell_link->SetPath(source))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (working_dir && FAILED(i_shell_link->SetWorkingDirectory(working_dir))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (arguments && FAILED(i_shell_link->SetArguments(arguments))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (description && FAILED(i_shell_link->SetDescription(description))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  if (icon && FAILED(i_shell_link->SetIconLocation(icon, icon_index))) {
-    i_persist_file->Release();
-    i_shell_link->Release();
-    return false;
-  }
-
-  HRESULT result = i_persist_file->Save(destination, TRUE);
-  i_persist_file->Release();
-  i_shell_link->Release();
-  return SUCCEEDED(result);
-}
-
-bool IsDirectoryEmpty(const std::wstring& dir_path) {
-  FileEnumerator files(FilePath(dir_path),
-                       false, FileEnumerator::FILES_AND_DIRECTORIES);
-  if (files.Next().value().empty())
-    return true;
-  return false;
-}
-
 bool GetTempDir(FilePath* path) {
   wchar_t temp_path[MAX_PATH + 1];
   DWORD path_len = ::GetTempPath(MAX_PATH, temp_path);
   if (path_len >= MAX_PATH || path_len <= 0)
     return false;
   // TODO(evanm): the old behavior of this function was to always strip the
   // trailing slash.  We duplicate this here, but it shouldn't be necessary
   // when everyone is using the appropriate FilePath APIs.
@@ -604,38 +332,16 @@ int WriteFile(const FilePath& filename, 
   } else {
     // Didn't write all the bytes.
     LOG(WARNING) << "wrote" << written << " bytes to " <<
         filename.value() << " expected " << size;
   }
   return -1;
 }
 
-bool RenameFileAndResetSecurityDescriptor(const FilePath& source_file_path,
-                                          const FilePath& target_file_path) {
-  // The parameters to SHFileOperation must be terminated with 2 NULL chars.
-  std::wstring source = source_file_path.value();
-  std::wstring target = target_file_path.value();
-
-  source.append(1, L'\0');
-  target.append(1, L'\0');
-
-  SHFILEOPSTRUCT move_info = {0};
-  move_info.wFunc = FO_MOVE;
-  move_info.pFrom = source.c_str();
-  move_info.pTo = target.c_str();
-  move_info.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI |
-                     FOF_NOCONFIRMMKDIR | FOF_NOCOPYSECURITYATTRIBS;
-
-  if (0 != SHFileOperation(&move_info))
-    return false;
-
-  return true;
-}
-
 // Gets the current working directory for the process.
 bool GetCurrentDirectory(FilePath* dir) {
   wchar_t system_buffer[MAX_PATH];
   system_buffer[0] = 0;
   DWORD len = ::GetCurrentDirectory(MAX_PATH, system_buffer);
   if (len == 0 || len > MAX_PATH)
     return false;
   // TODO(evanm): the old behavior of this function was to always strip the
@@ -648,170 +354,22 @@ bool GetCurrentDirectory(FilePath* dir) 
 }
 
 // Sets the current working directory for the process.
 bool SetCurrentDirectory(const FilePath& directory) {
   BOOL ret = ::SetCurrentDirectory(directory.value().c_str());
   return ret != 0;
 }
 
-///////////////////////////////////////////////
-// FileEnumerator
-
-FileEnumerator::FileEnumerator(const FilePath& root_path,
-                               bool recursive,
-                               FileEnumerator::FILE_TYPE file_type)
-    : recursive_(recursive),
-      file_type_(file_type),
-      is_in_find_op_(false),
-      find_handle_(INVALID_HANDLE_VALUE) {
-  pending_paths_.push(root_path);
-}
-
-FileEnumerator::FileEnumerator(const FilePath& root_path,
-                               bool recursive,
-                               FileEnumerator::FILE_TYPE file_type,
-                               const FilePath::StringType& pattern)
-    : recursive_(recursive),
-      file_type_(file_type),
-      is_in_find_op_(false),
-      pattern_(pattern),
-      find_handle_(INVALID_HANDLE_VALUE) {
-  pending_paths_.push(root_path);
-}
-
-FileEnumerator::~FileEnumerator() {
-  if (find_handle_ != INVALID_HANDLE_VALUE)
-    FindClose(find_handle_);
-}
-
-void FileEnumerator::GetFindInfo(FindInfo* info) {
-  DCHECK(info);
-
-  if (!is_in_find_op_)
-    return;
-
-  memcpy(info, &find_data_, sizeof(*info));
-}
-
-FilePath FileEnumerator::Next() {
-  if (!is_in_find_op_) {
-    if (pending_paths_.empty())
-      return FilePath();
-
-    // The last find FindFirstFile operation is done, prepare a new one.
-    root_path_ = pending_paths_.top();
-    pending_paths_.pop();
-
-    // Start a new find operation.
-    FilePath src = root_path_;
-
-    if (pattern_.value().empty())
-      src = src.Append(L"*");  // No pattern = match everything.
-    else
-      src = src.Append(pattern_);
-
-    find_handle_ = FindFirstFile(src.value().c_str(), &find_data_);
-    is_in_find_op_ = true;
-
-  } else {
-    // Search for the next file/directory.
-    if (!FindNextFile(find_handle_, &find_data_)) {
-      FindClose(find_handle_);
-      find_handle_ = INVALID_HANDLE_VALUE;
-    }
-  }
-
-  if (INVALID_HANDLE_VALUE == find_handle_) {
-    is_in_find_op_ = false;
-
-    // This is reached when we have finished a directory and are advancing to
-    // the next one in the queue. We applied the pattern (if any) to the files
-    // in the root search directory, but for those directories which were
-    // matched, we want to enumerate all files inside them. This will happen
-    // when the handle is empty.
-    pattern_ = FilePath();
-
-    return Next();
-  }
-
-  FilePath cur_file(find_data_.cFileName);
-  // Skip over . and ..
-  if (L"." == cur_file.value() || L".." == cur_file.value())
-    return Next();
-
-  // Construct the absolute filename.
-  cur_file = root_path_.Append(cur_file);
-
-  if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
-    if (recursive_) {
-      // If |cur_file| is a directory, and we are doing recursive searching, add
-      // it to pending_paths_ so we scan it after we finish scanning this
-      // directory.
-      pending_paths_.push(cur_file);
-    }
-    return (file_type_ & FileEnumerator::DIRECTORIES) ? cur_file : Next();
-  }
-  return (file_type_ & FileEnumerator::FILES) ? cur_file : Next();
-}
-
-///////////////////////////////////////////////
-// MemoryMappedFile
-
-MemoryMappedFile::MemoryMappedFile()
-    : file_(INVALID_HANDLE_VALUE),
-      file_mapping_(INVALID_HANDLE_VALUE),
-      data_(NULL),
-      length_(INVALID_FILE_SIZE) {
-}
-
-bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
-  file_ = ::CreateFile(file_name.value().c_str(), GENERIC_READ,
-                       FILE_SHARE_READ, NULL, OPEN_EXISTING,
-                       FILE_ATTRIBUTE_NORMAL, NULL);
-  if (file_ == INVALID_HANDLE_VALUE)
-    return false;
-
-  length_ = ::GetFileSize(file_, NULL);
-  if (length_ == INVALID_FILE_SIZE)
-    return false;
-
-  file_mapping_ = ::CreateFileMapping(file_, NULL, PAGE_READONLY,
-                                      0, length_, NULL);
-  if (file_mapping_ == INVALID_HANDLE_VALUE)
-    return false;
-
-  data_ = static_cast<uint8_t*>(
-      ::MapViewOfFile(file_mapping_, FILE_MAP_READ, 0, 0, length_));
-  return data_ != NULL;
-}
-
-void MemoryMappedFile::CloseHandles() {
-  if (data_)
-    ::UnmapViewOfFile(data_);
-  if (file_mapping_ != INVALID_HANDLE_VALUE)
-    ::CloseHandle(file_mapping_);
-  if (file_ != INVALID_HANDLE_VALUE)
-    ::CloseHandle(file_);
-
-  data_ = NULL;
-  file_mapping_ = file_ = INVALID_HANDLE_VALUE;
-  length_ = INVALID_FILE_SIZE;
-}
-
 // Deprecated functions ----------------------------------------------------
 
 void InsertBeforeExtension(std::wstring* path_str,
                            const std::wstring& suffix) {
   FilePath path(*path_str);
   InsertBeforeExtension(&path, suffix);
   path_str->assign(path.value());
 }
-void PathComponents(const std::wstring& path,
-                    std::vector<std::wstring>* components) {
-  PathComponents(FilePath(path), components);
-}
 void ReplaceExtension(std::wstring* file_name, const std::wstring& extension) {
   FilePath path(*file_name);
   ReplaceExtension(&path, extension);
   file_name->assign(path.value());
 }
 }  // namespace file_util
deleted file mode 100644
--- a/ipc/chromium/src/base/fix_wp64.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// Various inline functions and macros to fix compilation of 32 bit target
-// on MSVC with /Wp64 flag enabled.
-
-#ifndef BASE_FIX_WP64_H__
-#define BASE_FIX_WP64_H__
-
-#include <windows.h>
-
-// Platform SDK fixes when building with /Wp64 for a 32 bits target.
-#if !defined(_WIN64) && defined(_Wp64)
-
-#ifdef InterlockedExchangePointer
-#undef InterlockedExchangePointer
-// The problem is that the macro provided for InterlockedExchangePointer() is
-// doing a (LONG) C-style cast that triggers invariably the warning C4312 when
-// building on 32 bits.
-inline void* InterlockedExchangePointer(void* volatile* target, void* value) {
-  return reinterpret_cast<void*>(static_cast<LONG_PTR>(InterlockedExchange(
-      reinterpret_cast<volatile LONG*>(target),
-      static_cast<LONG>(reinterpret_cast<LONG_PTR>(value)))));
-}
-#endif  // #ifdef InterlockedExchangePointer
-
-#ifdef SetWindowLongPtrA
-#undef SetWindowLongPtrA
-// When build on 32 bits, SetWindowLongPtrX() is a macro that redirects to
-// SetWindowLongX(). The problem is that this function takes a LONG argument
-// instead of a LONG_PTR.
-inline LONG_PTR SetWindowLongPtrA(HWND window, int index, LONG_PTR new_long) {
-  return ::SetWindowLongA(window, index, static_cast<LONG>(new_long));
-}
-#endif  // #ifdef SetWindowLongPtrA
-
-#ifdef SetWindowLongPtrW
-#undef SetWindowLongPtrW
-inline LONG_PTR SetWindowLongPtrW(HWND window, int index, LONG_PTR new_long) {
-  return ::SetWindowLongW(window, index, static_cast<LONG>(new_long));
-}
-#endif  // #ifdef SetWindowLongPtrW
-
-#ifdef GetWindowLongPtrA
-#undef GetWindowLongPtrA
-inline LONG_PTR GetWindowLongPtrA(HWND window, int index) {
-  return ::GetWindowLongA(window, index);
-}
-#endif  // #ifdef GetWindowLongPtrA
-
-#ifdef GetWindowLongPtrW
-#undef GetWindowLongPtrW
-inline LONG_PTR GetWindowLongPtrW(HWND window, int index) {
-  return ::GetWindowLongW(window, index);
-}
-#endif  // #ifdef GetWindowLongPtrW
-
-#ifdef SetClassLongPtrA
-#undef SetClassLongPtrA
-inline LONG_PTR SetClassLongPtrA(HWND window, int index, LONG_PTR new_long) {
-  return ::SetClassLongA(window, index, static_cast<LONG>(new_long));
-}
-#endif  // #ifdef SetClassLongPtrA
-
-#ifdef SetClassLongPtrW
-#undef SetClassLongPtrW
-inline LONG_PTR SetClassLongPtrW(HWND window, int index, LONG_PTR new_long) {
-  return ::SetClassLongW(window, index, static_cast<LONG>(new_long));
-}
-#endif  // #ifdef SetClassLongPtrW
-
-#endif  // #if !defined(_WIN64) && defined(_Wp64)
-
-#endif  // BASE_FIX_WP64_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/float_util.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_FLOAT_UTIL_H_
-#define BASE_FLOAT_UTIL_H_
-
-#include "build/build_config.h"
-
-#include <float.h>
-#include <math.h>
-
-namespace base {
-
-inline bool IsFinite(const double& number) {
-#if defined(OS_POSIX)
-  return finite(number) != 0;
-#elif defined(OS_WIN)
-  return _finite(number) != 0;
-#endif
-}
-
-}  // namespace base
-
-#endif  // BASE_FLOAT_UTIL_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/gfx/DEPS
+++ /dev/null
@@ -1,4 +0,0 @@
-include_rules = [
-  "+skia",
-  "+third_party/libpng"
-]
deleted file mode 100644
--- a/ipc/chromium/src/base/gfx/gdi_util.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_GFX_GDI_UTIL_H__
-#define BASE_GFX_GDI_UTIL_H__
-
-#include <vector>
-#include <windows.h>
-#include "base/gfx/rect.h"
-
-namespace gfx {
-
-// Creates a BITMAPINFOHEADER structure given the bitmap's size.
-void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
-
-// Creates a BITMAPINFOHEADER structure given the bitmap's size and
-// color depth in bits per pixel.
-void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth,
-                                      BITMAPINFOHEADER* hdr);
-
-// Creates a BITMAPV4HEADER structure given the bitmap's size.  You probably
-// only need to use BMP V4 if you need transparency (alpha channel). This
-// function sets the AlphaMask to 0xff000000.
-void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr);
-
-// Creates a monochrome bitmap header.
-void CreateMonochromeBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
-
-// Modify the given hrgn by subtracting the given rectangles.
-void SubtractRectanglesFromRegion(HRGN hrgn,
-                                  const std::vector<gfx::Rect>& cutouts);
-
-}  // namespace gfx
-
-#endif // BASE_GFX_GDI_UTIL_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/gfx/native_widget_types.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2008 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.
-
-#ifndef BASE_GFX_NATIVE_WIDGET_TYPES_H_
-#define BASE_GFX_NATIVE_WIDGET_TYPES_H_
-
-#include "base/basictypes.h"
-#include "build/build_config.h"
-
-// This file provides cross platform typedefs for native widget types.
-//   NativeWindow: this is a handle to a native, top-level window
-//   NativeView: this is a handle to a native UI element. It may be the
-//     same type as a NativeWindow on some platforms.
-//   NativeViewId: Often, in our cross process model, we need to pass around a
-//     reference to a "window". This reference will, say, be echoed back from a
-//     renderer to the browser when it wishes to query it's size. On Windows, a
-//     HWND can be used for this. On other platforms, we may wish to pass
-//     around X window ids, or maybe abstract identifiers.
-//
-//     As a rule of thumb - if you're in the renderer, you should be dealing
-//     with NativeViewIds. This should remind you that you shouldn't be doing
-//     direct operations on platform widgets from the renderer process.
-//
-//     If you're in the browser, you're probably dealing with NativeViews,
-//     unless you're in the IPC layer, which will be translating between
-//     NativeViewIds from the renderer and NativeViews.
-//
-//   NativeEditView: a handle to a native edit-box. The Mac folks wanted this
-//     specific typedef.
-//
-// The name 'View' here meshes with OS X where the UI elements are called
-// 'views' and with our Chrome UI code where the elements are also called
-// 'views'.
-
-#if defined(OS_WIN)
-#include <windows.h>
-#elif defined(OS_MACOSX)
-struct CGContext;
-#ifdef __OBJC__
-@class NSView;
-@class NSWindow;
-@class NSTextField;
-#else
-class NSView;
-class NSWindow;
-class NSTextField;
-#endif  // __OBJC__
-#elif defined(OS_LINUX)
-typedef struct _GtkWidget GtkWidget;
-typedef struct _GtkWindow GtkWindow;
-typedef struct _cairo_surface cairo_surface_t;
-#endif
-
-namespace gfx {
-
-#if defined(OS_WIN)
-typedef HWND NativeView;
-typedef HWND NativeWindow;
-typedef HWND NativeEditView;
-typedef HDC NativeDrawingContext;
-#elif defined(OS_MACOSX)
-typedef NSView* NativeView;
-typedef NSWindow* NativeWindow;
-typedef NSTextField* NativeEditView;
-typedef CGContext* NativeDrawingContext;
-#elif defined(OS_LINUX)
-typedef GtkWidget* NativeView;
-typedef GtkWindow* NativeWindow;
-typedef GtkWidget* NativeEditView;
-typedef cairo_surface_t* NativeDrawingContext;
-#endif
-
-// Note: for test_shell we're packing a pointer into the NativeViewId. So, if
-// you make it a type which is smaller than a pointer, you have to fix
-// test_shell.
-//
-// See comment at the top of the file for usage.
-typedef intptr_t NativeViewId;
-
-// Convert a NativeViewId to a NativeView.
-// On Windows, these are both HWNDS so it's just a cast.
-// On Mac, for now, we pass the NSView pointer into the renderer
-// On Linux we use an opaque id
-#if defined(OS_WIN) || defined(OS_MACOSX)
-static inline NativeView NativeViewFromId(NativeViewId id) {
-  return reinterpret_cast<NativeView>(id);
-}
-#elif defined(OS_LINUX)
-// A NativeView on Linux is a GtkWidget*. However, we can't go directly from an
-// X window ID to a GtkWidget. Thus, functions which handle NativeViewIds from
-// the renderer have to use Xlib. This is fine since these functions are
-// generally performed on the BACKGROUND_X thread which can't use GTK anyway.
-
-#define NativeViewFromId(x) NATIVE_VIEW_FROM_ID_NOT_AVAILIBLE_ON_LINUX
-
-#endif  // defined(OS_LINUX)
-
-// Convert a NativeView to a NativeViewId. See the comments above
-// NativeViewFromId.
-#if defined(OS_WIN) || defined(OS_MACOSX)
-static inline NativeViewId IdFromNativeView(NativeView view) {
-  return reinterpret_cast<NativeViewId>(view);
-}
-#elif defined(OS_LINUX)
-// Not inlined because it involves pulling too many headers.
-NativeViewId IdFromNativeView(NativeView view);
-#endif  // defined(OS_LINUX)
-
-}  // namespace gfx
-
-#endif  // BASE_GFX_NATIVE_WIDGET_TYPES_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/gfx/png_encoder.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_GFX_PNG_ENCODER_H_
-#define BASE_GFX_PNG_ENCODER_H_
-
-#include <vector>
-
-#include "base/basictypes.h"
-
-class SkBitmap;
-
-// Interface for encoding PNG data. This is a wrapper around libpng,
-// which has an inconvenient interface for callers. This is currently designed
-// for use in tests only (where we control the files), so the handling isn't as
-// robust as would be required for a browser (see Decode() for more).  WebKit
-// has its own more complicated PNG decoder which handles, among other things,
-// partially downloaded data.
-class PNGEncoder {
- public:
-  enum ColorFormat {
-    // 3 bytes per pixel (packed), in RGB order regardless of endianness.
-    // This is the native JPEG format.
-    FORMAT_RGB,
-
-    // 4 bytes per pixel, in RGBA order in memory regardless of endianness.
-    FORMAT_RGBA,
-
-    // 4 bytes per pixel, in BGRA order in memory regardless of endianness.
-    // This is the default Windows DIB order.
-    FORMAT_BGRA
-  };
-
-  // Encodes the given raw 'input' data, with each pixel being represented as
-  // given in 'format'. The encoded PNG data will be written into the supplied
-  // vector and true will be returned on success. On failure (false), the
-  // contents of the output buffer are undefined.
-  //
-  // When writing alpha values, the input colors are assumed to be post
-  // multiplied.
-  //
-  // w, h: dimensions of the image
-  // row_byte_width: the width in bytes of each row. This may be greater than
-  //   w * bytes_per_pixel if there is extra padding at the end of each row
-  //   (often, each row is padded to the next machine word).
-  // discard_transparency: when true, and when the input data format includes
-  //   alpha values, these alpha values will be discarded and only RGB will be
-  //   written to the resulting file. Otherwise, alpha values in the input
-  //   will be preserved.
-  static bool Encode(const unsigned char* input, ColorFormat format,
-                     int w, int h, int row_byte_width,
-                     bool discard_transparency,
-                     std::vector<unsigned char>* output);
-
-  // Call PNGEncoder::Encode on the supplied SkBitmap |input|, which is assumed
-  // to be BGRA, 32 bits per pixel. The params |discard_transparency| and
-  // |output| are passed directly to Encode; refer to Encode for more
-  // information. During the call, an SkAutoLockPixels lock is held on |input|.
-  static bool EncodeBGRASkBitmap(const SkBitmap& input,
-                                 bool discard_transparency,
-                                 std::vector<unsigned char>* output);
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(PNGEncoder);
-};
-
-#endif  // BASE_GFX_PNG_ENCODER_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/gfx/point.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_GFX_POINT_H__
-#define BASE_GFX_POINT_H__
-
-#include "build/build_config.h"
-
-#include <ostream>
-
-#if defined(OS_WIN)
-typedef struct tagPOINT POINT;
-#elif defined(OS_MACOSX)
-#include <ApplicationServices/ApplicationServices.h>
-#endif
-
-namespace gfx {
-
-//
-// A point has an x and y coordinate.
-//
-class Point {
- public:
-  Point();
-  Point(int x, int y);
-#if defined(OS_WIN)
-  explicit Point(const POINT& point);
-  Point& operator=(const POINT& point);
-#elif defined(OS_MACOSX)
-  explicit Point(const CGPoint& point);
-#endif
-
-  ~Point() {}
-
-  int x() const { return x_; }
-  int y() const { return y_; }
-
-  void SetPoint(int x, int y) {
-    x_ = x;
-    y_ = y;
-  }
-
-  void set_x(int x) { x_ = x; }
-  void set_y(int y) { y_ = y; }
-
-  void Offset(int delta_x, int delta_y) {
-    x_ += delta_x;
-    y_ += delta_y;
-  }
-
-  bool operator==(const Point& rhs) const {
-    return x_ == rhs.x_ && y_ == rhs.y_;
-  }
-
-  bool operator!=(const Point& rhs) const {
-    return !(*this == rhs);
-  }
-
-#if defined(OS_WIN)
-  POINT ToPOINT() const;
-#elif defined(OS_MACOSX)
-  CGPoint ToCGPoint() const;
-#endif
-
- private:
-  int x_;
-  int y_;
-};
-
-}  // namespace gfx
-
-inline std::ostream& operator<<(std::ostream& out, const gfx::Point& p) {
-  return out << p.x() << "," << p.y();
-}
-
-#endif // BASE_GFX_POINT_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/hmac_nss.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright (c) 2008 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 "base/hmac.h"
-
-#include <nss.h>
-#include <pk11pub.h>
-
-#include "base/logging.h"
-#include "base/nss_init.h"
-#include "base/scoped_ptr.h"
-
-namespace {
-
-template <typename Type, void (*Destroyer)(Type*)>
-struct NSSDestroyer {
-  void operator()(Type* ptr) const {
-    if (ptr)
-      Destroyer(ptr);
-  }
-};
-
-void DestroyContext(PK11Context* context) {
-  PK11_DestroyContext(context, PR_TRUE);
-}
-
-// Define some convenient scopers around NSS pointers.
-typedef scoped_ptr_malloc<
-    PK11SlotInfo, NSSDestroyer<PK11SlotInfo, PK11_FreeSlot> > ScopedNSSSlot;
-typedef scoped_ptr_malloc<
-    PK11SymKey, NSSDestroyer<PK11SymKey, PK11_FreeSymKey> > ScopedNSSSymKey;
-typedef scoped_ptr_malloc<
-    PK11Context, NSSDestroyer<PK11Context, DestroyContext> > ScopedNSSContext;
-
-}  // namespace
-
-namespace base {
-
-struct HMACPlatformData {
-  ScopedNSSSlot slot_;
-  ScopedNSSSymKey sym_key_;
-};
-
-HMAC::HMAC(HashAlgorithm hash_alg)
-    : hash_alg_(hash_alg), plat_(new HMACPlatformData()) {
-  // Only SHA-1 digest is supported now.
-  DCHECK(hash_alg_ == SHA1);
-}
-
-bool HMAC::Init(const unsigned char *key, int key_length) {
-  base::EnsureNSSInit();
-
-  if (hash_alg_ != SHA1) {
-    NOTREACHED();
-    return false;
-  }
-
-  if (plat_->slot_.get() || plat_->slot_.get()) {
-    // Init must not be called more than twice on the same HMAC object.
-    NOTREACHED();
-    return false;
-  }
-
-  plat_->slot_.reset(PK11_GetBestSlot(CKM_SHA_1_HMAC, NULL));
-  if (!plat_->slot_.get()) {
-    NOTREACHED();
-    return false;
-  }
-
-  SECItem key_item;
-  key_item.type = siBuffer;
-  key_item.data = const_cast<unsigned char*>(key);  // NSS API isn't const.
-  key_item.len = key_length;
-
-  plat_->sym_key_.reset(PK11_ImportSymKey(plat_->slot_.get(),
-                                          CKM_SHA_1_HMAC,
-                                          PK11_OriginUnwrap,
-                                          CKA_SIGN,
-                                          &key_item,
-                                          NULL));
-  if (!plat_->sym_key_.get()) {
-    NOTREACHED();
-    return false;
-  }
-
-  return true;
-}
-
-HMAC::~HMAC() {
-}
-
-bool HMAC::Sign(const std::string& data,
-                unsigned char* digest,
-                int digest_length) {
-  if (!plat_->sym_key_.get()) {
-    // Init has not been called before Sign.
-    NOTREACHED();
-    return false;
-  }
-
-  SECItem param = { siBuffer, NULL, 0 };
-  ScopedNSSContext context(PK11_CreateContextBySymKey(CKM_SHA_1_HMAC,
-                                                      CKA_SIGN,
-                                                      plat_->sym_key_.get(),
-                                                      &param));
-  if (!context.get()) {
-    NOTREACHED();
-    return false;
-  }
-
-  if (PK11_DigestBegin(context.get()) != SECSuccess) {
-    NOTREACHED();
-    return false;
-  }
-
-  if (PK11_DigestOp(context.get(),
-                    reinterpret_cast<const unsigned char*>(data.data()),
-                    data.length()) != SECSuccess) {
-    NOTREACHED();
-    return false;
-  }
-
-  unsigned int len = 0;
-  if (PK11_DigestFinal(context.get(),
-                       digest, &len, digest_length) != SECSuccess) {
-    NOTREACHED();
-    return false;
-  }
-
-  return true;
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/hmac_win.cc
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/hmac.h"
-
-#include <windows.h>
-#include <wincrypt.h>
-
-#include <algorithm>
-#include <vector>
-
-#include "base/logging.h"
-
-namespace base {
-
-struct HMACPlatformData {
-  // Windows Crypt API resources.
-  HCRYPTPROV provider_;
-  HCRYPTHASH hash_;
-  HCRYPTKEY hkey_;
-};
-
-HMAC::HMAC(HashAlgorithm hash_alg)
-    : hash_alg_(hash_alg), plat_(new HMACPlatformData()) {
-  // Only SHA-1 digest is supported now.
-  DCHECK(hash_alg_ == SHA1);
-}
-
-bool HMAC::Init(const unsigned char *key, int key_length) {
-  if (plat_->provider_ || plat_->hkey_) {
-    // Init must not be called more than once on the same HMAC object.
-    NOTREACHED();
-    return false;
-  }
-
-  if (!CryptAcquireContext(&plat_->provider_, NULL, NULL,
-                           PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
-    NOTREACHED();
-    plat_->provider_ = NULL;
-    return false;
-  }
-
-  // This code doesn't work on Win2k because PLAINTEXTKEYBLOB and
-  // CRYPT_IPSEC_HMAC_KEY are not supported on Windows 2000.  PLAINTEXTKEYBLOB
-  // allows the import of an unencrypted key.  For Win2k support, a cubmbersome
-  // exponent-of-one key procedure must be used:
-  //     http://support.microsoft.com/kb/228786/en-us
-  // CRYPT_IPSEC_HMAC_KEY allows keys longer than 16 bytes.
-
-  struct KeyBlob {
-    BLOBHEADER header;
-    DWORD key_size;
-    BYTE key_data[1];
-  };
-  size_t key_blob_size = std::max(offsetof(KeyBlob, key_data) + key_length,
-                                  sizeof(KeyBlob));
-  std::vector<BYTE> key_blob_storage = std::vector<BYTE>(key_blob_size);
-  KeyBlob* key_blob = reinterpret_cast<KeyBlob*>(&key_blob_storage[0]);
-  key_blob->header.bType = PLAINTEXTKEYBLOB;
-  key_blob->header.bVersion = CUR_BLOB_VERSION;
-  key_blob->header.reserved = 0;
-  key_blob->header.aiKeyAlg = CALG_RC2;
-  key_blob->key_size = key_length;
-  memcpy(key_blob->key_data, key, key_length);
-
-  if (!CryptImportKey(plat_->provider_, &key_blob_storage[0],
-                      key_blob_storage.size(), 0, CRYPT_IPSEC_HMAC_KEY,
-                      &plat_->hkey_)) {
-    NOTREACHED();
-    plat_->hkey_ = NULL;
-    return false;
-  }
-
-  // Destroy the copy of the key.
-  SecureZeroMemory(key_blob->key_data, key_length);
-
-  return true;
-}
-
-HMAC::~HMAC() {
-  BOOL ok;
-  if (plat_->hkey_) {
-    ok = CryptDestroyKey(plat_->hkey_);
-    DCHECK(ok);
-  }
-  if (plat_->hash_) {
-    ok = CryptDestroyHash(plat_->hash_);
-    DCHECK(ok);
-  }
-  if (plat_->provider_) {
-    ok = CryptReleaseContext(plat_->provider_, 0);
-    DCHECK(ok);
-  }
-}
-
-bool HMAC::Sign(const std::string& data,
-                unsigned char* digest,
-                int digest_length) {
-  if (!plat_->provider_ || !plat_->hkey_)
-    return false;
-
-  if (hash_alg_ != SHA1) {
-    NOTREACHED();
-    return false;
-  }
-
-  if (!CryptCreateHash(
-          plat_->provider_, CALG_HMAC, plat_->hkey_, 0, &plat_->hash_))
-    return false;
-
-  HMAC_INFO hmac_info;
-  memset(&hmac_info, 0, sizeof(hmac_info));
-  hmac_info.HashAlgid = CALG_SHA1;
-  if (!CryptSetHashParam(plat_->hash_, HP_HMAC_INFO,
-                         reinterpret_cast<BYTE*>(&hmac_info), 0))
-    return false;
-
-  if (!CryptHashData(plat_->hash_,
-                     reinterpret_cast<const BYTE*>(data.data()),
-                     static_cast<DWORD>(data.size()), 0))
-    return false;
-
-  DWORD sha1_size = digest_length;
-  if (!CryptGetHashParam(plat_->hash_, HP_HASHVAL, digest, &sha1_size, 0))
-    return false;
-
-  return true;
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/iat_patch.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/iat_patch.h"
-#include "base/logging.h"
-
-namespace iat_patch {
-
-struct InterceptFunctionInformation {
-  bool finished_operation;
-  const char* imported_from_module;
-  const char* function_name;
-  void* new_function;
-  void** old_function;
-  IMAGE_THUNK_DATA** iat_thunk;
-  DWORD return_code;
-};
-
-static void* GetIATFunction(IMAGE_THUNK_DATA* iat_thunk) {
-  if (NULL == iat_thunk) {
-    NOTREACHED();
-    return NULL;
-  }
-
-  // Works around the 64 bit portability warning:
-  // The Function member inside IMAGE_THUNK_DATA is really a pointer
-  // to the IAT function. IMAGE_THUNK_DATA correctly maps to IMAGE_THUNK_DATA32
-  // or IMAGE_THUNK_DATA64 for correct pointer size.
-  union FunctionThunk {
-    IMAGE_THUNK_DATA thunk;
-    void* pointer;
-  } iat_function;
-
-  iat_function.thunk = *iat_thunk;
-  return iat_function.pointer;
-}
-
-static bool InterceptEnumCallback(const PEImage &image, const char* module,
-                                  DWORD ordinal, const char* name, DWORD hint,
-                                  IMAGE_THUNK_DATA* iat, void* cookie) {
-  InterceptFunctionInformation* intercept_information =
-    reinterpret_cast<InterceptFunctionInformation*>(cookie);
-
-  if (NULL == intercept_information) {
-    NOTREACHED();
-    return false;
-  }
-
-  DCHECK(module);
-
-  if ((0 == lstrcmpiA(module, intercept_information->imported_from_module)) &&
-     (NULL != name) &&
-     (0 == lstrcmpiA(name, intercept_information->function_name))) {
-    // Save the old pointer.
-    if (NULL != intercept_information->old_function) {
-      *(intercept_information->old_function) = GetIATFunction(iat);
-    }
-
-    if (NULL != intercept_information->iat_thunk) {
-      *(intercept_information->iat_thunk) = iat;
-    }
-
-    // portability check
-    COMPILE_ASSERT(sizeof(iat->u1.Function) ==
-      sizeof(intercept_information->new_function), unknown_IAT_thunk_format);
-
-    // Patch the function.
-    intercept_information->return_code =
-      ModifyCode(&(iat->u1.Function),
-                 &(intercept_information->new_function),
-                 sizeof(intercept_information->new_function));
-
-    // Terminate further enumeration.
-    intercept_information->finished_operation = true;
-    return false;
-  }
-
-  return true;
-}
-
-DWORD InterceptImportedFunction(HMODULE module_handle,
-                                const char* imported_from_module,
-                                const char* function_name, void* new_function,
-                                void** old_function,
-                                IMAGE_THUNK_DATA** iat_thunk) {
-  if ((NULL == module_handle) || (NULL == imported_from_module) ||
-     (NULL == function_name) || (NULL == new_function)) {
-    NOTREACHED();
-    return ERROR_INVALID_PARAMETER;
-  }
-
-  PEImage target_image(module_handle);
-  if (!target_image.VerifyMagic()) {
-    NOTREACHED();
-    return ERROR_INVALID_PARAMETER;
-  }
-
-  InterceptFunctionInformation intercept_information = {
-    false,
-    imported_from_module,
-    function_name,
-    new_function,
-    old_function,
-    iat_thunk,
-    ERROR_GEN_FAILURE};
-
-  // First go through the IAT. If we don't find the import we are looking
-  // for in IAT, search delay import table.
-  target_image.EnumAllImports(InterceptEnumCallback, &intercept_information);
-  if (!intercept_information.finished_operation) {
-    target_image.EnumAllDelayImports(InterceptEnumCallback,
-                                     &intercept_information);
-  }
-
-  return intercept_information.return_code;
-}
-
-DWORD RestoreImportedFunction(void* intercept_function,
-                              void* original_function,
-                              IMAGE_THUNK_DATA* iat_thunk) {
-  if ((NULL == intercept_function) || (NULL == original_function) ||
-      (NULL == iat_thunk)) {
-    NOTREACHED();
-    return ERROR_INVALID_PARAMETER;
-  }
-
-  if (GetIATFunction(iat_thunk) != intercept_function) {
-    // Check if someone else has intercepted on top of us.
-    // We cannot unpatch in this case, just raise a red flag.
-    NOTREACHED();
-    return ERROR_INVALID_FUNCTION;
-  }
-
-  return ModifyCode(&(iat_thunk->u1.Function),
-                    &original_function,
-                    sizeof(original_function));
-}
-
-DWORD ModifyCode(void* old_code, void* new_code, int length) {
-  if ((NULL == old_code) || (NULL == new_code) || (0 == length)) {
-    NOTREACHED();
-    return ERROR_INVALID_PARAMETER;
-  }
-
-  // Change the page protection so that we can write.
-  DWORD error = NO_ERROR;
-  DWORD old_page_protection = 0;
-  if (VirtualProtect(old_code,
-                     length,
-                     PAGE_READWRITE,
-                     &old_page_protection)) {
-
-    // Write the data.
-    CopyMemory(old_code, new_code, length);
-
-    // Restore the old page protection.
-    error = ERROR_SUCCESS;
-    VirtualProtect(old_code,
-                  length,
-                  old_page_protection,
-                  &old_page_protection);
-  } else {
-    error = GetLastError();
-    NOTREACHED();
-  }
-
-  return error;
-}
-
-IATPatchFunction::IATPatchFunction()
-    : module_handle_(NULL),
-      original_function_(NULL),
-      iat_thunk_(NULL),
-      intercept_function_(NULL) {
-}
-
-IATPatchFunction::~IATPatchFunction() {
-  if (NULL != intercept_function_) {
-    DWORD error = Unpatch();
-    DCHECK_EQ(NO_ERROR, error);
-  }
-}
-
-DWORD IATPatchFunction::Patch(const wchar_t* module,
-                              const char* imported_from_module,
-                              const char* function_name,
-                              void* new_function) {
-  DCHECK_EQ(static_cast<void*>(NULL), original_function_);
-  DCHECK_EQ(static_cast<IMAGE_THUNK_DATA*>(NULL), iat_thunk_);
-  DCHECK_EQ(static_cast<void*>(NULL), intercept_function_);
-
-  HMODULE module_handle = LoadLibraryW(module);
-
-  if (module_handle == NULL) {
-    NOTREACHED();
-    return GetLastError();
-  }
-
-  DWORD error = InterceptImportedFunction(module_handle,
-                                          imported_from_module,
-                                          function_name,
-                                          new_function,
-                                          &original_function_,
-                                          &iat_thunk_);
-
-  if (NO_ERROR == error) {
-    DCHECK_NE(original_function_, intercept_function_);
-    module_handle_ = module_handle;
-    intercept_function_ = new_function;
-  } else {
-    FreeLibrary(module_handle);
-  }
-
-  return error;
-}
-
-DWORD IATPatchFunction::Unpatch() {
-  DWORD error = RestoreImportedFunction(intercept_function_,
-                                        original_function_,
-                                        iat_thunk_);
-  DCHECK(NO_ERROR == error);
-
-  // Hands off the intercept if we fail to unpatch.
-  // If IATPatchFunction::Unpatch fails during RestoreImportedFunction
-  // it means that we cannot safely unpatch the import address table
-  // patch. In this case its better to be hands off the intercept as
-  // trying to unpatch again in the destructor of IATPatchFunction is
-  // not going to be any safer
-  if (module_handle_)
-    FreeLibrary(module_handle_);
-  module_handle_ = NULL;
-  intercept_function_ = NULL;
-  original_function_ = NULL;
-  iat_thunk_ = NULL;
-
-  return error;
-}
-
-}  // namespace iat_patch
deleted file mode 100644
--- a/ipc/chromium/src/base/iat_patch.h
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This file declares a helpers to intercept functions from a DLL.
-//
-// This set of functions are designed to intercept functions for a
-// specific DLL imported from another DLL. This is the case when,
-// for example, we want to intercept CertDuplicateCertificateContext
-// function (exported from crypt32.dll) called by wininet.dll.
-
-#ifndef BASE_IAT_PATCH_H__
-#define BASE_IAT_PATCH_H__
-
-#include <windows.h>
-#include "base/basictypes.h"
-#include "base/pe_image.h"
-
-namespace iat_patch {
-
-// Helper to intercept a function in an import table of a specific
-// module.
-//
-// Arguments:
-// module_handle          Module to be intercepted
-// imported_from_module   Module that exports the symbol
-// function_name          Name of the API to be intercepted
-// new_function           Interceptor function
-// old_function           Receives the original function pointer
-// iat_thunk              Receives pointer to IAT_THUNK_DATA
-//                        for the API from the import table.
-//
-// Returns: Returns NO_ERROR on success or Windows error code
-//          as defined in winerror.h
-//
-DWORD InterceptImportedFunction(HMODULE module_handle,
-                                const char* imported_from_module,
-                                const char* function_name,
-                                void* new_function,
-                                void** old_function,
-                                IMAGE_THUNK_DATA** iat_thunk);
-
-// Restore intercepted IAT entry with the original function.
-//
-// Arguments:
-// intercept_function     Interceptor function
-// original_function      Receives the original function pointer
-//
-// Returns: Returns NO_ERROR on success or Windows error code
-//          as defined in winerror.h
-//
-DWORD RestoreImportedFunction(void* intercept_function,
-                              void* original_function,
-                              IMAGE_THUNK_DATA* iat_thunk);
-
-// Change the page protection (of code pages) to writable and copy
-// the data at the specified location
-//
-// Arguments:
-// old_code               Target location to copy
-// new_code               Source
-// length                 Number of bytes to copy
-//
-// Returns: Windows error code (winerror.h). NO_ERROR if successful
-//
-DWORD ModifyCode(void* old_code,
-                 void* new_code,
-                 int length);
-
-// A class that encapsulates IAT patching helpers and restores
-// the original function in the destructor.
-class IATPatchFunction {
- public:
-  IATPatchFunction();
-  ~IATPatchFunction();
-
-  // Intercept a function in an import table of a specific
-  // module. Save the original function and the import
-  // table address. These values will be used later
-  // during Unpatch
-  //
-  // Arguments:
-  // module                 Module to be intercepted
-  // imported_from_module   Module that exports the 'function_name'
-  // function_name          Name of the API to be intercepted
-  //
-  // Returns: Windows error code (winerror.h). NO_ERROR if successful
-  //
-  // Note: Patching a function will make the IAT patch take some "ownership" on
-  // |module|.  It will LoadLibrary(module) to keep the DLL alive until a call
-  // to Unpatch(), which will call FreeLibrary() and allow the module to be
-  // unloaded.  The idea is to help prevent the DLL from going away while a
-  // patch is still active.
-  //
-  DWORD Patch(const wchar_t* module,
-              const char* imported_from_module,
-              const char* function_name,
-              void* new_function);
-
-  // Unpatch the IAT entry using internally saved original
-  // function.
-  //
-  // Returns: Windows error code (winerror.h). NO_ERROR if successful
-  //
-  DWORD Unpatch();
-
-  bool is_patched() const {
-    return (NULL != intercept_function_);
-  }
-
- private:
-  HMODULE module_handle_;
-  void* intercept_function_;
-  void* original_function_;
-  IMAGE_THUNK_DATA* iat_thunk_;
-
-  DISALLOW_EVIL_CONSTRUCTORS(IATPatchFunction);
-};
-
-}  // namespace iat_patch
-
-#endif  // BASE_IAT_PATCH_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/icu_util.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2006-2008 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 "build/build_config.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
-
-#include <string>
-
-#include "base/icu_util.h"
-
-#include "base/file_path.h"
-#include "base/file_util.h"
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "base/sys_string_conversions.h"
-#include "unicode/putil.h"
-#include "unicode/udata.h"
-
-#define ICU_UTIL_DATA_FILE   0
-#define ICU_UTIL_DATA_SHARED 1
-#define ICU_UTIL_DATA_STATIC 2
-
-#ifndef ICU_UTIL_DATA_IMPL
-
-#if defined(OS_WIN)
-#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_SHARED
-#elif defined(OS_MACOSX)
-#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_STATIC
-#elif defined(OS_LINUX)
-#define ICU_UTIL_DATA_IMPL ICU_UTIL_DATA_FILE
-#endif
-
-#endif  // ICU_UTIL_DATA_IMPL
-
-#if defined(OS_WIN)
-#define ICU_UTIL_DATA_SYMBOL "icudt38_dat"
-#define ICU_UTIL_DATA_SHARED_MODULE_NAME L"icudt38.dll"
-#endif
-
-namespace icu_util {
-
-bool Initialize() {
-#ifndef NDEBUG
-  // Assert that we are not called more than once.  Even though calling this
-  // function isn't harmful (ICU can handle it), being called twice probably
-  // indicates a programming error.
-  static bool called_once = false;
-  DCHECK(!called_once);
-  called_once = true;
-#endif
-
-#if (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_SHARED)
-  // We expect to find the ICU data module alongside the current module.
-  std::wstring data_path;
-  PathService::Get(base::DIR_MODULE, &data_path);
-  file_util::AppendToPath(&data_path, ICU_UTIL_DATA_SHARED_MODULE_NAME);
-
-  HMODULE module = LoadLibrary(data_path.c_str());
-  if (!module)
-    return false;
-
-  FARPROC addr = GetProcAddress(module, ICU_UTIL_DATA_SYMBOL);
-  if (!addr)
-    return false;
-
-  UErrorCode err = U_ZERO_ERROR;
-  udata_setCommonData(reinterpret_cast<void*>(addr), &err);
-  return err == U_ZERO_ERROR;
-#elif (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_STATIC)
-  // Mac bundles the ICU data in.
-  return true;
-#elif (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
-  // For now, expect the data file to be alongside the executable.
-  // This is sufficient while we work on unit tests, but will eventually
-  // likely live in a data directory.
-  FilePath data_path;
-  bool path_ok = PathService::Get(base::DIR_EXE, &data_path);
-  DCHECK(path_ok);
-  u_setDataDirectory(data_path.value().c_str());
-  // Only look for the packaged data file;
-  // the default behavior is to look for individual files.
-  UErrorCode err = U_ZERO_ERROR;
-  udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
-  return err == U_ZERO_ERROR;
-#endif
-}
-
-}  // namespace icu_util
deleted file mode 100644
--- a/ipc/chromium/src/base/icu_util.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_ICU_UTIL_H__
-#define BASE_ICU_UTIL_H__
-
-namespace icu_util {
-
-// Call this function to load ICU's data tables for the current process.  This
-// function should be called before ICU is used.
-bool Initialize();
-
-}  // namespace icu_util
-
-#endif  // BASE_ICU_UTIL_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/linux_util.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2009 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 "linux_util.h"
-
-#include <stdlib.h>
-
-namespace base {
-
-uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride) {
-  if (stride == 0)
-    stride = width * 4;
-
-  uint8_t* new_pixels = static_cast<uint8_t*>(malloc(height * stride));
-
-  // We have to copy the pixels and swap from BGRA to RGBA.
-  for (int i = 0; i < height; ++i) {
-    for (int j = 0; j < width; ++j) {
-      int idx = i * stride + j * 4;
-      new_pixels[idx] = pixels[idx + 2];
-      new_pixels[idx + 1] = pixels[idx + 1];
-      new_pixels[idx + 2] = pixels[idx];
-      new_pixels[idx + 3] = pixels[idx + 3];
-    }
-  }
-
-  return new_pixels;
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/md5.cc
+++ /dev/null
@@ -1,279 +0,0 @@
-// The original file was copied from sqlite, and was in the public domain.
-// Modifications Copyright 2006 Google Inc. All Rights Reserved
-
-/*
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest.  This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to MD5Init, call MD5Update as
- * needed on buffers full of bytes, and then call MD5Final, which
- * will fill a supplied 16-byte array with the digest.
- */
-
-#include <string>
-
-#include "base/md5.h"
-
-#include "base/basictypes.h"
-
-struct Context {
-  uint32_t buf[4];
-  uint32_t bits[2];
-  unsigned char in[64];
-};
-
-/*
- * Note: this code is harmless on little-endian machines.
- */
-static void byteReverse (unsigned char *buf, unsigned longs){
-        uint32_t t;
-        do {
-                t = (uint32_t)((unsigned)buf[3]<<8 | buf[2]) << 16 |
-                            ((unsigned)buf[1]<<8 | buf[0]);
-                *(uint32_t *)buf = t;
-                buf += 4;
-        } while (--longs);
-}
-/* The four core functions - F1 is optimized somewhat */
-
-/* #define F1(x, y, z) (x & y | ~x & z) */
-#define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
-#define F3(x, y, z) (x ^ y ^ z)
-#define F4(x, y, z) (y ^ (x | ~z))
-
-/* This is the central step in the MD5 algorithm. */
-#define MD5STEP(f, w, x, y, z, data, s) \
-        ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
-
-/*
- * The core of the MD5 algorithm, this alters an existing MD5 hash to
- * reflect the addition of 16 longwords of new data.  MD5Update blocks
- * the data and converts bytes into longwords for this routine.
- */
-static void MD5Transform(uint32_t buf[4], const uint32_t in[16]){
-        register uint32_t a, b, c, d;
-
-        a = buf[0];
-        b = buf[1];
-        c = buf[2];
-        d = buf[3];
-
-        MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478,  7);
-        MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12);
-        MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17);
-        MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22);
-        MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf,  7);
-        MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12);
-        MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17);
-        MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22);
-        MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8,  7);
-        MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12);
-        MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17);
-        MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22);
-        MD5STEP(F1, a, b, c, d, in[12]+0x6b901122,  7);
-        MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12);
-        MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17);
-        MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22);
-
-        MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562,  5);
-        MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340,  9);
-        MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14);
-        MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20);
-        MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d,  5);
-        MD5STEP(F2, d, a, b, c, in[10]+0x02441453,  9);
-        MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14);
-        MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20);
-        MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6,  5);
-        MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6,  9);
-        MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14);
-        MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20);
-        MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905,  5);
-        MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8,  9);
-        MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14);
-        MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20);
-
-        MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942,  4);
-        MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11);
-        MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16);
-        MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23);
-        MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44,  4);
-        MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11);
-        MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16);
-        MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23);
-        MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6,  4);
-        MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11);
-        MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16);
-        MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23);
-        MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039,  4);
-        MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11);
-        MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16);
-        MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23);
-
-        MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244,  6);
-        MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10);
-        MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15);
-        MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21);
-        MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3,  6);
-        MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10);
-        MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15);
-        MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21);
-        MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f,  6);
-        MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10);
-        MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15);
-        MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21);
-        MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82,  6);
-        MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10);
-        MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15);
-        MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21);
-
-        buf[0] += a;
-        buf[1] += b;
-        buf[2] += c;
-        buf[3] += d;
-}
-
-/*
- * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
- * initialization constants.
- */
-void MD5Init(MD5Context *pCtx){
-        struct Context *ctx = (struct Context *)pCtx;
-        ctx->buf[0] = 0x67452301;
-        ctx->buf[1] = 0xefcdab89;
-        ctx->buf[2] = 0x98badcfe;
-        ctx->buf[3] = 0x10325476;
-        ctx->bits[0] = 0;
-        ctx->bits[1] = 0;
-}
-
-/*
- * Update context to reflect the concatenation of another buffer full
- * of bytes.
- */
-void MD5Update(MD5Context *pCtx, const void *inbuf, size_t len){
-        struct Context *ctx = (struct Context *)pCtx;
-        const unsigned char* buf = (const unsigned char*)inbuf;
-        uint32_t t;
-
-        /* Update bitcount */
-
-        t = ctx->bits[0];
-        if ((ctx->bits[0] = t + ((uint32_t)len << 3)) < t)
-                ctx->bits[1]++; /* Carry from low to high */
-        ctx->bits[1] += static_cast<uint32_t>(len >> 29);
-
-        t = (t >> 3) & 0x3f;    /* Bytes already in shsInfo->data */
-
-        /* Handle any leading odd-sized chunks */
-
-        if ( t ) {
-                unsigned char *p = (unsigned char *)ctx->in + t;
-
-                t = 64-t;
-                if (len < t) {
-                        memcpy(p, buf, len);
-                        return;
-                }
-                memcpy(p, buf, t);
-                byteReverse(ctx->in, 16);
-                MD5Transform(ctx->buf, (uint32_t *)ctx->in);
-                buf += t;
-                len -= t;
-        }
-
-        /* Process data in 64-byte chunks */
-
-        while (len >= 64) {
-                memcpy(ctx->in, buf, 64);
-                byteReverse(ctx->in, 16);
-                MD5Transform(ctx->buf, (uint32_t *)ctx->in);
-                buf += 64;
-                len -= 64;
-        }
-
-        /* Handle any remaining bytes of data. */
-
-        memcpy(ctx->in, buf, len);
-}
-
-/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
- * 1 0* (64-bit count of bits processed, MSB-first)
- */
-void MD5Final(MD5Digest* digest, MD5Context *pCtx){
-        struct Context *ctx = (struct Context *)pCtx;
-        unsigned count;
-        unsigned char *p;
-
-        /* Compute number of bytes mod 64 */
-        count = (ctx->bits[0] >> 3) & 0x3F;
-
-        /* Set the first char of padding to 0x80.  This is safe since there is
-           always at least one byte free */
-        p = ctx->in + count;
-        *p++ = 0x80;
-
-        /* Bytes of padding needed to make 64 bytes */
-        count = 64 - 1 - count;
-
-        /* Pad out to 56 mod 64 */
-        if (count < 8) {
-                /* Two lots of padding:  Pad the first block to 64 bytes */
-                memset(p, 0, count);
-                byteReverse(ctx->in, 16);
-                MD5Transform(ctx->buf, (uint32_t *)ctx->in);
-
-                /* Now fill the next block with 56 bytes */
-                memset(ctx->in, 0, 56);
-        } else {
-                /* Pad block to 56 bytes */
-                memset(p, 0, count-8);
-        }
-        byteReverse(ctx->in, 14);
-
-        /* Append length in bits and transform */
-        ((uint32_t *)ctx->in)[ 14 ] = ctx->bits[0];
-        ((uint32_t *)ctx->in)[ 15 ] = ctx->bits[1];
-
-        MD5Transform(ctx->buf, (uint32_t *)ctx->in);
-        byteReverse((unsigned char *)ctx->buf, 4);
-        memcpy(digest->a, ctx->buf, 16);
-        memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
-}
-
-std::string MD5DigestToBase16(const MD5Digest& digest){
-  static char const zEncode[] = "0123456789abcdef";
-
-  std::string ret;
-  ret.resize(32);
-
-  int j = 0;
-  for(int i = 0; i < 16; i ++){
-    int a = digest.a[i];
-    ret[j++] = zEncode[(a>>4)&0xf];
-    ret[j++] = zEncode[a & 0xf];
-  }
-  return ret;
-}
-
-void MD5Sum(const void* data, size_t length, MD5Digest* digest) {
-  MD5Context ctx;
-  MD5Init(&ctx);
-  MD5Update(&ctx, static_cast<const unsigned char*>(data), length);
-  MD5Final(digest, &ctx);
-}
-
-std::string MD5String(const std::string& str) {
-  MD5Digest digest;
-  MD5Sum(str.data(), str.length(), &digest);
-  return MD5DigestToBase16(digest);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/md5.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_MD5_H__
-#define BASE_MD5_H__
-
-#include <string>
-
-// These functions perform MD5 operations. The simplest call is MD5Sum to
-// generate the MD5 sum of the given data.
-//
-// You can also compute the MD5 sum of data incrementally by making multiple
-// calls to MD5Update:
-//    MD5Context ctx; // intermediate MD5 data: do not use
-//    MD5Init(&ctx);
-//    MD5Update(&ctx, data1, length1);
-//    MD5Update(&ctx, data2, length2);
-//    ...
-//
-//    MD5Digest digest; // the result of the computation
-//    MD5Final(&digest, &ctx);
-//
-// You can call MD5DigestToBase16 to generate a string of the digest.
-
-// The output of an MD5 operation
-typedef struct MD5Digest_struct {
-  unsigned char a[16];
-} MD5Digest;
-
-// Used for storing intermediate data during an MD5 computation. Callers
-// should not access the data.
-typedef char MD5Context[88];
-
-// Computes the MD5 sum of the given data buffer with the given length.
-// The given 'digest' structure will be filled with the result data.
-void MD5Sum(const void* data, size_t length, MD5Digest* digest);
-
-// Initializes the given MD5 context structure for subsequent calls to
-// MD5Update.
-void MD5Init(MD5Context* context);
-
-// For the given buffer of data, updates the given MD5 context with the sum of
-// the data. You can call this any number of times during the computation,
-// exept that MD5Init must have been called first.
-void MD5Update(MD5Context* context, const void* buf, size_t len);
-
-// Finalizes the MD5 operation and fills the buffer with the digest.
-void MD5Final(MD5Digest* digest, MD5Context* pCtx);
-
-// Converts a digest into human-readable hexadecimal.
-std::string MD5DigestToBase16(const MD5Digest& digest);
-
-// Returns the MD5 (in hexadecimal) of a string.
-std::string MD5String(const std::string& str);
-
-#endif // BASE_MD5_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/multiprocess_test.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_MULTIPROCESS_TEST_H__
-#define BASE_MULTIPROCESS_TEST_H__
-
-#include "base/base_switches.h"
-#include "base/command_line.h"
-#include "base/process_util.h"
-#include "base/string_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/multiprocess_func_list.h"
-#include "testing/platform_test.h"
-
-#if defined(OS_POSIX)
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-// Command line switch to invoke a child process rather than
-// to run the normal test suite.
-static const wchar_t kRunClientProcess[] = L"client";
-
-// A MultiProcessTest is a test class which makes it easier to
-// write a test which requires code running out of process.
-//
-// To create a multiprocess test simply follow these steps:
-//
-// 1) Derive your test from MultiProcessTest. Example:
-//
-//    class MyTest : public MultiProcessTest {
-//    };
-//
-//    TEST_F(MyTest, TestCaseName) {
-//      ...
-//    }
-//
-// 2) Create a mainline function for the child processes and include
-//    testing/multiprocess_func_list.h.
-//    See the declaration of the MULTIPROCESS_TEST_MAIN macro
-//    in that file for an example.
-// 3) Call SpawnChild(L"foo"), where "foo" is the name of
-//    the function you wish to run in the child processes.
-// That's it!
-//
-class MultiProcessTest : public PlatformTest {
- protected:
-  // Run a child process.
-  // 'procname' is the name of a function which the child will
-  // execute.  It must be exported from this library in order to
-  // run.
-  //
-  // Example signature:
-  //    extern "C" int __declspec(dllexport) FooBar() {
-  //         // do client work here
-  //    }
-  //
-  // Returns the handle to the child, or NULL on failure
-  //
-  // TODO(darin): re-enable this once we have base/debug_util.h
-  // ProcessDebugFlags(&cl, DebugUtil::UNKNOWN, false);
-  base::ProcessHandle SpawnChild(const std::wstring& procname) {
-    return SpawnChild(procname, false);
-  }
-
-  base::ProcessHandle SpawnChild(const std::wstring& procname,
-                                 bool debug_on_start) {
-#if defined(OS_WIN)
-    return SpawnChildImpl(procname, debug_on_start);
-#elif defined(OS_POSIX)
-    base::file_handle_mapping_vector empty_file_list;
-    return SpawnChildImpl(procname, empty_file_list, debug_on_start);
-#endif
-  }
-
-#if defined(OS_POSIX)
-  base::ProcessHandle SpawnChild(
-      const std::wstring& procname,
-      const base::file_handle_mapping_vector& fds_to_map,
-      bool debug_on_start) {
-    return SpawnChildImpl(procname, fds_to_map, debug_on_start);
-  }
-#endif
-
- private:
-#if defined(OS_WIN)
-  base::ProcessHandle SpawnChildImpl(
-      const std::wstring& procname,
-      bool debug_on_start) {
-    CommandLine cl(*CommandLine::ForCurrentProcess());
-    base::ProcessHandle handle = static_cast<base::ProcessHandle>(NULL);
-    cl.AppendSwitchWithValue(kRunClientProcess, procname);
-
-    if (debug_on_start)
-      cl.AppendSwitch(switches::kDebugOnStart);
-
-    base::LaunchApp(cl, false, true, &handle);
-    return handle;
-  }
-#elif defined(OS_POSIX)
-  // TODO(port): with the CommandLine refactoring, this code is very similar
-  // to the Windows code.  Investigate whether this can be made shorter.
-  base::ProcessHandle SpawnChildImpl(
-      const std::wstring& procname,
-      const base::file_handle_mapping_vector& fds_to_map,
-      bool debug_on_start) {
-    CommandLine cl(*CommandLine::ForCurrentProcess());
-    base::ProcessHandle handle = static_cast<base::ProcessHandle>(NULL);
-    cl.AppendSwitchWithValue(kRunClientProcess, procname);
-
-    if (debug_on_start)
-      cl.AppendSwitch(switches::kDebugOnStart);
-
-    base::LaunchApp(cl.argv(), fds_to_map, false, &handle);
-    return handle;
-  }
-#endif
-};
-
-#endif  // BASE_MULTIPROCESS_TEST_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/native_library.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2009 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.
-
-#ifndef BASE_NATIVE_LIBRARY_H_
-#define BASE_NATIVE_LIBRARY_H_
-
-// This file defines a cross-platform "NativeLibrary" type which represents
-// a loadable module.
-
-#include "build/build_config.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#elif defined(OS_MACOSX)
-#import <Carbon/Carbon.h>
-#endif  // OS_*
-
-class FilePath;
-
-namespace base {
-
-#if defined(OS_WIN)
-typedef HMODULE NativeLibrary;
-typedef char* NativeLibraryFunctionNameType;
-#elif defined(OS_MACOSX)
-typedef CFBundleRef NativeLibrary;
-typedef CFStringRef NativeLibraryFunctionNameType;
-#elif defined(OS_LINUX)
-typedef void* NativeLibrary;
-typedef const char* NativeLibraryFunctionNameType;
-#endif  // OS_*
-
-// Loads a native library from disk.  Release it with UnloadNativeLibrary when
-// you're done.
-NativeLibrary LoadNativeLibrary(const FilePath& library_path);
-
-// Unloads a native library.
-void UnloadNativeLibrary(NativeLibrary library);
-
-// Gets a function pointer from a native library.
-void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
-                                          NativeLibraryFunctionNameType name);
-
-}  // namespace base
-
-#endif  // BASE_NATIVE_LIBRARY_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/native_library_linux.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2009 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 "base/native_library.h"
-
-#include <dlfcn.h>
-
-#include "base/file_path.h"
-#include "base/logging.h"
-
-namespace base {
-
-// static
-NativeLibrary LoadNativeLibrary(const FilePath& library_path) {
-  void* dl = dlopen(library_path.value().c_str(), RTLD_LAZY);
-  if (!dl)
-    NOTREACHED() << "dlopen failed: " << dlerror();
-
-  return dl;
-}
-
-// static
-void UnloadNativeLibrary(NativeLibrary library) {
-  int ret = dlclose(library);
-  if (ret < 0)
-    NOTREACHED() << "dlclose failed: " << dlerror();
-}
-
-// static
-void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
-                                          NativeLibraryFunctionNameType name) {
-  return dlsym(library, name);
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/native_library_mac.mm
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2009 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 "base/native_library.h"
-
-#import <Carbon/Carbon.h>
-
-#include "base/file_path.h"
-#include "base/scoped_cftyperef.h"
-
-namespace base {
-
-// static
-NativeLibrary LoadNativeLibrary(const FilePath& library_path) {
-  scoped_cftyperef<CFURLRef> url(CFURLCreateFromFileSystemRepresentation(
-      kCFAllocatorDefault,
-      (const UInt8*)library_path.value().c_str(),
-      library_path.value().length(),
-      true));
-  if (!url)
-    return NULL;
-
-  return CFBundleCreate(kCFAllocatorDefault, url.get());
-}
-
-// static
-void UnloadNativeLibrary(NativeLibrary library) {
-  CFRelease(library);
-}
-
-// static
-void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
-                                          NativeLibraryFunctionNameType name) {
-  return CFBundleGetFunctionPointerForName(library, name);
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/native_library_win.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2009 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 "base/native_library.h"
-
-#include <windows.h>
-
-#include "base/file_path.h"
-#include "base/path_service.h"
-
-namespace base {
-
-// static
-NativeLibrary LoadNativeLibrary(const FilePath& library_path) {
-  // Switch the current directory to the library directory as the library
-  // may have dependencies on DLLs in this directory.
-  bool restore_directory = false;
-  std::wstring current_directory;
-  if (PathService::Get(base::DIR_CURRENT, &current_directory)) {
-    FilePath plugin_path = library_path.DirName();
-    if (!plugin_path.value().empty()) {
-      PathService::SetCurrentDirectory(plugin_path.value());
-      restore_directory = true;
-    }
-  }
-
-  HMODULE module = LoadLibrary(library_path.value().c_str());
-  if (restore_directory)
-    PathService::SetCurrentDirectory(current_directory);
-
-  return module;
-}
-
-// static
-void UnloadNativeLibrary(NativeLibrary library) {
-  FreeLibrary(library);
-}
-
-// static
-void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
-                                          NativeLibraryFunctionNameType name) {
-  return GetProcAddress(library, name);
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/no_windows2000_unittest.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_NO_WINDOWS2000_UNITTEST_H_
-#define BASE_NO_WINDOWS2000_UNITTEST_H_
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "base/win_util.h"
-
-// Disable the whole test case when executing on Windows 2000 or lower.
-// Note: Parent should be testing::Test or UITest.
-template<typename Parent>
-class NoWindows2000Test : public Parent {
- public:
-  static bool IsTestCaseDisabled() {
-    return win_util::GetWinVersion() <= win_util::WINVERSION_2000;
-  }
-};
-
-#endif  // BASE_NO_WINDOWS2000_UNITTEST_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/nss_init.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (c) 2008 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 "base/nss_init.h"
-
-#include <nss.h>
-#include <plarena.h>
-#include <prerror.h>
-#include <prinit.h>
-
-// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424
-// until NSS 3.12.2 comes out and we update to it.
-#define Lock FOO_NSS_Lock
-#include <secmod.h>
-#include <ssl.h>
-#undef Lock
-
-#include "base/file_util.h"
-#include "base/logging.h"
-#include "base/singleton.h"
-
-namespace {
-
-// Load nss's built-in root certs.
-SECMODModule *InitDefaultRootCerts() {
-  const char* kModulePath = "libnssckbi.so";
-  char modparams[1024];
-  snprintf(modparams, sizeof(modparams),
-          "name=\"Root Certs\" library=\"%s\"", kModulePath);
-  SECMODModule *root = SECMOD_LoadUserModule(modparams, NULL, PR_FALSE);
-  if (root)
-    return root;
-
-  // Aw, snap.  Can't find/load root cert shared library.
-  // This will make it hard to talk to anybody via https.
-  NOTREACHED();
-  return NULL;
-}
-
-class NSSInitSingleton {
- public:
-  NSSInitSingleton() {
-    // Initialize without using a persistant database (e.g. ~/.netscape)
-    SECStatus status = NSS_NoDB_Init(".");
-    if (status != SECSuccess) {
-      char buffer[513] = "Couldn't retrieve error";
-      int32_t err_length = PR_GetErrorTextLength();
-      if (err_length > 0 && static_cast<size_t>(err_length) < sizeof(buffer))
-        PR_GetErrorText(buffer);
-
-      NOTREACHED() << "Error calling NSS_NoDB_Init: " << buffer;
-    }
-
-    root_ = InitDefaultRootCerts();
-
-    NSS_SetDomesticPolicy();
-
-    // Explicitly enable exactly those ciphers with keys of at least 80 bits
-    for (int i = 0; i < SSL_NumImplementedCiphers; i++) {
-      SSLCipherSuiteInfo info;
-      if (SSL_GetCipherSuiteInfo(SSL_ImplementedCiphers[i], &info,
-                                 sizeof(info)) == SECSuccess) {
-        SSL_CipherPrefSetDefault(SSL_ImplementedCiphers[i],
-                                 (info.effectiveKeyBits >= 80));
-      }
-    }
-
-    // Enable SSL
-    SSL_OptionSetDefault(SSL_SECURITY, PR_TRUE);
-
-    // All other SSL options are set per-session by SSLClientSocket.
-  }
-
-  ~NSSInitSingleton() {
-    if (root_) {
-      SECMOD_UnloadUserModule(root_);
-      SECMOD_DestroyModule(root_);
-      root_ = NULL;
-    }
-
-    // Have to clear the cache, or NSS_Shutdown fails with SEC_ERROR_BUSY
-    SSL_ClearSessionCache();
-
-    SECStatus status = NSS_Shutdown();
-    if (status != SECSuccess)
-      LOG(ERROR) << "NSS_Shutdown failed, leak?  See "
-                    "http://code.google.com/p/chromium/issues/detail?id=4609";
-
-    PL_ArenaFinish();
-
-    PRStatus prstatus = PR_Cleanup();
-    if (prstatus != PR_SUCCESS)
-      LOG(ERROR) << "PR_Cleanup failed?";
-  }
-
- private:
-  SECMODModule *root_;
-};
-
-}  // namespace
-
-namespace base {
-
-void EnsureNSSInit() {
-  Singleton<NSSInitSingleton>::get();
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/nss_init.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) 2008 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.
-
-#ifndef BASE_NSS_INIT_H_
-#define BASE_NSS_INIT_H_
-
-namespace base {
-
-// Initialize NSS if it isn't already initialized.  This must be called before
-// any other NSS functions.  This function is thread-safe, and NSS will only
-// ever be initialized once.  NSS will be properly shut down on program exit.
-void EnsureNSSInit();
-
-}  // namespace base
-
-#endif  // BASE_NSS_INIT_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/pe_image.cc
+++ /dev/null
@@ -1,542 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This file implements PEImage, a generic class to manipulate PE files.
-// This file was adapted from GreenBorder's Code.
-
-#include "base/pe_image.h"
-
-#ifdef _WIN64
-#error This code is not tested on x64. Please make sure all the base unit tests\
- pass before doing any real work. The current unit tests don't test the\
- differences between 32- and 64-bits implementations. Bugs may slip through.\
- You need to improve the coverage before continuing.
-#endif
-
-// Structure to perform imports enumerations.
-struct EnumAllImportsStorage {
-  PEImage::EnumImportsFunction callback;
-  PVOID cookie;
-};
-
-// Callback used to enumerate imports. See EnumImportChunksFunction.
-bool ProcessImportChunk(const PEImage &image, LPCSTR module,
-                        PIMAGE_THUNK_DATA name_table,
-                        PIMAGE_THUNK_DATA iat, PVOID cookie) {
-  EnumAllImportsStorage &storage = *reinterpret_cast<EnumAllImportsStorage*>(
-                                       cookie);
-
-  return image.EnumOneImportChunk(storage.callback, module, name_table, iat,
-                                  storage.cookie);
-}
-
-// Callback used to enumerate delay imports. See EnumDelayImportChunksFunction.
-bool ProcessDelayImportChunk(const PEImage &image,
-                             PImgDelayDescr delay_descriptor,
-                             LPCSTR module, PIMAGE_THUNK_DATA name_table,
-                             PIMAGE_THUNK_DATA iat, PIMAGE_THUNK_DATA bound_iat,
-                             PIMAGE_THUNK_DATA unload_iat, PVOID cookie) {
-  EnumAllImportsStorage &storage = *reinterpret_cast<EnumAllImportsStorage*>(
-                                       cookie);
-
-  return image.EnumOneDelayImportChunk(storage.callback, delay_descriptor,
-                                       module, name_table, iat, bound_iat,
-                                       unload_iat, storage.cookie);
-}
-
-void PEImage::set_module(HMODULE module) {
-  module_ = module;
-}
-
-PIMAGE_DOS_HEADER PEImage::GetDosHeader() const {
-  return reinterpret_cast<PIMAGE_DOS_HEADER>(module_);
-}
-
-PIMAGE_NT_HEADERS PEImage::GetNTHeaders() const {
-  PIMAGE_DOS_HEADER dos_header = GetDosHeader();
-
-  return reinterpret_cast<PIMAGE_NT_HEADERS>(
-      reinterpret_cast<char*>(dos_header) + dos_header->e_lfanew);
-}
-
-PIMAGE_SECTION_HEADER PEImage::GetSectionHeader(UINT section) const {
-  PIMAGE_NT_HEADERS nt_headers = GetNTHeaders();
-  PIMAGE_SECTION_HEADER first_section = IMAGE_FIRST_SECTION(nt_headers);
-
-  if (section < nt_headers->FileHeader.NumberOfSections)
-    return first_section + section;
-  else
-    return NULL;
-}
-
-WORD PEImage::GetNumSections() const {
-  return GetNTHeaders()->FileHeader.NumberOfSections;
-}
-
-DWORD PEImage::GetImageDirectoryEntrySize(UINT directory) const {
-  PIMAGE_NT_HEADERS nt_headers = GetNTHeaders();
-
-  return nt_headers->OptionalHeader.DataDirectory[directory].Size;
-}
-
-PVOID PEImage::GetImageDirectoryEntryAddr(UINT directory) const {
-  PIMAGE_NT_HEADERS nt_headers = GetNTHeaders();
-
-  return RVAToAddr(
-      nt_headers->OptionalHeader.DataDirectory[directory].VirtualAddress);
-}
-
-PIMAGE_SECTION_HEADER PEImage::GetImageSectionFromAddr(PVOID address) const {
-  PBYTE target = reinterpret_cast<PBYTE>(address);
-  PIMAGE_SECTION_HEADER section;
-
-  for (UINT i = 0; NULL != (section = GetSectionHeader(i)); i++) {
-    // Don't use the virtual RVAToAddr.
-    PBYTE start = reinterpret_cast<PBYTE>(
-                      PEImage::RVAToAddr(section->VirtualAddress));
-
-    DWORD size = section->Misc.VirtualSize;
-
-    if ((start <= target) && (start + size > target))
-      return section;
-  }
-
-  return NULL;
-}
-
-PIMAGE_SECTION_HEADER PEImage::GetImageSectionHeaderByName(
-    LPCSTR section_name) const {
-  if (NULL == section_name)
-    return NULL;
-
-  PIMAGE_SECTION_HEADER ret = NULL;
-  int num_sections = GetNumSections();
-
-  for (int i = 0; i < num_sections; i++) {
-    PIMAGE_SECTION_HEADER section = GetSectionHeader(i);
-    if (0 == _strnicmp(reinterpret_cast<LPCSTR>(section->Name), section_name,
-                       sizeof(section->Name))) {
-      ret = section;
-      break;
-    }
-  }
-
-  return ret;
-}
-
-PDWORD PEImage::GetExportEntry(LPCSTR name) const {
-  PIMAGE_EXPORT_DIRECTORY exports = GetExportDirectory();
-
-  if (NULL == exports)
-    return NULL;
-
-  WORD ordinal = 0;
-  if (!GetProcOrdinal(name, &ordinal))
-    return NULL;
-
-  PDWORD functions = reinterpret_cast<PDWORD>(
-                         RVAToAddr(exports->AddressOfFunctions));
-
-  return functions + ordinal - exports->Base;
-}
-
-FARPROC PEImage::GetProcAddress(LPCSTR function_name) const {
-  PDWORD export_entry = GetExportEntry(function_name);
-  if (NULL == export_entry)
-    return NULL;
-
-  PBYTE function = reinterpret_cast<PBYTE>(RVAToAddr(*export_entry));
-
-  PBYTE exports = reinterpret_cast<PBYTE>(
-      GetImageDirectoryEntryAddr(IMAGE_DIRECTORY_ENTRY_EXPORT));
-  DWORD size = GetImageDirectoryEntrySize(IMAGE_DIRECTORY_ENTRY_EXPORT);
-
-  // Check for forwarded exports as a special case.
-  if (exports <= function && exports + size > function)
-#pragma warning(push)
-#pragma warning(disable: 4312)
-    // This cast generates a warning because it is 32 bit specific.
-    return reinterpret_cast<FARPROC>(0xFFFFFFFF);
-#pragma warning(pop)
-
-  return reinterpret_cast<FARPROC>(function);
-}
-
-bool PEImage::GetProcOrdinal(LPCSTR function_name, WORD *ordinal) const {
-  if (NULL == ordinal)
-    return false;
-
-  PIMAGE_EXPORT_DIRECTORY exports = GetExportDirectory();
-
-  if (NULL == exports)
-    return false;
-
-  if (IsOrdinal(function_name)) {
-    *ordinal = ToOrdinal(function_name);
-  } else {
-    PDWORD names = reinterpret_cast<PDWORD>(RVAToAddr(exports->AddressOfNames));
-    PDWORD lower = names;
-    PDWORD upper = names + exports->NumberOfNames;
-    int cmp = -1;
-
-    // Binary Search for the name.
-    while (lower != upper) {
-      PDWORD middle = lower + (upper - lower) / 2;
-      LPCSTR name = reinterpret_cast<LPCSTR>(RVAToAddr(*middle));
-
-      cmp = strcmp(function_name, name);
-
-      if (cmp == 0) {
-        lower = middle;
-        break;
-      }
-
-      if (cmp > 0)
-        lower = middle + 1;
-      else
-        upper = middle;
-    }
-
-    if (cmp != 0)
-      return false;
-
-
-    PWORD ordinals = reinterpret_cast<PWORD>(
-                         RVAToAddr(exports->AddressOfNameOrdinals));
-
-    *ordinal = ordinals[lower - names] + static_cast<WORD>(exports->Base);
-  }
-
-  return true;
-}
-
-bool PEImage::EnumSections(EnumSectionsFunction callback, PVOID cookie) const {
-  PIMAGE_NT_HEADERS nt_headers = GetNTHeaders();
-  UINT num_sections = nt_headers->FileHeader.NumberOfSections;
-  PIMAGE_SECTION_HEADER section = GetSectionHeader(0);
-
-  for (UINT i = 0; i < num_sections; i++, section++) {
-    PVOID section_start = RVAToAddr(section->VirtualAddress);
-    DWORD size = section->Misc.VirtualSize;
-
-    if (!callback(*this, section, section_start, size, cookie))
-      return false;
-  }
-
-  return true;
-}
-
-bool PEImage::EnumExports(EnumExportsFunction callback, PVOID cookie) const {
-  PVOID directory = GetImageDirectoryEntryAddr(IMAGE_DIRECTORY_ENTRY_EXPORT);
-  DWORD size = GetImageDirectoryEntrySize(IMAGE_DIRECTORY_ENTRY_EXPORT);
-
-  // Check if there are any exports at all.
-  if (NULL == directory || 0 == size)
-    return true;
-
-  PIMAGE_EXPORT_DIRECTORY exports = reinterpret_cast<PIMAGE_EXPORT_DIRECTORY>(
-                                        directory);
-  UINT ordinal_base = exports->Base;
-  UINT num_funcs = exports->NumberOfFunctions;
-  UINT num_names = exports->NumberOfNames;
-  PDWORD functions  = reinterpret_cast<PDWORD>(RVAToAddr(
-                          exports->AddressOfFunctions));
-  PDWORD names = reinterpret_cast<PDWORD>(RVAToAddr(exports->AddressOfNames));
-  PWORD ordinals = reinterpret_cast<PWORD>(RVAToAddr(
-                       exports->AddressOfNameOrdinals));
-
-  for (UINT count = 0; count < num_funcs; count++) {
-    PVOID func = RVAToAddr(functions[count]);
-    if (NULL == func)
-      continue;
-
-    // Check for a name.
-    LPCSTR name = NULL;
-    UINT hint;
-    for (hint = 0; hint < num_names; hint++) {
-      if (ordinals[hint] == count) {
-        name = reinterpret_cast<LPCSTR>(RVAToAddr(names[hint]));
-        break;
-      }
-    }
-
-    if (name == NULL)
-      hint = 0;
-
-    // Check for forwarded exports.
-    LPCSTR forward = NULL;
-    if (reinterpret_cast<char*>(func) >= reinterpret_cast<char*>(directory) &&
-        reinterpret_cast<char*>(func) <= reinterpret_cast<char*>(directory) +
-            size) {
-      forward = reinterpret_cast<LPCSTR>(func);
-      func = 0;
-    }
-
-    if (!callback(*this, ordinal_base + count, hint, name, func, forward,
-                  cookie))
-      return false;
-  }
-
-  return true;
-}
-
-bool PEImage::EnumRelocs(EnumRelocsFunction callback, PVOID cookie) const {
-  PVOID directory = GetImageDirectoryEntryAddr(IMAGE_DIRECTORY_ENTRY_BASERELOC);
-  DWORD size = GetImageDirectoryEntrySize(IMAGE_DIRECTORY_ENTRY_BASERELOC);
-  PIMAGE_BASE_RELOCATION base = reinterpret_cast<PIMAGE_BASE_RELOCATION>(
-      directory);
-
-  if (directory == NULL || size < sizeof(IMAGE_BASE_RELOCATION))
-    return true;
-
-  while (base->SizeOfBlock) {
-    PWORD reloc = reinterpret_cast<PWORD>(base + 1);
-    UINT num_relocs = (base->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) /
-        sizeof(WORD);
-
-    for (UINT i = 0; i < num_relocs; i++, reloc++) {
-      WORD type = *reloc >> 12;
-      PVOID address = RVAToAddr(base->VirtualAddress + (*reloc & 0x0FFF));
-
-      if (!callback(*this, type, address, cookie))
-        return false;
-    }
-
-    base = reinterpret_cast<PIMAGE_BASE_RELOCATION>(
-               reinterpret_cast<char*>(base) + base->SizeOfBlock);
-  }
-
-  return true;
-}
-
-bool PEImage::EnumImportChunks(EnumImportChunksFunction callback,
-                               PVOID cookie) const {
-  DWORD size = GetImageDirectoryEntrySize(IMAGE_DIRECTORY_ENTRY_IMPORT);
-  PIMAGE_IMPORT_DESCRIPTOR import = GetFirstImportChunk();
-
-  if (import == NULL || size < sizeof(IMAGE_IMPORT_DESCRIPTOR))
-    return true;
-
-  for (; import->FirstThunk; import++) {
-    LPCSTR module_name = reinterpret_cast<LPCSTR>(RVAToAddr(import->Name));
-    PIMAGE_THUNK_DATA name_table = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                                       RVAToAddr(import->OriginalFirstThunk));
-    PIMAGE_THUNK_DATA iat = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                                RVAToAddr(import->FirstThunk));
-
-    if (!callback(*this, module_name, name_table, iat, cookie))
-      return false;
-  }
-
-  return true;
-}
-
-bool PEImage::EnumOneImportChunk(EnumImportsFunction callback,
-                                 LPCSTR module_name,
-                                 PIMAGE_THUNK_DATA name_table,
-                                 PIMAGE_THUNK_DATA iat, PVOID cookie) const {
-  if (NULL == name_table)
-    return false;
-
-  for (; name_table && name_table->u1.Ordinal; name_table++, iat++) {
-    LPCSTR name = NULL;
-    WORD ordinal = 0;
-    WORD hint = 0;
-
-    if (IMAGE_SNAP_BY_ORDINAL(name_table->u1.Ordinal)) {
-      ordinal = static_cast<WORD>(IMAGE_ORDINAL32(name_table->u1.Ordinal));
-    } else {
-      PIMAGE_IMPORT_BY_NAME import = reinterpret_cast<PIMAGE_IMPORT_BY_NAME>(
-          RVAToAddr(name_table->u1.ForwarderString));
-
-      hint = import->Hint;
-      name = reinterpret_cast<LPCSTR>(&import->Name);
-    }
-
-    if (!callback(*this, module_name, ordinal, name, hint, iat, cookie))
-      return false;
-  }
-
-  return true;
-}
-
-bool PEImage::EnumAllImports(EnumImportsFunction callback, PVOID cookie) const {
-  EnumAllImportsStorage temp = { callback, cookie };
-  return EnumImportChunks(ProcessImportChunk, &temp);
-}
-
-bool PEImage::EnumDelayImportChunks(EnumDelayImportChunksFunction callback,
-                                    PVOID cookie) const {
-  PVOID directory = GetImageDirectoryEntryAddr(
-                        IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT);
-  DWORD size = GetImageDirectoryEntrySize(IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT);
-  PImgDelayDescr delay_descriptor = reinterpret_cast<PImgDelayDescr>(directory);
-
-  if (directory == NULL || size == 0)
-    return true;
-
-  for (; delay_descriptor->rvaHmod; delay_descriptor++) {
-    PIMAGE_THUNK_DATA name_table;
-    PIMAGE_THUNK_DATA iat;
-    PIMAGE_THUNK_DATA bound_iat;    // address of the optional bound IAT
-    PIMAGE_THUNK_DATA unload_iat;   // address of optional copy of original IAT
-    LPCSTR module_name;
-
-    // check if VC7-style imports, using RVAs instead of
-    // VC6-style addresses.
-    bool rvas = (delay_descriptor->grAttrs & dlattrRva) != 0;
-
-    if (rvas) {
-      module_name = reinterpret_cast<LPCSTR>(
-                        RVAToAddr(delay_descriptor->rvaDLLName));
-      name_table = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                       RVAToAddr(delay_descriptor->rvaINT));
-      iat = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                RVAToAddr(delay_descriptor->rvaIAT));
-      bound_iat = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                      RVAToAddr(delay_descriptor->rvaBoundIAT));
-      unload_iat = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                       RVAToAddr(delay_descriptor->rvaUnloadIAT));
-    } else {
-#pragma warning(push)
-#pragma warning(disable: 4312)
-      // These casts generate warnings because they are 32 bit specific.
-      module_name = reinterpret_cast<LPCSTR>(delay_descriptor->rvaDLLName);
-      name_table = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                       delay_descriptor->rvaINT);
-      iat = reinterpret_cast<PIMAGE_THUNK_DATA>(delay_descriptor->rvaIAT);
-      bound_iat = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                      delay_descriptor->rvaBoundIAT);
-      unload_iat = reinterpret_cast<PIMAGE_THUNK_DATA>(
-                       delay_descriptor->rvaUnloadIAT);
-#pragma warning(pop)
-    }
-
-    if (!callback(*this, delay_descriptor, module_name, name_table, iat,
-                  bound_iat, unload_iat, cookie))
-      return false;
-  }
-
-  return true;
-}
-
-bool PEImage::EnumOneDelayImportChunk(EnumImportsFunction callback,
-                                      PImgDelayDescr delay_descriptor,
-                                      LPCSTR module_name,
-                                      PIMAGE_THUNK_DATA name_table,
-                                      PIMAGE_THUNK_DATA iat,
-                                      PIMAGE_THUNK_DATA bound_iat,
-                                      PIMAGE_THUNK_DATA unload_iat,
-                                      PVOID cookie) const {
-  UNREFERENCED_PARAMETER(bound_iat);
-  UNREFERENCED_PARAMETER(unload_iat);
-
-  for (; name_table->u1.Ordinal; name_table++, iat++) {
-    LPCSTR name = NULL;
-    WORD ordinal = 0;
-    WORD hint = 0;
-
-    if (IMAGE_SNAP_BY_ORDINAL(name_table->u1.Ordinal)) {
-      ordinal = static_cast<WORD>(IMAGE_ORDINAL32(name_table->u1.Ordinal));
-    } else {
-      PIMAGE_IMPORT_BY_NAME import;
-      bool rvas = (delay_descriptor->grAttrs & dlattrRva) != 0;
-
-      if (rvas) {
-        import = reinterpret_cast<PIMAGE_IMPORT_BY_NAME>(
-                     RVAToAddr(name_table->u1.ForwarderString));
-      } else {
-#pragma warning(push)
-#pragma warning(disable: 4312)
-        // This cast generates a warning because it is 32 bit specific.
-        import = reinterpret_cast<PIMAGE_IMPORT_BY_NAME>(
-                     name_table->u1.ForwarderString);
-#pragma warning(pop)
-      }
-
-      hint = import->Hint;
-      name = reinterpret_cast<LPCSTR>(&import->Name);
-    }
-
-    if (!callback(*this, module_name, ordinal, name, hint, iat, cookie))
-      return false;
-  }
-
-  return true;
-}
-
-bool PEImage::EnumAllDelayImports(EnumImportsFunction callback,
-                                  PVOID cookie) const {
-  EnumAllImportsStorage temp = { callback, cookie };
-  return EnumDelayImportChunks(ProcessDelayImportChunk, &temp);
-}
-
-bool PEImage::VerifyMagic() const {
-  PIMAGE_DOS_HEADER dos_header = GetDosHeader();
-
-  if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
-    return false;
-
-  PIMAGE_NT_HEADERS nt_headers = GetNTHeaders();
-
-  if (nt_headers->Signature != IMAGE_NT_SIGNATURE)
-    return false;
-
-  if (nt_headers->FileHeader.SizeOfOptionalHeader !=
-      sizeof(IMAGE_OPTIONAL_HEADER))
-    return false;
-
-  if (nt_headers->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC)
-    return false;
-
-  return true;
-}
-
-bool PEImage::ImageRVAToOnDiskOffset(DWORD rva, DWORD *on_disk_offset) const {
-  LPVOID address = RVAToAddr(rva);
-  return ImageAddrToOnDiskOffset(address, on_disk_offset);
-}
-
-bool PEImage::ImageAddrToOnDiskOffset(LPVOID address,
-                                      DWORD *on_disk_offset) const {
-  if (NULL == address)
-    return false;
-
-  // Get the section that this address belongs to.
-  PIMAGE_SECTION_HEADER section_header = GetImageSectionFromAddr(address);
-  if (NULL == section_header)
-    return false;
-
-#pragma warning(push)
-#pragma warning(disable: 4311)
-  // These casts generate warnings because they are 32 bit specific.
-  // Don't follow the virtual RVAToAddr, use the one on the base.
-  DWORD offset_within_section = reinterpret_cast<DWORD>(address) -
-                                    reinterpret_cast<DWORD>(PEImage::RVAToAddr(
-                                        section_header->VirtualAddress));
-#pragma warning(pop)
-
-  *on_disk_offset = section_header->PointerToRawData + offset_within_section;
-  return true;
-}
-
-PVOID PEImage::RVAToAddr(DWORD_PTR rva) const {
-  if (rva == 0)
-    return NULL;
-
-  return reinterpret_cast<char*>(module_) + rva;
-}
-
-PVOID PEImageAsData::RVAToAddr(DWORD_PTR rva) const {
-  if (rva == 0)
-    return NULL;
-
-  PVOID in_memory = PEImage::RVAToAddr(rva);
-  DWORD dummy;
-
-  if (!ImageAddrToOnDiskOffset(in_memory, &dummy))
-    return NULL;
-
-  return in_memory;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/pe_image.h
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This file was adapted from GreenBorder's Code.
-// To understand what this class is about (for other than well known functions
-// as GetProcAddress), a good starting point is "An In-Depth Look into the
-// Win32 Portable Executable File Format" by Matt Pietrek:
-// http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx
-
-#ifndef BASE_PE_IMAGE_H_
-#define BASE_PE_IMAGE_H_
-
-#include <windows.h>
-#include <DelayIMP.h>
-
-// This class is a wrapper for the Portable Executable File Format (PE).
-// It's main purpose is to provide an easy way to work with imports and exports
-// from a file, mapped in memory as image.
-class PEImage {
- public:
-  // Callback to enumerate sections.
-  // cookie is the value passed to the enumerate method.
-  // Returns true to continue the enumeration.
-  typedef bool (*EnumSectionsFunction)(const PEImage &image,
-                                       PIMAGE_SECTION_HEADER header,
-                                       PVOID section_start, DWORD section_size,
-                                       PVOID cookie);
-
-  // Callback to enumerate exports.
-  // function is the actual address of the symbol. If forward is not null, it
-  // contains the dll and symbol to forward this export to. cookie is the value
-  // passed to the enumerate method.
-  // Returns true to continue the enumeration.
-  typedef bool (*EnumExportsFunction)(const PEImage &image, DWORD ordinal,
-                                      DWORD hint, LPCSTR name, PVOID function,
-                                      LPCSTR forward, PVOID cookie);
-
-  // Callback to enumerate import blocks.
-  // name_table and iat point to the imports name table and address table for
-  // this block. cookie is the value passed to the enumerate method.
-  // Returns true to continue the enumeration.
-  typedef bool (*EnumImportChunksFunction)(const PEImage &image, LPCSTR module,
-                                           PIMAGE_THUNK_DATA name_table,
-                                           PIMAGE_THUNK_DATA iat, PVOID cookie);
-
-  // Callback to enumerate imports.
-  // module is the dll that exports this symbol. cookie is the value passed to
-  // the enumerate method.
-  // Returns true to continue the enumeration.
-  typedef bool (*EnumImportsFunction)(const PEImage &image, LPCSTR module,
-                                      DWORD ordinal, LPCSTR name, DWORD hint,
-                                      PIMAGE_THUNK_DATA iat, PVOID cookie);
-
-  // Callback to enumerate dalayed import blocks.
-  // module is the dll that exports this block of symbols. cookie is the value
-  // passed to the enumerate method.
-  // Returns true to continue the enumeration.
-  typedef bool (*EnumDelayImportChunksFunction)(const PEImage &image,
-                                                PImgDelayDescr delay_descriptor,
-                                                LPCSTR module,
-                                                PIMAGE_THUNK_DATA name_table,
-                                                PIMAGE_THUNK_DATA iat,
-                                                PIMAGE_THUNK_DATA bound_iat,
-                                                PIMAGE_THUNK_DATA unload_iat,
-                                                PVOID cookie);
-
-  // Callback to enumerate relocations.
-  // cookie is the value passed to the enumerate method.
-  // Returns true to continue the enumeration.
-  typedef bool (*EnumRelocsFunction)(const PEImage &image, WORD type,
-                                     PVOID address, PVOID cookie);
-
-  explicit PEImage(HMODULE module) : module_(module) {}
-  explicit PEImage(const void* module) {
-    module_ = reinterpret_cast<HMODULE>(const_cast<void*>(module));
-  }
-
-  // Gets the HMODULE for this object.
-  HMODULE module() const;
-
-  // Sets this object's HMODULE.
-  void set_module(HMODULE module);
-
-  // Checks if this symbol is actually an ordinal.
-  static bool IsOrdinal(LPCSTR name);
-
-  // Converts a named symbol to the corresponding ordinal.
-  static WORD ToOrdinal(LPCSTR name);
-
-  // Returns the DOS_HEADER for this PE.
-  PIMAGE_DOS_HEADER GetDosHeader() const;
-
-  // Returns the NT_HEADER for this PE.
-  PIMAGE_NT_HEADERS GetNTHeaders() const;
-
-  // Returns number of sections of this PE.
-  WORD GetNumSections() const;
-
-  // Returns the header for a given section.
-  // returns NULL if there is no such section.
-  PIMAGE_SECTION_HEADER GetSectionHeader(UINT section) const;
-
-  // Returns the size of a given directory entry.
-  DWORD GetImageDirectoryEntrySize(UINT directory) const;
-
-  // Returns the address of a given directory entry.
-  PVOID GetImageDirectoryEntryAddr(UINT directory) const;
-
-  // Returns the section header for a given address.
-  // Use: s = image.GetImageSectionFromAddr(a);
-  // Post: 's' is the section header of the section that contains 'a'
-  //       or NULL if there is no such section.
-  PIMAGE_SECTION_HEADER GetImageSectionFromAddr(PVOID address) const;
-
-  // Returns the section header for a given section.
-  PIMAGE_SECTION_HEADER GetImageSectionHeaderByName(LPCSTR section_name) const;
-
-  // Returns the first block of imports.
-  PIMAGE_IMPORT_DESCRIPTOR GetFirstImportChunk() const;
-
-  // Returns the exports directory.
-  PIMAGE_EXPORT_DIRECTORY GetExportDirectory() const;
-
-  // Returns a given export entry.
-  // Use: e = image.GetExportEntry(f);
-  // Pre: 'f' is either a zero terminated string or ordinal
-  // Post: 'e' is a pointer to the export directory entry
-  //       that contains 'f's export RVA, or NULL if 'f'
-  //       is not exported from this image
-  PDWORD GetExportEntry(LPCSTR name) const;
-
-  // Returns the address for a given exported symbol.
-  // Use: p = image.GetProcAddress(f);
-  // Pre: 'f' is either a zero terminated string or ordinal.
-  // Post: if 'f' is a non-forwarded export from image, 'p' is
-  //       the exported function. If 'f' is a forwarded export
-  //       then p is the special value 0xFFFFFFFF. In this case
-  //       RVAToAddr(*GetExportEntry) can be used to resolve
-  //       the string that describes the forward.
-  FARPROC GetProcAddress(LPCSTR function_name) const;
-
-  // Retrieves the ordinal for a given exported symbol.
-  // Returns true if the symbol was found.
-  bool GetProcOrdinal(LPCSTR function_name, WORD *ordinal) const;
-
-  // Enumerates PE sections.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumSections(EnumSectionsFunction callback, PVOID cookie) const;
-
-  // Enumerates PE exports.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumExports(EnumExportsFunction callback, PVOID cookie) const;
-
-  // Enumerates PE imports.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumAllImports(EnumImportsFunction callback, PVOID cookie) const;
-
-  // Enumerates PE import blocks.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumImportChunks(EnumImportChunksFunction callback, PVOID cookie) const;
-
-  // Enumerates the imports from a single PE import block.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumOneImportChunk(EnumImportsFunction callback, LPCSTR module_name,
-                          PIMAGE_THUNK_DATA name_table, PIMAGE_THUNK_DATA iat,
-                          PVOID cookie) const;
-
-
-  // Enumerates PE delay imports.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumAllDelayImports(EnumImportsFunction callback, PVOID cookie) const;
-
-  // Enumerates PE delay import blocks.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumDelayImportChunks(EnumDelayImportChunksFunction callback,
-                             PVOID cookie) const;
-
-  // Enumerates imports from a single PE delay import block.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumOneDelayImportChunk(EnumImportsFunction callback,
-                               PImgDelayDescr delay_descriptor,
-                               LPCSTR module_name,
-                               PIMAGE_THUNK_DATA name_table,
-                               PIMAGE_THUNK_DATA iat,
-                               PIMAGE_THUNK_DATA bound_iat,
-                               PIMAGE_THUNK_DATA unload_iat,
-                               PVOID cookie) const;
-
-  // Enumerates PE relocation entries.
-  // cookie is a generic cookie to pass to the callback.
-  // Returns true on success.
-  bool EnumRelocs(EnumRelocsFunction callback, PVOID cookie) const;
-
-  // Verifies the magic values on the PE file.
-  // Returns true if all values are correct.
-  bool VerifyMagic() const;
-
-  // Converts an rva value to the appropriate address.
-  virtual PVOID RVAToAddr(DWORD_PTR rva) const;
-
-  // Converts an rva value to an offset on disk.
-  // Returns true on success.
-  bool ImageRVAToOnDiskOffset(DWORD rva, DWORD *on_disk_offset) const;
-
-  // Converts an address to an offset on disk.
-  // Returns true on success.
-  bool ImageAddrToOnDiskOffset(LPVOID address, DWORD *on_disk_offset) const;
-
- private:
-  HMODULE module_;
-};
-
-// This class is an extension to the PEImage class that allows working with PE
-// files mapped as data instead of as image file.
-class PEImageAsData : public PEImage {
- public:
-  explicit PEImageAsData(HMODULE hModule) : PEImage(hModule) {}
-
-  virtual PVOID RVAToAddr(DWORD_PTR rva) const;
-};
-
-inline bool PEImage::IsOrdinal(LPCSTR name) {
-#pragma warning(push)
-#pragma warning(disable: 4311)
-  // This cast generates a warning because it is 32 bit specific.
-  return reinterpret_cast<DWORD>(name) <= 0xFFFF;
-#pragma warning(pop)
-}
-
-inline WORD PEImage::ToOrdinal(LPCSTR name) {
-  return reinterpret_cast<WORD>(name);
-}
-
-inline HMODULE PEImage::module() const {
-  return module_;
-}
-
-inline PIMAGE_IMPORT_DESCRIPTOR PEImage::GetFirstImportChunk() const {
-  return reinterpret_cast<PIMAGE_IMPORT_DESCRIPTOR>(
-             GetImageDirectoryEntryAddr(IMAGE_DIRECTORY_ENTRY_IMPORT));
-}
-
-inline PIMAGE_EXPORT_DIRECTORY PEImage::GetExportDirectory() const {
-  return reinterpret_cast<PIMAGE_EXPORT_DIRECTORY>(
-             GetImageDirectoryEntryAddr(IMAGE_DIRECTORY_ENTRY_EXPORT));
-}
-
-#endif  // BASE_PE_IMAGE_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/perf_test_suite.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_PERF_TEST_SUITE_H_
-#define BASE_PERF_TEST_SUITE_H_
-
-#include "base/command_line.h"
-#include "base/debug_util.h"
-#include "base/file_path.h"
-#include "base/perftimer.h"
-#include "base/process_util.h"
-#include "base/string_util.h"
-#include "base/test_suite.h"
-
-class PerfTestSuite : public TestSuite {
- public:
-  PerfTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
-  }
-
-  virtual void Initialize() {
-    TestSuite::Initialize();
-
-    // Initialize the perf timer log
-    FilePath log_path;
-    std::wstring log_file =
-        CommandLine::ForCurrentProcess()->GetSwitchValue(L"log-file");
-    if (log_file.empty()) {
-      FilePath exe;
-      PathService::Get(base::FILE_EXE, &exe);
-      log_path = exe.ReplaceExtension(FILE_PATH_LITERAL("log"));
-      log_path = log_path.InsertBeforeExtension(FILE_PATH_LITERAL("_perf"));
-    } else {
-      log_path = FilePath::FromWStringHack(log_file);
-    }
-    ASSERT_TRUE(InitPerfLog(log_path));
-
-    // Raise to high priority to have more precise measurements. Since we don't
-    // aim at 1% precision, it is not necessary to run at realtime level.
-    if (!DebugUtil::BeingDebugged())
-      base::RaiseProcessToHighPriority();
-  }
-
-  virtual void Shutdown() {
-    TestSuite::Shutdown();
-
-    FinalizePerfLog();
-  }
-};
-
-#endif  // BASE_PERF_TEST_SUITE_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/perftimer.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/perftimer.h"
-
-#include <stdio.h>
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/file_path.h"
-#include "base/file_util.h"
-#include "base/logging.h"
-
-static FILE* perf_log_file = NULL;
-
-bool InitPerfLog(const FilePath& log_file) {
-  if (perf_log_file) {
-    // trying to initialize twice
-    NOTREACHED();
-    return false;
-  }
-
-  perf_log_file = file_util::OpenFile(log_file, "w");
-  return perf_log_file != NULL;
-}
-
-void FinalizePerfLog() {
-  if (!perf_log_file) {
-    // trying to cleanup without initializing
-    NOTREACHED();
-    return;
-  }
-  file_util::CloseFile(perf_log_file);
-}
-
-void LogPerfResult(const char* test_name, double value, const char* units) {
-  if (!perf_log_file) {
-    NOTREACHED();
-    return;
-  }
-
-  fprintf(perf_log_file, "%s\t%g\t%s\n", test_name, value, units);
-  printf("%s\t%g\t%s\n", test_name, value, units);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/perftimer.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_PERFTIMER_H_
-#define BASE_PERFTIMER_H_
-
-#include <string>
-#include "base/basictypes.h"
-#include "base/file_path.h"
-#include "base/time.h"
-
-// ----------------------------------------------------------------------
-// Initializes and finalizes the perf log. These functions should be
-// called at the beginning and end (respectively) of running all the
-// performance tests. The init function returns true on success.
-// ----------------------------------------------------------------------
-bool InitPerfLog(const FilePath& log_path);
-void FinalizePerfLog();
-
-// ----------------------------------------------------------------------
-// LogPerfResult
-//   Writes to the perf result log the given 'value' resulting from the
-//   named 'test'. The units are to aid in reading the log by people.
-// ----------------------------------------------------------------------
-void LogPerfResult(const char* test_name, double value, const char* units);
-
-// ----------------------------------------------------------------------
-// PerfTimer
-//   A simple wrapper around Now()
-// ----------------------------------------------------------------------
-class PerfTimer {
- public:
-  PerfTimer() {
-    begin_ = base::TimeTicks::Now();
-  }
-
-  // Returns the time elapsed since object construction
-  base::TimeDelta Elapsed() const {
-    return base::TimeTicks::Now() - begin_;
-  }
-
- private:
-  base::TimeTicks begin_;
-};
-
-// ----------------------------------------------------------------------
-// PerfTimeLogger
-//   Automates calling LogPerfResult for the common case where you want
-//   to measure the time that something took. Call Done() when the test
-//   is complete if you do extra work after the test or there are stack
-//   objects with potentially expensive constructors. Otherwise, this
-//   class with automatically log on destruction.
-// ----------------------------------------------------------------------
-class PerfTimeLogger {
- public:
-  explicit PerfTimeLogger(const char* test_name)
-      : logged_(false),
-        test_name_(test_name) {
-  }
-
-  ~PerfTimeLogger() {
-    if (!logged_)
-      Done();
-  }
-
-  void Done() {
-    // we use a floating-point millisecond value because it is more
-    // intuitive than microseconds and we want more precision than
-    // integer milliseconds
-    LogPerfResult(test_name_.c_str(), timer_.Elapsed().InMillisecondsF(), "ms");
-    logged_ = true;
-  }
-
- private:
-  bool logged_;
-  std::string test_name_;
-  PerfTimer timer_;
-};
-
-#endif  // BASE_PERFTIMER_H_
--- a/ipc/chromium/src/base/process_util.h
+++ b/ipc/chromium/src/base/process_util.h
@@ -255,25 +255,16 @@ bool WaitForExitCode(ProcessHandle handl
 // Wait for all the processes based on the named executable to exit.  If filter
 // is non-null, then only processes selected by the filter are waited on.
 // Returns after all processes have exited or wait_milliseconds have expired.
 // Returns true if all the processes exited, false otherwise.
 bool WaitForProcessesToExit(const std::wstring& executable_name,
                             int wait_milliseconds,
                             const ProcessFilter* filter);
 
-// Wait for a single process to exit. Return true if it exited cleanly within
-// the given time limit.
-bool WaitForSingleProcess(ProcessHandle handle,
-                          int wait_milliseconds);
-
-// Returns true when |wait_milliseconds| have elapsed and the process
-// is still running.
-bool CrashAwareSleep(ProcessHandle handle, int wait_milliseconds);
-
 // Waits a certain amount of time (can be 0) for all the processes with a given
 // executable name to exit, then kills off any of them that are still around.
 // If filter is non-null, then only processes selected by the filter are waited
 // on.  Killed processes are ended with the given exit code.  Returns false if
 // any processes needed to be killed, true if they all exited cleanly within
 // the wait_milliseconds delay.
 bool CleanupProcesses(const std::wstring& executable_name,
                       int wait_milliseconds,
@@ -393,62 +384,33 @@ class ProcessMetrics {
   size_t GetPrivateBytes() const;
   // Fills a CommittedKBytes with both resident and paged
   // memory usage as per definition of CommittedBytes.
   void GetCommittedKBytes(CommittedKBytes* usage) const;
   // Fills a WorkingSetKBytes containing resident private and shared memory
   // usage in bytes, as per definition of WorkingSetBytes.
   bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const;
 
-  // Computes the current process available memory for allocation.
-  // It does a linear scan of the address space querying each memory region
-  // for its free (unallocated) status. It is useful for estimating the memory
-  // load and fragmentation.
-  bool CalculateFreeMemory(FreeMBytes* free) const;
-
   // Returns the CPU usage in percent since the last time this method was
   // called. The first time this method is called it returns 0 and will return
   // the actual CPU info on subsequent calls.
   // Note that on multi-processor machines, the CPU usage value is for all
   // CPUs. So if you have 2 CPUs and your process is using all the cycles
   // of 1 CPU and not the other CPU, this method returns 50.
   int GetCPUUsage();
 
-  // Retrieves accounting information for all I/O operations performed by the
-  // process.
-  // If IO information is retrieved successfully, the function returns true
-  // and fills in the IO_COUNTERS passed in. The function returns false
-  // otherwise.
-  bool GetIOCounters(IoCounters* io_counters) const;
-
  private:
   explicit ProcessMetrics(ProcessHandle process);
 
   ProcessHandle process_;
 
   int processor_count_;
 
   // Used to store the previous times so we can compute the CPU usage.
   int64_t last_time_;
   int64_t last_system_time_;
 
   DISALLOW_EVIL_CONSTRUCTORS(ProcessMetrics);
 };
 
-// Enables low fragmentation heap (LFH) for every heaps of this process. This
-// won't have any effect on heaps created after this function call. It will not
-// modify data allocated in the heaps before calling this function. So it is
-// better to call this function early in initialization and again before
-// entering the main loop.
-// Note: Returns true on Windows 2000 without doing anything.
-bool EnableLowFragmentationHeap();
-
-// Enable 'terminate on heap corruption' flag. Helps protect against heap
-// overflow. Has no effect if the OS doesn't provide the necessary facility.
-void EnableTerminationOnHeapCorruption();
-
-// If supported on the platform, and the user has sufficent rights, increase
-// the current process's scheduling priority to a high priority.
-void RaiseProcessToHighPriority();
-
 }  // namespace base
 
 #endif  // BASE_PROCESS_UTIL_H_
--- a/ipc/chromium/src/base/process_util_bsd.cc
+++ b/ipc/chromium/src/base/process_util_bsd.cc
@@ -366,13 +366,9 @@ NamedProcessIterator::NamedProcessIterat
 NamedProcessIterator::~NamedProcessIterator() {
 }
 
 const ProcessEntry* NamedProcessIterator::NextProcessEntry() {
   if (nextEntry >= content.size()) return NULL;
   return &content[nextEntry++];
 }
 
-bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
-  return false;
-}
-
 }  // namespace base
--- a/ipc/chromium/src/base/process_util_linux.cc
+++ b/ipc/chromium/src/base/process_util_linux.cc
@@ -432,46 +432,9 @@ bool NamedProcessIterator::IncludeEntry(
   // TODO(port): make this also work for non-ASCII filenames
   if (WideToASCII(executable_name_) != entry_.szExeFile)
     return false;
   if (!filter_)
     return true;
   return filter_->Includes(entry_.pid, entry_.ppid);
 }
 
-// To have /proc/self/io file you must enable CONFIG_TASK_IO_ACCOUNTING
-// in your kernel configuration.
-bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
-  std::string proc_io_contents;
-  if (!file_util::ReadFileToString(L"/proc/self/io", &proc_io_contents))
-    return false;
-
-  (*io_counters).OtherOperationCount = 0;
-  (*io_counters).OtherTransferCount = 0;
-
-  StringTokenizer tokenizer(proc_io_contents, ": \n");
-  ParsingState state = KEY_NAME;
-  std::string last_key_name;
-  while (tokenizer.GetNext()) {
-    switch (state) {
-      case KEY_NAME:
-        last_key_name = tokenizer.token();
-        state = KEY_VALUE;
-        break;
-      case KEY_VALUE:
-        DCHECK(!last_key_name.empty());
-        if (last_key_name == "syscr") {
-          (*io_counters).ReadOperationCount = StringToInt64(tokenizer.token());
-        } else if (last_key_name == "syscw") {
-          (*io_counters).WriteOperationCount = StringToInt64(tokenizer.token());
-        } else if (last_key_name == "rchar") {
-          (*io_counters).ReadTransferCount = StringToInt64(tokenizer.token());
-        } else if (last_key_name == "wchar") {
-          (*io_counters).WriteTransferCount = StringToInt64(tokenizer.token());
-        }
-        state = KEY_NAME;
-        break;
-    }
-  }
-  return true;
-}
-
 }  // namespace base
--- a/ipc/chromium/src/base/process_util_mac.mm
+++ b/ipc/chromium/src/base/process_util_mac.mm
@@ -321,15 +321,9 @@ bool NamedProcessIterator::CheckForNextP
 
 bool NamedProcessIterator::IncludeEntry() {
   // Don't need to check the name, we did that w/in CheckForNextProcess.
   if (!filter_)
     return true;
   return filter_->Includes(entry_.pid, entry_.ppid);
 }
 
-bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
-  // TODO(pinkerton): can we implement this? On linux it relies on /proc.
-  NOTIMPLEMENTED();
-  return false;
-}
-
 }  // namespace base
--- a/ipc/chromium/src/base/process_util_posix.cc
+++ b/ipc/chromium/src/base/process_util_posix.cc
@@ -239,25 +239,16 @@ ProcessMetrics::ProcessMetrics(ProcessHa
 
 // static
 ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) {
   return new ProcessMetrics(process);
 }
 
 ProcessMetrics::~ProcessMetrics() { }
 
-void EnableTerminationOnHeapCorruption() {
-  // On POSIX, there nothing to do AFAIK.
-}
-
-void RaiseProcessToHighPriority() {
-  // On POSIX, we don't actually do anything here.  We could try to nice() or
-  // setpriority() or sched_getscheduler, but these all require extra rights.
-}
-
 bool DidProcessCrash(bool* child_exited, ProcessHandle handle) {
   int status;
   const int result = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
   if (result == -1) {
     LOG(ERROR) << "waitpid failed pid:" << handle << " errno:" << errno;
     if (child_exited)
       *child_exited = false;
     return false;
@@ -303,101 +294,16 @@ bool WaitForExitCode(ProcessHandle handl
 
   // If it didn't exit cleanly, it must have been signaled.
   DCHECK(WIFSIGNALED(status));
   return false;
 }
 
 namespace {
 
-int WaitpidWithTimeout(ProcessHandle handle, int wait_milliseconds,
-                       bool* success) {
-  // This POSIX version of this function only guarantees that we wait no less
-  // than |wait_milliseconds| for the proces to exit.  The child process may
-  // exit sometime before the timeout has ended but we may still block for
-  // up to 0.25 seconds after the fact.
-  //
-  // waitpid() has no direct support on POSIX for specifying a timeout, you can
-  // either ask it to block indefinitely or return immediately (WNOHANG).
-  // When a child process terminates a SIGCHLD signal is sent to the parent.
-  // Catching this signal would involve installing a signal handler which may
-  // affect other parts of the application and would be difficult to debug.
-  //
-  // Our strategy is to call waitpid() once up front to check if the process
-  // has already exited, otherwise to loop for wait_milliseconds, sleeping for
-  // at most 0.25 secs each time using usleep() and then calling waitpid().
-  //
-  // usleep() is speced to exit if a signal is received for which a handler
-  // has been installed.  This means that when a SIGCHLD is sent, it will exit
-  // depending on behavior external to this function.
-  //
-  // This function is used primarily for unit tests, if we want to use it in
-  // the application itself it would probably be best to examine other routes.
-  int status = -1;
-  pid_t ret_pid = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
-  static const int64_t kQuarterSecondInMicroseconds = kMicrosecondsPerSecond/4;
-
-  // If the process hasn't exited yet, then sleep and try again.
-  Time wakeup_time = Time::Now() + TimeDelta::FromMilliseconds(
-      wait_milliseconds);
-  while (ret_pid == 0) {
-    Time now = Time::Now();
-    if (now > wakeup_time)
-      break;
-    // Guaranteed to be non-negative!
-    int64_t sleep_time_usecs = (wakeup_time - now).InMicroseconds();
-    // Don't sleep for more than 0.25 secs at a time.
-    if (sleep_time_usecs > kQuarterSecondInMicroseconds) {
-      sleep_time_usecs = kQuarterSecondInMicroseconds;
-    }
-
-    // usleep() will return 0 and set errno to EINTR on receipt of a signal
-    // such as SIGCHLD.
-    usleep(sleep_time_usecs);
-    ret_pid = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
-  }
-
-  if (success)
-    *success = (ret_pid != -1);
-
-  return status;
-}
-
-}  // namespace
-
-bool WaitForSingleProcess(ProcessHandle handle, int wait_milliseconds) {
-  bool waitpid_success;
-  int status;
-  if (wait_milliseconds == base::kNoTimeout)
-    waitpid_success = (HANDLE_EINTR(waitpid(handle, &status, 0)) != -1);
-  else
-    status = WaitpidWithTimeout(handle, wait_milliseconds, &waitpid_success);
-  if (status != -1) {
-    DCHECK(waitpid_success);
-    return WIFEXITED(status);
-  } else {
-    return false;
-  }
-}
-
-bool CrashAwareSleep(ProcessHandle handle, int wait_milliseconds) {
-  bool waitpid_success;
-  int status = WaitpidWithTimeout(handle, wait_milliseconds, &waitpid_success);
-  if (status != -1) {
-    DCHECK(waitpid_success);
-    return !(WIFEXITED(status) || WIFSIGNALED(status));
-  } else {
-    // If waitpid returned with an error, then the process doesn't exist
-    // (which most probably means it didn't exist before our call).
-    return waitpid_success;
-  }
-}
-
-namespace {
-
 int64_t TimeValToMicroseconds(const struct timeval& tv) {
   return tv.tv_sec * kMicrosecondsPerSecond + tv.tv_usec;
 }
 
 }
 
 int ProcessMetrics::GetCPUUsage() {
   struct timeval now;
--- a/ipc/chromium/src/base/process_util_win.cc
+++ b/ipc/chromium/src/base/process_util_win.cc
@@ -596,26 +596,16 @@ bool WaitForProcessesToExit(const std::w
     DWORD wait_result = WaitForSingleObject(process, remaining_wait);
     CloseHandle(process);
     result = result && (wait_result == WAIT_OBJECT_0);
   }
 
   return result;
 }
 
-bool WaitForSingleProcess(ProcessHandle handle, int wait_milliseconds) {
-  bool retval = WaitForSingleObject(handle, wait_milliseconds) == WAIT_OBJECT_0;
-  return retval;
-}
-
-bool CrashAwareSleep(ProcessHandle handle, int wait_milliseconds) {
-  bool retval = WaitForSingleObject(handle, wait_milliseconds) == WAIT_TIMEOUT;
-  return retval;
-}
-
 bool CleanupProcesses(const std::wstring& executable_name,
                       int wait_milliseconds,
                       int exit_code,
                       const ProcessFilter* filter) {
   bool exited_cleanly = WaitForProcessesToExit(executable_name,
                                                wait_milliseconds,
                                                filter);
   if (!exited_cleanly)
@@ -831,83 +821,9 @@ int ProcessMetrics::GetCPUUsage() {
                              time_delta);
 
   last_system_time_ = system_time;
   last_time_ = time;
 
   return cpu;
 }
 
-bool ProcessMetrics::GetIOCounters(IO_COUNTERS* io_counters) const {
-  return GetProcessIoCounters(process_, io_counters) != FALSE;
-}
-
-bool ProcessMetrics::CalculateFreeMemory(FreeMBytes* free) const {
-  const SIZE_T kTopAdress = 0x7F000000;
-  const SIZE_T kMegabyte = 1024 * 1024;
-  SIZE_T accumulated = 0;
-
-  MEMORY_BASIC_INFORMATION largest = {0};
-  UINT_PTR scan = 0;
-  while (scan < kTopAdress) {
-    MEMORY_BASIC_INFORMATION info;
-    if (!::VirtualQueryEx(process_, reinterpret_cast<void*>(scan),
-                          &info, sizeof(info)))
-      return false;
-    if (info.State == MEM_FREE) {
-      accumulated += info.RegionSize;
-      UINT_PTR end = scan + info.RegionSize;
-      if (info.RegionSize > (largest.RegionSize))
-        largest = info;
-    }
-    scan += info.RegionSize;
-  }
-  free->largest = largest.RegionSize / kMegabyte;
-  free->largest_ptr = largest.BaseAddress;
-  free->total = accumulated / kMegabyte;
-  return true;
-}
-
-bool EnableLowFragmentationHeap() {
-  HMODULE kernel32 = GetModuleHandle(L"kernel32.dll");
-  HeapSetFn heap_set = reinterpret_cast<HeapSetFn>(GetProcAddress(
-      kernel32,
-      "HeapSetInformation"));
-
-  // On Windows 2000, the function is not exported. This is not a reason to
-  // fail.
-  if (!heap_set)
-    return true;
-
-  unsigned number_heaps = GetProcessHeaps(0, NULL);
-  if (!number_heaps)
-    return false;
-
-  // Gives us some extra space in the array in case a thread is creating heaps
-  // at the same time we're querying them.
-  static const int MARGIN = 8;
-  scoped_array<HANDLE> heaps(new HANDLE[number_heaps + MARGIN]);
-  number_heaps = GetProcessHeaps(number_heaps + MARGIN, heaps.get());
-  if (!number_heaps)
-    return false;
-
-  for (unsigned i = 0; i < number_heaps; ++i) {
-    ULONG lfh_flag = 2;
-    // Don't bother with the result code. It may fails on heaps that have the
-    // HEAP_NO_SERIALIZE flag. This is expected and not a problem at all.
-    heap_set(heaps[i],
-             HeapCompatibilityInformation,
-             &lfh_flag,
-             sizeof(lfh_flag));
-  }
-  return true;
-}
-
-void EnableTerminationOnHeapCorruption() {
-  // Ignore the result code. Supported on XP SP3 and Vista.
-  HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
-}
-
-void RaiseProcessToHighPriority() {
-  SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
-}
-
 }  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/profiler.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2009 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 "base/profiler.h"
-#include "base/string_util.h"
-
-// When actually using quantify, uncomment the following line.
-//#define QUANTIFY
-
-#ifdef QUANTIFY
-// this #define is used to prevent people from directly using pure.h
-// instead of profiler.h
-#define PURIFY_PRIVATE_INCLUDE
-#include "base/third_party/purify/pure.h"
-#endif // QUANTIFY
-
-namespace base {
-
-void Profiler::StartRecording() {
-#ifdef QUANTIFY
-  QuantifyStartRecordingData();
-#endif
-}
-
-void Profiler::StopRecording() {
-#ifdef QUANTIFY
-  QuantifyStopRecordingData();
-#endif
-}
-
-void Profiler::ClearData() {
-#ifdef QUANTIFY
-  QuantifyClearData();
-#endif
-}
-
-void Profiler::SetThreadName(const char *name) {
-#ifdef QUANTIFY
-  // make a copy since the Quantify function takes a char*, not const char*
-  char buffer[512];
-  base::snprintf(buffer, sizeof(buffer)-1, "%s", name);
-  QuantifySetThreadName(buffer);
-#endif
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/profiler.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2009 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.
-
-// An abstraction for functions used to control execution time profiling.
-// All methods are effectively no-ops unless this program is being run through
-// a supported tool (currently only Quantify, a companion tool to Purify)
-
-#ifndef BASE_PROFILER_H__
-#define BASE_PROFILER_H__
-
-#include "base/basictypes.h"
-
-namespace base {
-
-class Profiler {
- public:
-  // Starts or resumes recording.
-  static void StartRecording();
-
-  // Stops recording until StartRecording is called or the program exits.
-  static void StopRecording();
-
-  // Throw away data collected so far. This can be useful to call before
-  // your first call to StartRecording, for instance to avoid counting any
-  // time in application startup.
-  static void ClearData();
-
-  // Sets the name of the current thread for display in the profiler's UI.
-  static void SetThreadName(const char *name);
-
- private:
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Profiler);
-};
-
-}  // namespace base
-
-#endif  // BASE_PROFILER_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/resource_util.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/logging.h"
-#include "base/resource_util.h"
-
-namespace base {
-bool GetDataResourceFromModule(HMODULE module, int resource_id,
-                               void** data, size_t* length) {
-  if (!module)
-    return false;
-
-  if (!IS_INTRESOURCE(resource_id)) {
-    NOTREACHED();
-    return false;
-  }
-
-  HRSRC hres_info = FindResource(module, MAKEINTRESOURCE(resource_id),
-                                 L"BINDATA");
-  if (NULL == hres_info)
-    return false;
-
-  DWORD data_size = SizeofResource(module, hres_info);
-  HGLOBAL hres = LoadResource(module, hres_info);
-  if (!hres)
-    return false;
-
-  void* resource = LockResource(hres);
-  if (!resource)
-    return false;
-
-  *data = resource;
-  *length = static_cast<size_t>(data_size);
-  return true;
-}
-}  // namespace
deleted file mode 100644
--- a/ipc/chromium/src/base/resource_util.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This file contains utility functions for accessing resources in external
-// files (DLLs) or embedded in the executable itself.
-
-#ifndef BASE_RESOURCE_UTIL_H__
-#define BASE_RESOURCE_UTIL_H__
-
-#include <windows.h>
-#include <string>
-
-#include "base/basictypes.h"
-
-namespace base {
-// Function for getting a data resource (BINDATA) from a dll.  Some
-// resources are optional, especially in unit tests, so this returns false
-// but doesn't raise an error if the resource can't be loaded.
-bool GetDataResourceFromModule(HMODULE module, int resource_id,
-                               void** data, size_t* length);
-}  // namespace
-
-#endif // BASE_RESOURCE_UTIL_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/run_all_perftests.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/perf_test_suite.h"
-
-int main(int argc, char** argv) {
-  return PerfTestSuite(argc, argv).Run();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/run_all_unittests.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/test_suite.h"
-
-int main(int argc, char** argv) {
-  return TestSuite(argc, argv).Run();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_bstr_win.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2006-2008 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 "base/scoped_bstr_win.h"
-
-#include "base/logging.h"
-
-
-ScopedBstr::ScopedBstr(const wchar_t* non_bstr)
-    : bstr_(SysAllocString(non_bstr)) {
-}
-
-ScopedBstr::~ScopedBstr() {
-  COMPILE_ASSERT(sizeof(ScopedBstr) == sizeof(BSTR), ScopedBstrSize);
-  SysFreeString(bstr_);
-}
-
-void ScopedBstr::Reset(BSTR bstr) {
-  if (bstr != bstr_) {
-    // if |bstr_| is NULL, SysFreeString does nothing.
-    SysFreeString(bstr_);
-    bstr_ = bstr;
-  }
-}
-
-BSTR ScopedBstr::Release() {
-  BSTR bstr = bstr_;
-  bstr_ = NULL;
-  return bstr;
-}
-
-void ScopedBstr::Swap(ScopedBstr& bstr2) {
-  BSTR tmp = bstr_;
-  bstr_ = bstr2.bstr_;
-  bstr2.bstr_ = tmp;
-}
-
-BSTR* ScopedBstr::Receive() {
-  DCHECK(bstr_ == NULL) << "BSTR leak.";
-  return &bstr_;
-}
-
-BSTR ScopedBstr::Allocate(const wchar_t* wide_str) {
-  Reset(SysAllocString(wide_str));
-  return bstr_;
-}
-
-BSTR ScopedBstr::AllocateBytes(int bytes) {
-  Reset(SysAllocStringByteLen(NULL, bytes));
-  return bstr_;
-}
-
-void ScopedBstr::SetByteLen(uint32_t bytes) {
-  DCHECK(bstr_ != NULL) << "attempting to modify a NULL bstr";
-  uint32_t* data = reinterpret_cast<uint32_t*>(bstr_);
-  data[-1] = bytes;
-}
-
-uint32_t ScopedBstr::Length() const {
-  return SysStringLen(bstr_);
-}
-
-uint32_t ScopedBstr::ByteLength() const {
-  return SysStringByteLen(bstr_);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_clipboard_writer.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This file implements the ScopedClipboardWriter class. Documentation on its
-// purpose can be found in base/scoped_clipboard_writer.h. Documentation on the
-// format of the parameters for each clipboard target can be found in
-// base/clipboard.h.
-#include "base/scoped_clipboard_writer.h"
-
-#include "base/string_util.h"
-
-ScopedClipboardWriter::ScopedClipboardWriter(Clipboard* clipboard)
-    : clipboard_(clipboard) {
-}
-
-ScopedClipboardWriter::~ScopedClipboardWriter() {
-  if (!objects_.empty() && clipboard_)
-    clipboard_->WriteObjects(objects_);
-}
-
-void ScopedClipboardWriter::WriteText(const string16& text) {
-  if (text.empty())
-    return;
-
-  std::string utf8_text = UTF16ToUTF8(text);
-
-  Clipboard::ObjectMapParams parameters;
-  parameters.push_back(Clipboard::ObjectMapParam(utf8_text.begin(),
-                                                 utf8_text.end()));
-  objects_[Clipboard::CBF_TEXT] = parameters;
-}
-
-void ScopedClipboardWriter::WriteHTML(const string16& markup,
-                                      const std::string& source_url) {
-  if (markup.empty())
-    return;
-
-  std::string utf8_markup = UTF16ToUTF8(markup);
-
-  Clipboard::ObjectMapParams parameters;
-  parameters.push_back(
-      Clipboard::ObjectMapParam(utf8_markup.begin(),
-                                utf8_markup.end()));
-  if (!source_url.empty()) {
-    parameters.push_back(Clipboard::ObjectMapParam(source_url.begin(),
-                                                   source_url.end()));
-  }
-
-  objects_[Clipboard::CBF_HTML] = parameters;
-}
-
-void ScopedClipboardWriter::WriteBookmark(const string16& bookmark_title,
-                                          const std::string& url) {
-  if (bookmark_title.empty() || url.empty())
-    return;
-
-  std::string utf8_markup = UTF16ToUTF8(bookmark_title);
-
-  Clipboard::ObjectMapParams parameters;
-  parameters.push_back(Clipboard::ObjectMapParam(utf8_markup.begin(),
-                                                 utf8_markup.end()));
-  parameters.push_back(Clipboard::ObjectMapParam(url.begin(), url.end()));
-  objects_[Clipboard::CBF_BOOKMARK] = parameters;
-}
-
-void ScopedClipboardWriter::WriteHyperlink(const string16& link_text,
-                                           const std::string& url) {
-  if (link_text.empty() || url.empty())
-    return;
-
-  std::string utf8_markup = UTF16ToUTF8(link_text);
-
-  Clipboard::ObjectMapParams parameters;
-  parameters.push_back(Clipboard::ObjectMapParam(utf8_markup.begin(),
-                                                 utf8_markup.end()));
-  parameters.push_back(Clipboard::ObjectMapParam(url.begin(), url.end()));
-  objects_[Clipboard::CBF_LINK] = parameters;
-}
-
-void ScopedClipboardWriter::WriteFile(const FilePath& file) {
-  WriteFiles(std::vector<FilePath>(1, file));
-}
-
-// Save the filenames as a string separated by nulls and terminated with an
-// extra null.
-void ScopedClipboardWriter::WriteFiles(const std::vector<FilePath>& files) {
-  if (files.empty())
-    return;
-
-  Clipboard::ObjectMapParam parameter;
-
-  for (std::vector<FilePath>::const_iterator iter = files.begin();
-       iter != files.end(); ++iter) {
-    FilePath filepath = *iter;
-    FilePath::StringType filename = filepath.value();
-
-    size_t data_length = filename.length() * sizeof(FilePath::CharType);
-    const char* data = reinterpret_cast<const char*>(filename.data());
-    const char* data_end = data + data_length;
-
-    for (const char* ch = data; ch < data_end; ++ch)
-      parameter.push_back(*ch);
-
-    // NUL-terminate the string.
-    for (size_t i = 0; i < sizeof(FilePath::CharType); ++i)
-      parameter.push_back('\0');
-  }
-
-  // NUL-terminate the string list.
-  for (size_t i = 0; i < sizeof(FilePath::CharType); ++i)
-    parameter.push_back('\0');
-
-  Clipboard::ObjectMapParams parameters;
-  parameters.push_back(parameter);
-  objects_[Clipboard::CBF_FILES] = parameters;
-}
-
-void ScopedClipboardWriter::WriteWebSmartPaste() {
-  objects_[Clipboard::CBF_WEBKIT] = Clipboard::ObjectMapParams();
-}
-
-void ScopedClipboardWriter::WriteBitmapFromPixels(const void* pixels,
-                                                  const gfx::Size& size) {
-  Clipboard::ObjectMapParam pixels_parameter, size_parameter;
-  const char* pixels_data = reinterpret_cast<const char*>(pixels);
-  size_t pixels_length = 4 * size.width() * size.height();
-  for (size_t i = 0; i < pixels_length; i++)
-    pixels_parameter.push_back(pixels_data[i]);
-
-  const char* size_data = reinterpret_cast<const char*>(&size);
-  size_t size_length = sizeof(gfx::Size);
-  for (size_t i = 0; i < size_length; i++)
-    size_parameter.push_back(size_data[i]);
-
-  Clipboard::ObjectMapParams parameters;
-  parameters.push_back(pixels_parameter);
-  parameters.push_back(size_parameter);
-  objects_[Clipboard::CBF_BITMAP] = parameters;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_clipboard_writer.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This file declares the ScopedClipboardWriter class, a wrapper around
-// the Clipboard class which simplifies writing data to the system clipboard.
-// Upon deletion the class atomically writes all data to |clipboard_|,
-// avoiding any potential race condition with other processes that are also
-// writing to the system clipboard.
-#ifndef BASE_SCOPED_CLIPBOARD_WRITER_H_
-#define BASE_SCOPED_CLIPBOARD_WRITER_H_
-
-#include <string>
-#include <vector>
-
-#include "base/clipboard.h"
-#include "base/file_path.h"
-#include "base/string16.h"
-
-// This class is a wrapper for |Clipboard| that handles packing data
-// into a Clipboard::ObjectMap.
-// NB: You should probably NOT be using this class if you include
-// webkit_glue.h. Use ScopedClipboardWriterGlue instead.
-class ScopedClipboardWriter {
- public:
-  // Create an instance that is a simple wrapper around clipboard.
-  ScopedClipboardWriter(Clipboard* clipboard);
-
-  ~ScopedClipboardWriter();
-
-  // Converts |text| to UTF-8 and adds it to the clipboard.
-  void WriteText(const string16& text);
-
-  // Adds HTML to the clipboard.  The url parameter is optional, but especially
-  // useful if the HTML fragment contains relative links.
-  void WriteHTML(const string16& markup, const std::string& source_url);
-
-  // Adds a bookmark to the clipboard.
-  void WriteBookmark(const string16& bookmark_title,
-                     const std::string& url);
-
-  // Adds both a bookmark and an HTML hyperlink to the clipboard.  It is a
-  // convenience wrapper around WriteBookmark and WriteHTML. |link_text| is
-  // used as the bookmark title.
-  void WriteHyperlink(const string16& link_text, const std::string& url);
-
-  // Adds a file or group of files to the clipboard.
-  void WriteFile(const FilePath& file);
-  void WriteFiles(const std::vector<FilePath>& files);
-
-  // Used by WebKit to determine whether WebKit wrote the clipboard last
-  void WriteWebSmartPaste();
-
-  // Adds a bitmap to the clipboard
-  // Pixel format is assumed to be 32-bit BI_RGB.
-  void WriteBitmapFromPixels(const void* pixels, const gfx::Size& size);
-
- protected:
-  // We accumulate the data passed to the various targets in the |objects_|
-  // vector, and pass it to Clipboard::WriteObjects() during object destruction.
-  Clipboard::ObjectMap objects_;
-  Clipboard* clipboard_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ScopedClipboardWriter);
-};
-
-#endif  // BASE_SCOPED_CLIPBOARD_WRITER_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_comptr_win.h
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-#ifndef BASE_SCOPED_COMPTR_WIN_H_
-#define BASE_SCOPED_COMPTR_WIN_H_
-
-#include <unknwn.h>
-
-#include "base/logging.h"
-#include "base/ref_counted.h"
-
-// Utility template to prevent users of ScopedComPtr from calling AddRef and/or
-// Release() without going through the ScopedComPtr class.
-template <class Interface>
-class BlockIUnknownMethods : public Interface {
- private:
-  STDMETHOD(QueryInterface)(REFIID iid, void** object) = 0;
-  STDMETHOD_(ULONG, AddRef)() = 0;
-  STDMETHOD_(ULONG, Release)() = 0;
-};
-
-// A fairly minimalistic smart class for COM interface pointers.
-// Uses scoped_refptr for the basic smart pointer functionality
-// and adds a few IUnknown specific services.
-template <class Interface, const IID* interface_id = &__uuidof(Interface)>
-class ScopedComPtr : public scoped_refptr<Interface> {
- public:
-  typedef scoped_refptr<Interface> ParentClass;
-
-  ScopedComPtr() {
-  }
-
-  explicit ScopedComPtr(Interface* p) : ParentClass(p) {
-  }
-
-  explicit ScopedComPtr(const ScopedComPtr<Interface, interface_id>& p)
-      : ParentClass(p) {
-  }
-
-  ~ScopedComPtr() {
-    // We don't want the smart pointer class to be bigger than the pointer
-    // it wraps.
-    COMPILE_ASSERT(sizeof(ScopedComPtr<Interface, interface_id>) ==
-                   sizeof(Interface*), ScopedComPtrSize);
-  }
-
-  // Explicit Release() of the held object.  Useful for reuse of the
-  // ScopedComPtr instance.
-  // Note that this function equates to IUnknown::Release and should not
-  // be confused with e.g. scoped_ptr::release().
-  void Release() {
-    if (ptr_ != NULL) {
-      ptr_->Release();
-      ptr_ = NULL;
-    }
-  }
-
-  // Sets the internal pointer to NULL and returns the held object without
-  // releasing the reference.
-  Interface* Detach() {
-    Interface* p = ptr_;
-    ptr_ = NULL;
-    return p;
-  }
-
-  // Accepts an interface pointer that has already been addref-ed.
-  void Attach(Interface* p) {
-    DCHECK(ptr_ == NULL);
-    ptr_ = p;
-  }
-
-  // Retrieves the pointer address.
-  // Used to receive object pointers as out arguments (and take ownership).
-  // The function DCHECKs on the current value being NULL.
-  // Usage: Foo(p.Receive());
-  Interface** Receive() {
-    DCHECK(ptr_ == NULL) << "Object leak. Pointer must be NULL";
-    return &ptr_;
-  }
-
-  template <class Query>
-  HRESULT QueryInterface(Query** p) {
-    DCHECK(p != NULL);
-    DCHECK(ptr_ != NULL);
-    // IUnknown already has a template version of QueryInterface
-    // so the iid parameter is implicit here. The only thing this
-    // function adds are the DCHECKs.
-    return ptr_->QueryInterface(p);
-  }
-
-  // Queries |other| for the interface this object wraps and returns the
-  // error code from the other->QueryInterface operation.
-  HRESULT QueryFrom(IUnknown* object) {
-    DCHECK(object != NULL);
-    return object->QueryInterface(Receive());
-  }
-
-  // Convenience wrapper around CoCreateInstance
-  HRESULT CreateInstance(const CLSID& clsid, IUnknown* outer = NULL,
-                         DWORD context = CLSCTX_ALL) {
-    DCHECK(ptr_ == NULL);
-    HRESULT hr = ::CoCreateInstance(clsid, outer, context, *interface_id,
-                                    reinterpret_cast<void**>(&ptr_));
-    return hr;
-  }
-
-  // Checks if the identity of |other| and this object is the same.
-  bool IsSameObject(IUnknown* other) {
-    if (!other && !ptr_)
-      return true;
-
-    if (!other || !ptr_)
-      return false;
-
-    ScopedComPtr<IUnknown> my_identity;
-    QueryInterface(my_identity.Receive());
-
-    ScopedComPtr<IUnknown> other_identity;
-    other->QueryInterface(other_identity.Receive());
-
-    return static_cast<IUnknown*>(my_identity) ==
-           static_cast<IUnknown*>(other_identity);
-  }
-
-  // Provides direct access to the interface.
-  // Here we use a well known trick to make sure we block access to
-  // IUknown methods so that something bad like this doesn't happen:
-  //    ScopedComPtr<IUnknown> p(Foo());
-  //    p->Release();
-  //    ... later the destructor runs, which will Release() again.
-  // and to get the benefit of the DCHECKs we add to QueryInterface.
-  // There's still a way to call these methods if you absolutely must
-  // by statically casting the ScopedComPtr instance to the wrapped interface
-  // and then making the call... but generally that shouldn't be necessary.
-  BlockIUnknownMethods<Interface>* operator->() const {
-    DCHECK(ptr_ != NULL);
-    return reinterpret_cast<BlockIUnknownMethods<Interface>*>(ptr_);
-  }
-
-  // Pull in operator=() from the parent class.
-  using scoped_refptr<Interface>::operator=;
-
-  // static methods
-
-  static const IID& iid() {
-    return *interface_id;
-  }
-};
-
-#endif  // BASE_SCOPED_COMPTR_WIN_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_variant_win.cc
+++ /dev/null
@@ -1,259 +0,0 @@
-// Copyright (c) 2009 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 "base/scoped_variant_win.h"
-#include "base/logging.h"
-
-// Global, const instance of an empty variant.
-const VARIANT ScopedVariant::kEmptyVariant = { VT_EMPTY };
-
-ScopedVariant::~ScopedVariant() {
-  COMPILE_ASSERT(sizeof(ScopedVariant) == sizeof(VARIANT), ScopedVariantSize);
-  ::VariantClear(&var_);
-}
-
-ScopedVariant::ScopedVariant(const wchar_t* str) {
-  var_.vt = VT_EMPTY;
-  Set(str);
-}
-
-ScopedVariant::ScopedVariant(const wchar_t* str, UINT length) {
-  var_.vt = VT_BSTR;
-  var_.bstrVal = ::SysAllocStringLen(str, length);
-}
-
-ScopedVariant::ScopedVariant(int value, VARTYPE vt) {
-  var_.vt = vt;
-  var_.lVal = value;
-}
-
-ScopedVariant::ScopedVariant(IDispatch* dispatch) {
-  var_.vt = VT_EMPTY;
-  Set(dispatch);
-}
-
-ScopedVariant::ScopedVariant(IUnknown* unknown) {
-  var_.vt = VT_EMPTY;
-  Set(unknown);
-}
-
-ScopedVariant::ScopedVariant(const VARIANT& var) {
-  var_.vt = VT_EMPTY;
-  Set(var);
-}
-
-void ScopedVariant::Reset(const VARIANT& var) {
-  if (&var != &var_) {
-    ::VariantClear(&var_);
-    var_ = var;
-  }
-}
-
-VARIANT ScopedVariant::Release() {
-  VARIANT var = var_;
-  var_.vt = VT_EMPTY;
-  return var;
-}
-
-void ScopedVariant::Swap(ScopedVariant& var) {
-  VARIANT tmp = var_;
-  var_ = var.var_;
-  var.var_ = tmp;
-}
-
-VARIANT* ScopedVariant::Receive() {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "variant leak. type: " << var_.vt;
-  return &var_;
-}
-
-VARIANT ScopedVariant::Copy() const {
-  VARIANT ret = { VT_EMPTY };
-  ::VariantCopy(&ret, &var_);
-  return ret;
-}
-
-int ScopedVariant::Compare(const VARIANT& var, bool ignore_case) const {
-  ULONG flags = ignore_case ? NORM_IGNORECASE : 0;
-  HRESULT hr = ::VarCmp(const_cast<VARIANT*>(&var_), const_cast<VARIANT*>(&var),
-                        LOCALE_USER_DEFAULT, flags);
-  int ret = 0;
-
-  switch (hr) {
-    case VARCMP_LT:
-      ret = -1;
-      break;
-
-    case VARCMP_GT:
-    case VARCMP_NULL:
-      ret = 1;
-      break;
-
-    default:
-      // Equal.
-      break;
-  }
-
-  return ret;
-}
-
-void ScopedVariant::Set(const wchar_t* str) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_BSTR;
-  var_.bstrVal = ::SysAllocString(str);
-}
-
-void ScopedVariant::Set(int8_t i8) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_I1;
-  var_.cVal = i8;
-}
-
-void ScopedVariant::Set(uint8_t ui8) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_UI1;
-  var_.bVal = ui8;
-}
-
-void ScopedVariant::Set(int16_t i16) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_I2;
-  var_.iVal = i16;
-}
-
-void ScopedVariant::Set(uint16_t ui16) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_UI2;
-  var_.uiVal = ui16;
-}
-
-void ScopedVariant::Set(int32_t i32) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_I4;
-  var_.lVal = i32;
-}
-
-void ScopedVariant::Set(uint32_t ui32) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_UI4;
-  var_.ulVal = ui32;
-}
-
-void ScopedVariant::Set(int64_t i64) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_I8;
-  var_.llVal = i64;
-}
-
-void ScopedVariant::Set(uint64_t ui64) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_UI8;
-  var_.ullVal = ui64;
-}
-
-void ScopedVariant::Set(float r32) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_R4;
-  var_.fltVal = r32;
-}
-
-void ScopedVariant::Set(double r64) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_R8;
-  var_.dblVal = r64;
-}
-
-void ScopedVariant::SetDate(DATE date) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_DATE;
-  var_.date = date;
-}
-
-void ScopedVariant::Set(IDispatch* disp) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_DISPATCH;
-  var_.pdispVal = disp;
-  if (disp)
-    disp->AddRef();
-}
-
-void ScopedVariant::Set(bool b) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_BOOL;
-  var_.boolVal = b ? VARIANT_TRUE : VARIANT_FALSE;
-}
-
-void ScopedVariant::Set(IUnknown* unk) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  var_.vt = VT_UNKNOWN;
-  var_.punkVal = unk;
-  if (unk)
-    unk->AddRef();
-}
-
-void ScopedVariant::Set(SAFEARRAY* array) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  if (SUCCEEDED(::SafeArrayGetVartype(array, &var_.vt))) {
-    var_.vt |= VT_ARRAY;
-    var_.parray = array;
-  } else {
-    DCHECK(array == NULL) << "Unable to determine safearray vartype";
-    var_.vt = VT_EMPTY;
-  }
-}
-
-void ScopedVariant::Set(const VARIANT& var) {
-  DCHECK(!IsLeakableVarType(var_.vt)) << "leaking variant: " << var_.vt;
-  if (FAILED(::VariantCopy(&var_, &var))) {
-    DLOG(ERROR) << "VariantCopy failed";
-    var_.vt = VT_EMPTY;
-  }
-}
-
-ScopedVariant& ScopedVariant::operator=(const VARIANT& var) {
-  if (&var != &var_) {
-    VariantClear(&var_);
-    Set(var);
-  }
-  return *this;
-}
-
-bool ScopedVariant::IsLeakableVarType(VARTYPE vt) {
-  bool leakable = false;
-  switch (vt & VT_TYPEMASK) {
-    case VT_BSTR:
-    case VT_DISPATCH:
-    // we treat VT_VARIANT as leakable to err on the safe side.
-    case VT_VARIANT:
-    case VT_UNKNOWN:
-    case VT_SAFEARRAY:
-
-    // very rarely used stuff (if ever):
-    case VT_VOID:
-    case VT_PTR:
-    case VT_CARRAY:
-    case VT_USERDEFINED:
-    case VT_LPSTR:
-    case VT_LPWSTR:
-    case VT_RECORD:
-    case VT_INT_PTR:
-    case VT_UINT_PTR:
-    case VT_FILETIME:
-    case VT_BLOB:
-    case VT_STREAM:
-    case VT_STORAGE:
-    case VT_STREAMED_OBJECT:
-    case VT_STORED_OBJECT:
-    case VT_BLOB_OBJECT:
-    case VT_VERSIONED_STREAM:
-    case VT_BSTR_BLOB:
-      leakable = true;
-      break;
-  }
-
-  if (!leakable && (vt & VT_ARRAY) != 0) {
-    leakable = true;
-  }
-
-  return leakable;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_variant_win.h
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) 2009 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.
-
-#ifndef BASE_SCOPED_VARIANT_WIN_H_
-#define BASE_SCOPED_VARIANT_WIN_H_
-
-#include <windows.h>
-#include <oleauto.h>
-
-#include "base/basictypes.h"  // needed to pick up OS_WIN
-#include "base/logging.h"
-
-// Scoped VARIANT class for automatically freeing a COM VARIANT at the
-// end of a scope.  Additionally provides a few functions to make the
-// encapsulated VARIANT easier to use.
-// Instead of inheriting from VARIANT, we take the containment approach
-// in order to have more control over the usage of the variant and guard
-// against memory leaks.
-class ScopedVariant {
- public:
-  // Declaration of a global variant variable that's always VT_EMPTY
-  static const VARIANT kEmptyVariant;
-
-  // Default constructor.
-  ScopedVariant() {
-    // This is equivalent to what VariantInit does, but less code.
-    var_.vt = VT_EMPTY;
-  }
-
-  // Constructor to create a new VT_BSTR VARIANT.
-  // NOTE: Do not pass a BSTR to this constructor expecting ownership to
-  // be transferred
-  explicit ScopedVariant(const wchar_t* str);
-
-  // Creates a new VT_BSTR variant of a specified length.
-  explicit ScopedVariant(const wchar_t* str, UINT length);
-
-  // Creates a new integral type variant and assigns the value to
-  // VARIANT.lVal (32 bit sized field).
-  explicit ScopedVariant(int value, VARTYPE vt = VT_I4);
-
-  // VT_DISPATCH
-  explicit ScopedVariant(IDispatch* dispatch);
-
-  // VT_UNKNOWN
-  explicit ScopedVariant(IUnknown* unknown);
-
-  // Copies the variant.
-  explicit ScopedVariant(const VARIANT& var);
-
-  ~ScopedVariant();
-
-  inline VARTYPE type() const {
-    return var_.vt;
-  }
-
-  // Give ScopedVariant ownership over an already allocated VARIANT.
-  void Reset(const VARIANT& var = kEmptyVariant);
-
-  // Releases ownership of the VARIANT to the caller.
-  VARIANT Release();
-
-  // Swap two ScopedVariant's.
-  void Swap(ScopedVariant& var);
-
-  // Returns a copy of the variant.
-  VARIANT Copy() const;
-
-  // The return value is 0 if the variants are equal, 1 if this object is
-  // greater than |var|, -1 if it is smaller.
-  int Compare(const VARIANT& var, bool ignore_case = false) const;
-
-  // Retrieves the pointer address.
-  // Used to receive a VARIANT as an out argument (and take ownership).
-  // The function DCHECKs on the current value being empty/null.
-  // Usage: GetVariant(var.receive());
-  VARIANT* Receive();
-
-  void Set(const wchar_t* str);
-
-  // Setters for simple types.
-  void Set(int8_t i8);
-  void Set(uint8_t ui8);
-  void Set(int16_t i16);
-  void Set(uint16_t ui16);
-  void Set(int32_t i32);
-  void Set(uint32_t ui32);
-  void Set(int64_t i64);
-  void Set(uint64_t ui64);
-  void Set(float r32);
-  void Set(double r64);
-  void Set(bool b);
-
-  // Creates a copy of |var| and assigns as this instance's value.
-  // Note that this is different from the Reset() method that's used to
-  // free the current value and assume ownership.
-  void Set(const VARIANT& var);
-
-  // COM object setters
-  void Set(IDispatch* disp);
-  void Set(IUnknown* unk);
-
-  // SAFEARRAY support
-  void Set(SAFEARRAY* array);
-
-  // Special setter for DATE since DATE is a double and we already have
-  // a setter for double.
-  void SetDate(DATE date);
-
-  // Allows const access to the contained variant without DCHECKs etc.
-  // This support is necessary for the V_XYZ (e.g. V_BSTR) set of macros to
-  // work properly but still doesn't allow modifications since we want control
-  // over that.
-  const VARIANT* operator&() const {
-    return &var_;
-  }
-
-  // Like other scoped classes (e.g scoped_refptr, ScopedComPtr, ScopedBstr)
-  // we support the assignment operator for the type we wrap.
-  ScopedVariant& operator=(const VARIANT& var);
-
-  // A hack to pass a pointer to the variant where the accepting
-  // function treats the variant as an input-only, read-only value
-  // but the function prototype requires a non const variant pointer.
-  // There's no DCHECK or anything here.  Callers must know what they're doing.
-  VARIANT* AsInput() const {
-    // The nature of this function is const, so we declare
-    // it as such and cast away the constness here.
-    return const_cast<VARIANT*>(&var_);
-  }
-
-  // Allows the ScopedVariant instance to be passed to functions either by value
-  // or by const reference.
-  operator const VARIANT&() const {
-    return var_;
-  }
-
-  // Used as a debug check to see if we're leaking anything.
-  static bool IsLeakableVarType(VARTYPE vt);
-
- protected:
-  VARIANT var_;
-
- private:
-  // Comparison operators for ScopedVariant are not supported at this point.
-  // Use the Compare method instead.
-  bool operator==(const ScopedVariant& var) const;
-  bool operator!=(const ScopedVariant& var) const;
-  DISALLOW_COPY_AND_ASSIGN(ScopedVariant);
-};
-
-#endif  // BASE_SCOPED_VARIANT_WIN_H_
--- a/ipc/chromium/src/base/shared_memory_posix.cc
+++ b/ipc/chromium/src/base/shared_memory_posix.cc
@@ -131,27 +131,43 @@ bool SharedMemory::FilenameForMemoryName
     return false;
 
   mem_filename = UTF8ToWide(temp_dir.value());
   file_util::AppendToPath(&mem_filename, L"com.google.chrome.shmem." + memname);
   *filename = mem_filename;
   return true;
 }
 
+namespace {
+
+// A class to handle auto-closing of FILE*'s.
+class ScopedFILEClose {
+ public:
+  inline void operator()(FILE* x) const {
+    if (x) {
+      fclose(x);
+    }
+  }
+};
+
+typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE;
+
+}
+
 // Chromium mostly only use the unique/private shmem as specified by
 // "name == L"". The exception is in the StatsTable.
 // TODO(jrg): there is no way to "clean up" all unused named shmem if
 // we restart from a crash.  (That isn't a new problem, but it is a problem.)
 // In case we want to delete it later, it may be useful to save the value
 // of mem_filename after FilenameForMemoryName().
 bool SharedMemory::CreateOrOpen(const std::wstring &name,
                                 int posix_flags, size_t size) {
   DCHECK(mapped_file_ == -1);
 
-  file_util::ScopedFILE file_closer;
+  ScopedFILE file_closer;
   FILE *fp;
 
   if (name == L"") {
     // It doesn't make sense to have a read-only private piece of shmem
     DCHECK(posix_flags & (O_RDWR | O_WRONLY));
 
     FilePath path;
     fp = file_util::CreateAndOpenTemporaryShmemFile(&path);
deleted file mode 100644
--- a/ipc/chromium/src/base/spin_wait.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2006-2008 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.
-
-// This file provides a macro ONLY for use in testing.
-// DO NOT USE IN PRODUCTION CODE.  There are much better ways to wait.
-
-// This code is very helpful in testing multi-threaded code, without depending
-// on almost any primitives.  This is especially helpful if you are testing
-// those primitive multi-threaded constructs.
-
-// We provide a simple one argument spin wait (for 1 second), and a generic
-// spin wait (for longer periods of time).
-
-#ifndef BASE_SPIN_WAIT_H__
-#define BASE_SPIN_WAIT_H__
-
-#include "base/platform_thread.h"
-#include "base/time.h"
-
-// Provide a macro that will wait no longer than 1 second for an asynchronous
-// change is the value of an expression.
-// A typical use would be:
-//
-//   SPIN_FOR_1_SECOND_OR_UNTIL_TRUE(0 == f(x));
-//
-// The expression will be evaluated repeatedly until it is true, or until
-// the time (1 second) expires.
-// Since tests generally have a 5 second watch dog timer, this spin loop is
-// typically used to get the padding needed on a given test platform to assure
-// that the test passes, even if load varies, and external events vary.
-
-#define SPIN_FOR_1_SECOND_OR_UNTIL_TRUE(expression) \
-    SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(base::TimeDelta::FromSeconds(1), \
-                                     (expression))
-
-#define SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(delta, expression) do { \
-  base::Time start = base::Time::Now(); \
-  const base::TimeDelta kTimeout = delta; \
-    while(!(expression)) { \
-      if (kTimeout < base::Time::Now() - start) { \
-      EXPECT_LE((base::Time::Now() - start).InMilliseconds(), \
-                kTimeout.InMilliseconds()) << "Timed out"; \
-        break; \
-      } \
-      PlatformThread::Sleep(50); \
-    } \
-  } \
-  while(0)
-
-#endif  // BASE_SPIN_WAIT_H__
--- a/ipc/chromium/src/base/string_util.cc
+++ b/ipc/chromium/src/base/string_util.cc
@@ -60,35 +60,16 @@ struct ToUnsigned<wchar_t> {
   typedef uint32_t Unsigned;
 #endif
 };
 template<>
 struct ToUnsigned<short> {
   typedef unsigned short Unsigned;
 };
 
-// Used by ReplaceStringPlaceholders to track the position in the string of
-// replaced parameters.
-struct ReplacementOffset {
-  ReplacementOffset(int parameter, size_t offset)
-      : parameter(parameter),
-        offset(offset) {}
-
-  // Index of the parameter.
-  int parameter;
-
-  // Starting position in the string.
-  size_t offset;
-};
-
-static bool CompareParameter(const ReplacementOffset& elem1,
-                             const ReplacementOffset& elem2) {
-  return elem1.parameter < elem2.parameter;
-}
-
 // Generalized string-to-number conversion.
 //
 // StringToNumberTraits should provide:
 //  - a typedef for string_type, the STL string type used as input.
 //  - a typedef for value_type, the target numeric type.
 //  - a static function, convert_func, which dispatches to an appropriate
 //    strtol-like function and returns type value_type.
 //  - a static function, valid_func, which validates |input| and returns a bool
@@ -199,58 +180,16 @@ class String16ToInt64Traits {
     return ret;
 #endif
   }
   static inline bool valid_func(const string_type& str) {
     return !str.empty() && !iswspace(str[0]);
   }
 };
 
-// For the HexString variants, use the unsigned variants like strtoul for
-// convert_func so that input like "0x80000000" doesn't result in an overflow.
-
-class HexStringToLongTraits {
- public:
-  typedef std::string string_type;
-  typedef long value_type;
-  static const int kBase = 16;
-  static inline value_type convert_func(const string_type::value_type* str,
-                                        string_type::value_type** endptr) {
-    return strtoul(str, endptr, kBase);
-  }
-  static inline bool valid_func(const string_type& str) {
-    return !str.empty() && !isspace(str[0]);
-  }
-};
-
-class HexString16ToLongTraits {
- public:
-  typedef string16 string_type;
-  typedef long value_type;
-  static const int kBase = 16;
-  static inline value_type convert_func(const string_type::value_type* str,
-                                        string_type::value_type** endptr) {
-#if defined(WCHAR_T_IS_UTF16)
-    return wcstoul(str, endptr, kBase);
-#elif defined(WCHAR_T_IS_UTF32)
-    std::string ascii_string = UTF16ToASCII(string16(str));
-    char* ascii_end = NULL;
-    value_type ret = strtoul(ascii_string.c_str(), &ascii_end, kBase);
-    if (ascii_string.c_str() + ascii_string.length() == ascii_end) {
-      *endptr =
-          const_cast<string_type::value_type*>(str) + ascii_string.length();
-    }
-    return ret;
-#endif
-  }
-  static inline bool valid_func(const string_type& str) {
-    return !str.empty() && !iswspace(str[0]);
-  }
-};
-
 }  // namespace
 
 
 namespace base {
 
 bool IsWprintfFormatPortable(const wchar_t* format) {
   for (const wchar_t* position = format; *position != '\0'; ++position) {
 
@@ -286,33 +225,17 @@ bool IsWprintfFormatPortable(const wchar
   }
 
   return true;
 }
 
 
 }  // namespace base
 
-namespace base {
-
-const std::string& EmptyString() {
-  return Singleton<EmptyStrings>::get()->s;
-}
-
-const std::wstring& EmptyWString() {
-  return Singleton<EmptyStrings>::get()->ws;
-}
-
-const string16& EmptyString16() {
-  return Singleton<EmptyStrings>::get()->s16;
-}
-
-}
-
-const wchar_t kWhitespaceWide[] = {
+static const wchar_t kWhitespaceWide[] = {
   0x0009,  // <control-0009> to <control-000D>
   0x000A,
   0x000B,
   0x000C,
   0x000D,
   0x0020,  // Space
   0x0085,  // <control-0085>
   0x00A0,  // No-Break Space
@@ -332,26 +255,25 @@ const wchar_t kWhitespaceWide[] = {
   0x200C,  // Zero Width Non-Joiner
   0x2028,  // Line Separator
   0x2029,  // Paragraph Separator
   0x202F,  // Narrow No-Break Space
   0x205F,  // Medium Mathematical Space
   0x3000,  // Ideographic Space
   0
 };
-const char kWhitespaceASCII[] = {
+static const char kWhitespaceASCII[] = {
   0x09,    // <control-0009> to <control-000D>
   0x0A,
   0x0B,
   0x0C,
   0x0D,
   0x20,    // Space
   0
 };
-const char* const kCodepageUTF8 = "UTF-8";
 
 template<typename STR>
 TrimPositions TrimStringT(const STR& input,
                           const typename STR::value_type trim_chars[],
                           TrimPositions positions,
                           STR* output) {
   // Find the edges of leading/trailing whitespace as desired.
   const typename STR::size_type last_char = input.length() - 1;
@@ -375,25 +297,27 @@ TrimPositions TrimStringT(const STR& inp
       input.substr(first_good_char, last_good_char - first_good_char + 1);
 
   // Return where we trimmed from.
   return static_cast<TrimPositions>(
       ((first_good_char == 0) ? TRIM_NONE : TRIM_LEADING) |
       ((last_good_char == last_char) ? TRIM_NONE : TRIM_TRAILING));
 }
 
-bool TrimString(const std::wstring& input,
-                const wchar_t trim_chars[],
-                std::wstring* output) {
+// Removes characters in trim_chars from the beginning and end of input.
+// NOTE: Safe to use the same variable for both input and output.
+static bool TrimString(const std::wstring& input,
+                       const wchar_t trim_chars[],
+                       std::wstring* output) {
   return TrimStringT(input, trim_chars, TRIM_ALL, output) != TRIM_NONE;
 }
 
-bool TrimString(const std::string& input,
-                const char trim_chars[],
-                std::string* output) {
+static bool TrimString(const std::string& input,
+                       const char trim_chars[],
+                       std::string* output) {
   return TrimStringT(input, trim_chars, TRIM_ALL, output) != TRIM_NONE;
 }
 
 TrimPositions TrimWhitespace(const std::wstring& input,
                              TrimPositions positions,
                              std::wstring* output) {
   return TrimStringT(input, kWhitespaceWide, positions, output);
 }
@@ -407,57 +331,16 @@ TrimPositions TrimWhitespaceASCII(const 
 // This function is only for backward-compatibility.
 // To be removed when all callers are updated.
 TrimPositions TrimWhitespace(const std::string& input,
                              TrimPositions positions,
                              std::string* output) {
   return TrimWhitespaceASCII(input, positions, output);
 }
 
-std::wstring CollapseWhitespace(const std::wstring& text,
-                                bool trim_sequences_with_line_breaks) {
-  std::wstring result;
-  result.resize(text.size());
-
-  // Set flags to pretend we're already in a trimmed whitespace sequence, so we
-  // will trim any leading whitespace.
-  bool in_whitespace = true;
-  bool already_trimmed = true;
-
-  int chars_written = 0;
-  for (std::wstring::const_iterator i(text.begin()); i != text.end(); ++i) {
-    if (IsWhitespace(*i)) {
-      if (!in_whitespace) {
-        // Reduce all whitespace sequences to a single space.
-        in_whitespace = true;
-        result[chars_written++] = L' ';
-      }
-      if (trim_sequences_with_line_breaks && !already_trimmed &&
-          ((*i == '\n') || (*i == '\r'))) {
-        // Whitespace sequences containing CR or LF are eliminated entirely.
-        already_trimmed = true;
-        --chars_written;
-      }
-    } else {
-      // Non-whitespace chracters are copied straight across.
-      in_whitespace = false;
-      already_trimmed = false;
-      result[chars_written++] = *i;
-    }
-  }
-
-  if (in_whitespace && !already_trimmed) {
-    // Any trailing whitespace is eliminated.
-    --chars_written;
-  }
-
-  result.resize(chars_written);
-  return result;
-}
-
 std::string WideToASCII(const std::wstring& wide) {
   DCHECK(IsStringASCII(wide));
   return std::string(wide.begin(), wide.end());
 }
 
 std::wstring ASCIIToWide(const std::string& ascii) {
   DCHECK(IsStringASCII(ascii));
   return std::wstring(ascii.begin(), ascii.end());
@@ -468,38 +351,16 @@ std::string UTF16ToASCII(const string16&
   return std::string(utf16.begin(), utf16.end());
 }
 
 string16 ASCIIToUTF16(const std::string& ascii) {
   DCHECK(IsStringASCII(ascii));
   return string16(ascii.begin(), ascii.end());
 }
 
-// Latin1 is just the low range of Unicode, so we can copy directly to convert.
-bool WideToLatin1(const std::wstring& wide, std::string* latin1) {
-  std::string output;
-  output.resize(wide.size());
-  latin1->clear();
-  for (size_t i = 0; i < wide.size(); i++) {
-    if (wide[i] > 255)
-      return false;
-    output[i] = static_cast<char>(wide[i]);
-  }
-  latin1->swap(output);
-  return true;
-}
-
-bool IsString8Bit(const std::wstring& str) {
-  for (size_t i = 0; i < str.length(); i++) {
-    if (str[i] > 255)
-      return false;
-  }
-  return true;
-}
-
 template<class STR>
 static bool DoIsStringASCII(const STR& str) {
   for (size_t i = 0; i < str.length(); i++) {
     typename ToUnsigned<typename STR::value_type>::Unsigned c = str[i];
     if (c > 0x7F)
       return false;
   }
   return true;
@@ -514,357 +375,16 @@ bool IsStringASCII(const string16& str) 
   return DoIsStringASCII(str);
 }
 #endif
 
 bool IsStringASCII(const std::string& str) {
   return DoIsStringASCII(str);
 }
 
-// Helper functions that determine whether the given character begins a
-// UTF-8 sequence of bytes with the given length. A character satisfies
-// "IsInUTF8Sequence" if it is anything but the first byte in a multi-byte
-// character.
-static inline bool IsBegin2ByteUTF8(int c) {
-  return (c & 0xE0) == 0xC0;
-}
-static inline bool IsBegin3ByteUTF8(int c) {
-  return (c & 0xF0) == 0xE0;
-}
-static inline bool IsBegin4ByteUTF8(int c) {
-  return (c & 0xF8) == 0xF0;
-}
-static inline bool IsInUTF8Sequence(int c) {
-  return (c & 0xC0) == 0x80;
-}
-
-// This function was copied from Mozilla, with modifications. The original code
-// was 'IsUTF8' in xpcom/string/src/nsReadableUtils.cpp. The license block for
-// this function is:
-//   This function subject to the Mozilla Public License Version
-//   1.1 (the "License"); you may not use this code except in compliance with
-//   the License. You may obtain a copy of the License at
-//   http://www.mozilla.org/MPL/
-//
-//   Software distributed under the License is distributed on an "AS IS" basis,
-//   WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-//   for the specific language governing rights and limitations under the
-//   License.
-//
-//   The Original Code is mozilla.org code.
-//
-//   The Initial Developer of the Original Code is
-//   Netscape Communications Corporation.
-//   Portions created by the Initial Developer are Copyright (C) 2000
-//   the Initial Developer. All Rights Reserved.
-//
-//   Contributor(s):
-//     Scott Collins <scc@mozilla.org> (original author)
-//
-// This is a template so that it can be run on wide and 8-bit strings. We want
-// to run it on wide strings when we have input that we think may have
-// originally been UTF-8, but has been converted to wide characters because
-// that's what we (and Windows) use internally.
-template<typename CHAR>
-static bool IsStringUTF8T(const CHAR* str, int length) {
-  bool overlong = false;
-  bool surrogate = false;
-  bool nonchar = false;
-
-  // overlong byte upper bound
-  typename ToUnsigned<CHAR>::Unsigned olupper = 0;
-
-  // surrogate byte lower bound
-  typename ToUnsigned<CHAR>::Unsigned slower = 0;
-
-  // incremented when inside a multi-byte char to indicate how many bytes
-  // are left in the sequence
-  int positions_left = 0;
-
-  for (int i = 0; i < length; i++) {
-    // This whole function assume an unsigned value so force its conversion to
-    // an unsigned value.
-    typename ToUnsigned<CHAR>::Unsigned c = str[i];
-    if (c < 0x80)
-      continue;  // ASCII
-
-    if (c <= 0xC1) {
-      // [80-BF] where not expected, [C0-C1] for overlong
-      return false;
-    } else if (IsBegin2ByteUTF8(c)) {
-      positions_left = 1;
-    } else if (IsBegin3ByteUTF8(c)) {
-      positions_left = 2;
-      if (c == 0xE0) {
-        // to exclude E0[80-9F][80-BF]
-        overlong = true;
-        olupper = 0x9F;
-      } else if (c == 0xED) {
-        // ED[A0-BF][80-BF]: surrogate codepoint
-        surrogate = true;
-        slower = 0xA0;
-      } else if (c == 0xEF) {
-        // EF BF [BE-BF] : non-character
-        // TODO(jungshik): EF B7 [90-AF] should be checked as well.
-        nonchar = true;
-      }
-    } else if (c <= 0xF4) {
-      positions_left = 3;
-      nonchar = true;
-      if (c == 0xF0) {
-        // to exclude F0[80-8F][80-BF]{2}
-        overlong = true;
-        olupper = 0x8F;
-      } else if (c == 0xF4) {
-        // to exclude F4[90-BF][80-BF]
-        // actually not surrogates but codepoints beyond 0x10FFFF
-        surrogate = true;
-        slower = 0x90;
-      }
-    } else {
-      return false;
-    }
-
-    // eat the rest of this multi-byte character
-    while (positions_left) {
-      positions_left--;
-      i++;
-      c = str[i];
-      if (!c)
-        return false;  // end of string but not end of character sequence
-
-      // non-character : EF BF [BE-BF] or F[0-7] [89AB]F BF [BE-BF]
-      if (nonchar && ((!positions_left && c < 0xBE) ||
-                      (positions_left == 1 && c != 0xBF) ||
-                      (positions_left == 2 && 0x0F != (0x0F & c) ))) {
-        nonchar = false;
-      }
-      if (!IsInUTF8Sequence(c) || (overlong && c <= olupper) ||
-          (surrogate && slower <= c) || (nonchar && !positions_left) ) {
-        return false;
-      }
-      overlong = surrogate = false;
-    }
-  }
-  return true;
-}
-
-bool IsStringUTF8(const std::string& str) {
-  return IsStringUTF8T(str.data(), str.length());
-}
-
-bool IsStringWideUTF8(const std::wstring& str) {
-  return IsStringUTF8T(str.data(), str.length());
-}
-
-template<typename Iter>
-static inline bool DoLowerCaseEqualsASCII(Iter a_begin,
-                                          Iter a_end,
-                                          const char* b) {
-  for (Iter it = a_begin; it != a_end; ++it, ++b) {
-    if (!*b || ToLowerASCII(*it) != *b)
-      return false;
-  }
-  return *b == 0;
-}
-
-// Front-ends for LowerCaseEqualsASCII.
-bool LowerCaseEqualsASCII(const std::string& a, const char* b) {
-  return DoLowerCaseEqualsASCII(a.begin(), a.end(), b);
-}
-
-bool LowerCaseEqualsASCII(const std::wstring& a, const char* b) {
-  return DoLowerCaseEqualsASCII(a.begin(), a.end(), b);
-}
-
-bool LowerCaseEqualsASCII(std::string::const_iterator a_begin,
-                          std::string::const_iterator a_end,
-                          const char* b) {
-  return DoLowerCaseEqualsASCII(a_begin, a_end, b);
-}
-
-bool LowerCaseEqualsASCII(std::wstring::const_iterator a_begin,
-                          std::wstring::const_iterator a_end,
-                          const char* b) {
-  return DoLowerCaseEqualsASCII(a_begin, a_end, b);
-}
-
-#ifndef ANDROID
-bool LowerCaseEqualsASCII(const char* a_begin,
-                          const char* a_end,
-                          const char* b) {
-  return DoLowerCaseEqualsASCII(a_begin, a_end, b);
-}
-bool LowerCaseEqualsASCII(const wchar_t* a_begin,
-                          const wchar_t* a_end,
-                          const char* b) {
-  return DoLowerCaseEqualsASCII(a_begin, a_end, b);
-}
-#endif
-bool StartsWithASCII(const std::string& str,
-                     const std::string& search,
-                     bool case_sensitive) {
-  if (case_sensitive)
-    return str.compare(0, search.length(), search) == 0;
-  else
-    return base::strncasecmp(str.c_str(), search.c_str(), search.length()) == 0;
-}
-
-bool StartsWith(const std::wstring& str,
-                const std::wstring& search,
-                bool case_sensitive) {
-  if (case_sensitive)
-    return str.compare(0, search.length(), search) == 0;
-  else {
-    if (search.size() > str.size())
-      return false;
-    return std::equal(search.begin(), search.end(), str.begin(),
-                      chromium_CaseInsensitiveCompare<wchar_t>());
-  }
-}
-
-DataUnits GetByteDisplayUnits(int64_t bytes) {
-  // The byte thresholds at which we display amounts.  A byte count is displayed
-  // in unit U when kUnitThresholds[U] <= bytes < kUnitThresholds[U+1].
-  // This must match the DataUnits enum.
-  static const int64_t kUnitThresholds[] = {
-    0,              // DATA_UNITS_BYTE,
-    3*1024,         // DATA_UNITS_KILOBYTE,
-    2*1024*1024,    // DATA_UNITS_MEGABYTE,
-    1024*1024*1024  // DATA_UNITS_GIGABYTE,
-  };
-
-  if (bytes < 0) {
-    NOTREACHED() << "Negative bytes value";
-    return DATA_UNITS_BYTE;
-  }
-
-  int unit_index = arraysize(kUnitThresholds);
-  while (--unit_index > 0) {
-    if (bytes >= kUnitThresholds[unit_index])
-      break;
-  }
-
-  DCHECK(unit_index >= DATA_UNITS_BYTE && unit_index <= DATA_UNITS_GIGABYTE);
-  return DataUnits(unit_index);
-}
-
-// TODO(mpcomplete): deal with locale
-// Byte suffixes.  This must match the DataUnits enum.
-static const wchar_t* const kByteStrings[] = {
-  L"B",
-  L"kB",
-  L"MB",
-  L"GB"
-};
-
-static const wchar_t* const kSpeedStrings[] = {
-  L"B/s",
-  L"kB/s",
-  L"MB/s",
-  L"GB/s"
-};
-
-std::wstring FormatBytesInternal(int64_t bytes,
-                                 DataUnits units,
-                                 bool show_units,
-                                 const wchar_t* const* suffix) {
-  if (bytes < 0) {
-    NOTREACHED() << "Negative bytes value";
-    return std::wstring();
-  }
-
-  DCHECK(units >= DATA_UNITS_BYTE && units <= DATA_UNITS_GIGABYTE);
-
-  // Put the quantity in the right units.
-  double unit_amount = static_cast<double>(bytes);
-  for (int i = 0; i < units; ++i)
-    unit_amount /= 1024.0;
-
-  wchar_t tmp[64];
-  // If the first decimal digit is 0, don't show it.
-  double int_part;
-  double fractional_part = modf(unit_amount, &int_part);
-  modf(fractional_part * 10, &int_part);
-  if (int_part == 0) {
-    base::swprintf(tmp, arraysize(tmp),
-                   L"%lld", static_cast<int64_t>(unit_amount));
-  } else {
-    base::swprintf(tmp, arraysize(tmp), L"%.1lf", unit_amount);
-  }
-
-  std::wstring ret(tmp);
-  if (show_units) {
-    ret += L" ";
-    ret += suffix[units];
-  }
-
-  return ret;
-}
-
-std::wstring FormatBytes(int64_t bytes, DataUnits units, bool show_units) {
-  return FormatBytesInternal(bytes, units, show_units, kByteStrings);
-}
-
-std::wstring FormatSpeed(int64_t bytes, DataUnits units, bool show_units) {
-  return FormatBytesInternal(bytes, units, show_units, kSpeedStrings);
-}
-
-template<class StringType>
-void DoReplaceSubstringsAfterOffset(StringType* str,
-                                    typename StringType::size_type start_offset,
-                                    const StringType& find_this,
-                                    const StringType& replace_with,
-                                    bool replace_all) {
-  if ((start_offset == StringType::npos) || (start_offset >= str->length()))
-    return;
-
-  DCHECK(!find_this.empty());
-  for (typename StringType::size_type offs(str->find(find_this, start_offset));
-      offs != StringType::npos; offs = str->find(find_this, offs)) {
-    str->replace(offs, find_this.length(), replace_with);
-    offs += replace_with.length();
-
-    if (!replace_all)
-      break;
-  }
-}
-
-void ReplaceFirstSubstringAfterOffset(string16* str,
-                                      string16::size_type start_offset,
-                                      const string16& find_this,
-                                      const string16& replace_with) {
-  DoReplaceSubstringsAfterOffset(str, start_offset, find_this, replace_with,
-                                 false);  // replace first instance
-}
-
-void ReplaceFirstSubstringAfterOffset(std::string* str,
-                                      std::string::size_type start_offset,
-                                      const std::string& find_this,
-                                      const std::string& replace_with) {
-  DoReplaceSubstringsAfterOffset(str, start_offset, find_this, replace_with,
-                                 false);  // replace first instance
-}
-
-void ReplaceSubstringsAfterOffset(string16* str,
-                                  string16::size_type start_offset,
-                                  const string16& find_this,
-                                  const string16& replace_with) {
-  DoReplaceSubstringsAfterOffset(str, start_offset, find_this, replace_with,
-                                 true);  // replace all instances
-}
-
-void ReplaceSubstringsAfterOffset(std::string* str,
-                                  std::string::size_type start_offset,
-                                  const std::string& find_this,
-                                  const std::string& replace_with) {
-  DoReplaceSubstringsAfterOffset(str, start_offset, find_this, replace_with,
-                                 true);  // replace all instances
-}
-
 // Overloaded wrappers around vsnprintf and vswprintf. The buf_size parameter
 // is the size of the buffer. These return the number of characters in the
 // formatted string excluding the NUL terminator. If the buffer is not
 // large enough to accommodate the formatted string without truncation, they
 // return the number of characters that would be in the fully-formatted string
 // (vsnprintf, and vswprintf on Windows), or -1 (vswprintf on POSIX platforms).
 inline int vsnprintfT(char* buffer,
                       size_t buf_size,
@@ -1046,21 +566,23 @@ std::string Uint64ToString(uint64_t valu
   return IntToStringT<std::string, uint64_t, uint64_t, false>::
       IntToString(value);
 }
 std::wstring Uint64ToWString(uint64_t value) {
   return IntToStringT<std::wstring, uint64_t, uint64_t, false>::
       IntToString(value);
 }
 
-void StringAppendV(std::string* dst, const char* format, va_list ap) {
+// Lower-level routine that takes a va_list and appends to a specified
+// string.  All other routines are just convenience wrappers around it.
+static void StringAppendV(std::string* dst, const char* format, va_list ap) {
   StringAppendVT(dst, format, ap);
 }
 
-void StringAppendV(std::wstring* dst, const wchar_t* format, va_list ap) {
+static void StringAppendV(std::wstring* dst, const wchar_t* format, va_list ap) {
   StringAppendVT(dst, format, ap);
 }
 
 std::string StringPrintf(const char* format, ...) {
   va_list ap;
   va_start(ap, format);
   std::string result;
   StringAppendV(&result, format, ap);
@@ -1141,285 +663,16 @@ void SplitString(const std::wstring& str
 }
 
 void SplitString(const std::string& str,
                  char s,
                  std::vector<std::string>* r) {
   SplitStringT(str, s, true, r);
 }
 
-void SplitStringDontTrim(const std::wstring& str,
-                         wchar_t s,
-                         std::vector<std::wstring>* r) {
-  SplitStringT(str, s, false, r);
-}
-
-void SplitStringDontTrim(const std::string& str,
-                         char s,
-                         std::vector<std::string>* r) {
-  SplitStringT(str, s, false, r);
-}
-
-template<typename STR>
-static STR JoinStringT(const std::vector<STR>& parts,
-                       typename STR::value_type sep) {
-  if (parts.size() == 0) return STR();
-
-  STR result(parts[0]);
-  typename std::vector<STR>::const_iterator iter = parts.begin();
-  ++iter;
-
-  for (; iter != parts.end(); ++iter) {
-    result += sep;
-    result += *iter;
-  }
-
-  return result;
-}
-
-std::string JoinString(const std::vector<std::string>& parts, char sep) {
-  return JoinStringT(parts, sep);
-}
-
-std::wstring JoinString(const std::vector<std::wstring>& parts, wchar_t sep) {
-  return JoinStringT(parts, sep);
-}
-
-void SplitStringAlongWhitespace(const std::wstring& str,
-                                std::vector<std::wstring>* result) {
-  const size_t length = str.length();
-  if (!length)
-    return;
-
-  bool last_was_ws = false;
-  size_t last_non_ws_start = 0;
-  for (size_t i = 0; i < length; ++i) {
-    switch(str[i]) {
-      // HTML 5 defines whitespace as: space, tab, LF, line tab, FF, or CR.
-      case L' ':
-      case L'\t':
-      case L'\xA':
-      case L'\xB':
-      case L'\xC':
-      case L'\xD':
-        if (!last_was_ws) {
-          if (i > 0) {
-            result->push_back(
-                str.substr(last_non_ws_start, i - last_non_ws_start));
-          }
-          last_was_ws = true;
-        }
-        break;
-
-      default:  // Not a space character.
-        if (last_was_ws) {
-          last_was_ws = false;
-          last_non_ws_start = i;
-        }
-        break;
-    }
-  }
-  if (!last_was_ws) {
-    result->push_back(
-              str.substr(last_non_ws_start, length - last_non_ws_start));
-  }
-}
-
-string16 ReplaceStringPlaceholders(const string16& format_string,
-                                   const string16& a,
-                                   size_t* offset) {
-  std::vector<size_t> offsets;
-  string16 result = ReplaceStringPlaceholders(format_string, a,
-                                              string16(),
-                                              string16(),
-                                              string16(), &offsets);
-  DCHECK(offsets.size() == 1);
-  if (offset) {
-    *offset = offsets[0];
-  }
-  return result;
-}
-
-string16 ReplaceStringPlaceholders(const string16& format_string,
-                                   const string16& a,
-                                   const string16& b,
-                                   std::vector<size_t>* offsets) {
-  return ReplaceStringPlaceholders(format_string, a, b, string16(),
-                                   string16(), offsets);
-}
-
-string16 ReplaceStringPlaceholders(const string16& format_string,
-                                   const string16& a,
-                                   const string16& b,
-                                   const string16& c,
-                                   std::vector<size_t>* offsets) {
-  return ReplaceStringPlaceholders(format_string, a, b, c, string16(),
-                                   offsets);
-}
-
-string16 ReplaceStringPlaceholders(const string16& format_string,
-                                       const string16& a,
-                                       const string16& b,
-                                       const string16& c,
-                                       const string16& d,
-                                       std::vector<size_t>* offsets) {
-  // We currently only support up to 4 place holders ($1 through $4), although
-  // it's easy enough to add more.
-  const string16* subst_texts[] = { &a, &b, &c, &d };
-
-  string16 formatted;
-  formatted.reserve(format_string.length() + a.length() +
-      b.length() + c.length() + d.length());
-
-  std::vector<ReplacementOffset> r_offsets;
-
-  // Replace $$ with $ and $1-$4 with placeholder text if it exists.
-  for (string16::const_iterator i = format_string.begin();
-       i != format_string.end(); ++i) {
-    if ('$' == *i) {
-      if (i + 1 != format_string.end()) {
-        ++i;
-        DCHECK('$' == *i || ('1' <= *i && *i <= '4')) <<
-            "Invalid placeholder: " << *i;
-        if ('$' == *i) {
-          formatted.push_back('$');
-        } else {
-          int index = *i - '1';
-          if (offsets) {
-            ReplacementOffset r_offset(index,
-                                       static_cast<int>(formatted.size()));
-            r_offsets.insert(std::lower_bound(r_offsets.begin(),
-                                              r_offsets.end(), r_offset,
-                                              &CompareParameter),
-                             r_offset);
-          }
-          formatted.append(*subst_texts[index]);
-        }
-      }
-    } else {
-      formatted.push_back(*i);
-    }
-  }
-  if (offsets) {
-    for (std::vector<ReplacementOffset>::const_iterator i = r_offsets.begin();
-         i != r_offsets.end(); ++i) {
-      offsets->push_back(i->offset);
-    }
-  }
-  return formatted;
-}
-
-template <class CHAR>
-static bool IsWildcard(CHAR character) {
-  return character == '*' || character == '?';
-}
-
-// Move the strings pointers to the point where they start to differ.
-template <class CHAR>
-static void EatSameChars(const CHAR** pattern, const CHAR** string) {
-  bool escaped = false;
-  while (**pattern && **string) {
-    if (!escaped && IsWildcard(**pattern)) {
-      // We don't want to match wildcard here, except if it's escaped.
-      return;
-    }
-
-    // Check if the escapement char is found. If so, skip it and move to the
-    // next character.
-    if (!escaped && **pattern == L'\\') {
-      escaped = true;
-      (*pattern)++;
-      continue;
-    }
-
-    // Check if the chars match, if so, increment the ptrs.
-    if (**pattern == **string) {
-      (*pattern)++;
-      (*string)++;
-    } else {
-      // Uh ho, it did not match, we are done. If the last char was an
-      // escapement, that means that it was an error to advance the ptr here,
-      // let's put it back where it was. This also mean that the MatchPattern
-      // function will return false because if we can't match an escape char
-      // here, then no one will.
-      if (escaped) {
-        (*pattern)--;
-      }
-      return;
-    }
-
-    escaped = false;
-  }
-}
-
-template <class CHAR>
-static void EatWildcard(const CHAR** pattern) {
-  while(**pattern) {
-    if (!IsWildcard(**pattern))
-      return;
-    (*pattern)++;
-  }
-}
-
-template <class CHAR>
-static bool MatchPatternT(const CHAR* eval, const CHAR* pattern) {
-  // Eat all the matching chars.
-  EatSameChars(&pattern, &eval);
-
-  // If the string is empty, then the pattern must be empty too, or contains
-  // only wildcards.
-  if (*eval == 0) {
-    EatWildcard(&pattern);
-    if (*pattern)
-      return false;
-    return true;
-  }
-
-  // Pattern is empty but not string, this is not a match.
-  if (*pattern == 0)
-    return false;
-
-  // If this is a question mark, then we need to compare the rest with
-  // the current string or the string with one character eaten.
-  if (pattern[0] == '?') {
-    if (MatchPatternT(eval, pattern + 1) ||
-        MatchPatternT(eval + 1, pattern + 1))
-      return true;
-  }
-
-  // This is a *, try to match all the possible substrings with the remainder
-  // of the pattern.
-  if (pattern[0] == '*') {
-    while (*eval) {
-      if (MatchPatternT(eval, pattern + 1))
-        return true;
-      eval++;
-    }
-
-    // We reached the end of the string, let see if the pattern contains only
-    // wildcards.
-    if (*eval == 0) {
-      EatWildcard(&pattern);
-      if (*pattern)
-        return false;
-      return true;
-    }
-  }
-
-  return false;
-}
-
-bool MatchPattern(const std::wstring& eval, const std::wstring& pattern) {
-  return MatchPatternT(eval.c_str(), pattern.c_str());
-}
-
-bool MatchPattern(const std::string& eval, const std::string& pattern) {
-  return MatchPatternT(eval.c_str(), pattern.c_str());
-}
-
 // For the various *ToInt conversions, there are no *ToIntTraits classes to use
 // because there's no such thing as strtoi.  Use *ToLongTraits through a cast
 // instead, requiring that long and int are compatible and equal-width.  They
 // are on our target platforms.
 
 // XXX Sigh.
 
 #if !defined(ARCH_CPU_64_BITS)
@@ -1460,94 +713,16 @@ bool StringToInt(const string16& input, 
 bool StringToInt64(const std::string& input, int64_t* output) {
   return StringToNumber<StringToInt64Traits>(input, output);
 }
 
 bool StringToInt64(const string16& input, int64_t* output) {
   return StringToNumber<String16ToInt64Traits>(input, output);
 }
 
-#if !defined(ARCH_CPU_64_BITS)
-bool HexStringToInt(const std::string& input, int* output) {
-  COMPILE_ASSERT(sizeof(int) == sizeof(long), cannot_strtol_to_int);
-  return StringToNumber<HexStringToLongTraits>(input,
-                                               reinterpret_cast<long*>(output));
-}
-
-bool HexStringToInt(const string16& input, int* output) {
-  COMPILE_ASSERT(sizeof(int) == sizeof(long), cannot_wcstol_to_int);
-  return StringToNumber<HexString16ToLongTraits>(
-      input, reinterpret_cast<long*>(output));
-}
-
-#else
-bool HexStringToInt(const std::string& input, int* output) {
-  long tmp;
-  bool ok = StringToNumber<HexStringToLongTraits>(input, &tmp);
-  if (!ok || tmp > kint32max) {
-    return false;
-  }
-  *output = static_cast<int>(tmp);
-  return true;
-}
-
-bool HexStringToInt(const string16& input, int* output) {
-  long tmp;
-  bool ok = StringToNumber<HexString16ToLongTraits>(input, &tmp);
-  if (!ok || tmp > kint32max) {
-    return false;
-  }
-  *output = static_cast<int>(tmp);
-  return true;
-}
-
-#endif // !defined(ARCH_CPU_64_BITS)
-
-namespace {
-
-template<class CHAR>
-bool HexDigitToIntT(const CHAR digit, uint8_t* val) {
-  if (digit >= '0' && digit <= '9')
-    *val = digit - '0';
-  else if (digit >= 'a' && digit <= 'f')
-    *val = 10 + digit - 'a';
-  else if (digit >= 'A' && digit <= 'F')
-    *val = 10 + digit - 'A';
-  else
-    return false;
-  return true;
-}
-
-template<typename STR>
-bool HexStringToBytesT(const STR& input, std::vector<uint8_t>* output) {
-  DCHECK(output->size() == 0);
-  int count = input.size();
-  if (count == 0 || (count % 2) != 0)
-    return false;
-  for (int i = 0; i < count / 2; ++i) {
-    uint8_t msb = 0;  // most significant 4 bits
-    uint8_t lsb = 0;  // least significant 4 bits
-    if (!HexDigitToIntT(input[i * 2], &msb) ||
-        !HexDigitToIntT(input[i * 2 + 1], &lsb))
-      return false;
-    output->push_back((msb << 4) | lsb);
-  }
-  return true;
-}
-
-}  // namespace
-
-bool HexStringToBytes(const std::string& input, std::vector<uint8_t>* output) {
-  return HexStringToBytesT(input, output);
-}
-
-bool HexStringToBytes(const string16& input, std::vector<uint8_t>* output) {
-  return HexStringToBytesT(input, output);
-}
-
 int StringToInt(const std::string& value) {
   int result;
   StringToInt(value, &result);
   return result;
 }
 
 int StringToInt(const string16& value) {
   int result;
@@ -1562,28 +737,16 @@ int64_t StringToInt64(const std::string&
 }
 
 int64_t StringToInt64(const string16& value) {
   int64_t result;
   StringToInt64(value, &result);
   return result;
 }
 
-int HexStringToInt(const std::string& value) {
-  int result;
-  HexStringToInt(value, &result);
-  return result;
-}
-
-int HexStringToInt(const string16& value) {
-  int result;
-  HexStringToInt(value, &result);
-  return result;
-}
-
 // The following code is compatible with the OpenBSD lcpy interface.  See:
 //   http://www.gratisoft.us/todd/papers/strlcpy.html
 //   ftp://ftp.openbsd.org/pub/OpenBSD/src/lib/libc/string/{wcs,str}lcpy.c
 
 namespace {
 
 template <typename CHAR>
 size_t lcpyT(CHAR* dst, const CHAR* src, size_t dst_size) {
@@ -1604,59 +767,8 @@ size_t lcpyT(CHAR* dst, const CHAR* src,
 }  // namespace
 
 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) {
   return lcpyT<char>(dst, src, dst_size);
 }
 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
   return lcpyT<wchar_t>(dst, src, dst_size);
 }
-
-bool ElideString(const std::wstring& input, int max_len, std::wstring* output) {
-  DCHECK(max_len >= 0);
-  if (static_cast<int>(input.length()) <= max_len) {
-    output->assign(input);
-    return false;
-  }
-
-  switch (max_len) {
-    case 0:
-      output->clear();
-      break;
-    case 1:
-      output->assign(input.substr(0, 1));
-      break;
-    case 2:
-      output->assign(input.substr(0, 2));
-      break;
-    case 3:
-      output->assign(input.substr(0, 1) + L"." +
-                     input.substr(input.length() - 1));
-      break;
-    case 4:
-      output->assign(input.substr(0, 1) + L".." +
-                     input.substr(input.length() - 1));
-      break;
-    default: {
-      int rstr_len = (max_len - 3) / 2;
-      int lstr_len = rstr_len + ((max_len - 3) % 2);
-      output->assign(input.substr(0, lstr_len) + L"..." +
-                     input.substr(input.length() - rstr_len));
-      break;
-    }
-  }
-
-  return true;
-}
-
-std::string HexEncode(const void* bytes, size_t size) {
-  static const char kHexChars[] = "0123456789ABCDEF";
-
-  // Each input byte creates two output hex characters.
-  std::string ret(size * 2, '\0');
-
-  for (size_t i = 0; i < size; ++i) {
-    char b = reinterpret_cast<const char*>(bytes)[i];
-    ret[(i * 2)] = kHexChars[(b >> 4) & 0xf];
-    ret[(i * 2) + 1] = kHexChars[b & 0xf];
-  }
-  return ret;
-}
--- a/ipc/chromium/src/base/string_util.h
+++ b/ipc/chromium/src/base/string_util.h
@@ -103,41 +103,16 @@ bool IsWprintfFormatPortable(const wchar
 #if defined(OS_WIN)
 #include "base/string_util_win.h"
 #elif defined(OS_POSIX)
 #include "base/string_util_posix.h"
 #else
 #error Define string operations appropriately for your platform
 #endif
 
-namespace base {
-// Returns a reference to a globally unique empty string that functions can
-// return.  Use this to avoid static construction of strings, not to replace
-// any and all uses of "std::string()" as nicer-looking sugar.
-// These functions are threadsafe.
-const std::string& EmptyString();
-const std::wstring& EmptyWString();
-const string16& EmptyString16();
-}
-
-extern const wchar_t kWhitespaceWide[];
-extern const char kWhitespaceASCII[];
-
-// Names of codepages (charsets) understood by icu.
-extern const char* const kCodepageUTF8;
-
-// Removes characters in trim_chars from the beginning and end of input.
-// NOTE: Safe to use the same variable for both input and output.
-bool TrimString(const std::wstring& input,
-                const wchar_t trim_chars[],
-                std::wstring* output);
-bool TrimString(const std::string& input,
-                const char trim_chars[],
-                std::string* output);
-
 // Trims any whitespace from either end of the input string.  Returns where
 // whitespace was found.
 // The non-wide version has two functions:
 // * TrimWhitespaceASCII()
 //   This function is for ASCII strings and only looks for ASCII whitespace;
 // * TrimWhitespaceUTF8()
 //   This function is for UTF-8 strings and looks for Unicode whitespace.
 // Please choose the best one according to your usage.
@@ -149,19 +124,16 @@ enum TrimPositions {
   TRIM_ALL      = TRIM_LEADING | TRIM_TRAILING
 };
 TrimPositions TrimWhitespace(const std::wstring& input,
                              TrimPositions positions,
                              std::wstring* output);
 TrimPositions TrimWhitespaceASCII(const std::string& input,
                                   TrimPositions positions,
                                   std::string* output);
-TrimPositions TrimWhitespaceUTF8(const std::string& input,
-                                 TrimPositions positions,
-                                 std::string* output);
 
 // Deprecated. This function is only for backward compatibility and calls
 // TrimWhitespaceASCII().
 TrimPositions TrimWhitespace(const std::string& input,
                              TrimPositions positions,
                              std::string* output);
 
 // Searches  for CR or LF characters.  Removes all contiguous whitespace
@@ -187,225 +159,20 @@ string16 ASCIIToUTF16(const std::string&
 // do the best it can and put the result in the output buffer. The versions that
 // return strings ignore this error and just return the best conversion
 // possible.
 bool WideToUTF8(const wchar_t* src, size_t src_len, std::string* output);
 std::string WideToUTF8(const std::wstring& wide);
 bool UTF8ToWide(const char* src, size_t src_len, std::wstring* output);
 std::wstring UTF8ToWide(const ::StringPiece& utf8);
 
-bool WideToUTF16(const wchar_t* src, size_t src_len, string16* output);
-string16 WideToUTF16(const std::wstring& wide);
-bool UTF16ToWide(const char16* src, size_t src_len, std::wstring* output);
-std::wstring UTF16ToWide(const string16& utf16);
-
-bool UTF8ToUTF16(const char* src, size_t src_len, string16* output);
-string16 UTF8ToUTF16(const std::string& utf8);
-bool UTF16ToUTF8(const char16* src, size_t src_len, std::string* output);
-std::string UTF16ToUTF8(const string16& utf16);
-
-// We are trying to get rid of wstring as much as possible, but it's too big
-// a mess to do it all at once.  These conversions should be used when we
-// really should just be passing a string16 around, but we haven't finished
-// porting whatever module uses wstring and the conversion is being used as a
-// stopcock.  This makes it easy to grep for the ones that should be removed.
-#if defined(OS_WIN)
-# define WideToUTF16Hack
-# define UTF16ToWideHack
-#else
-# define WideToUTF16Hack WideToUTF16
-# define UTF16ToWideHack UTF16ToWide
-#endif
-
-// Defines the error handling modes of WideToCodepage and CodepageToWide.
-class OnStringUtilConversionError {
- public:
-  enum Type {
-    // The function will return failure. The output buffer will be empty.
-    FAIL,
-
-    // The offending characters are skipped and the conversion will proceed as
-    // if they did not exist.
-    SKIP
-  };
-
- private:
-  OnStringUtilConversionError();
-};
-
-// Converts between wide strings and the encoding specified.  If the
-// encoding doesn't exist or the encoding fails (when on_error is FAIL),
-// returns false.
-bool WideToCodepage(const std::wstring& wide,
-                    const char* codepage_name,
-                    OnStringUtilConversionError::Type on_error,
-                    std::string* encoded);
-bool CodepageToWide(const std::string& encoded,
-                    const char* codepage_name,
-                    OnStringUtilConversionError::Type on_error,
-                    std::wstring* wide);
-
-// Converts the given wide string to the corresponding Latin1. This will fail
-// (return false) if any characters are more than 255.
-bool WideToLatin1(const std::wstring& wide, std::string* latin1);
-
-// Returns true if the specified string matches the criteria. How can a wide
-// string be 8-bit or UTF8? It contains only characters that are < 256 (in the
-// first case) or characters that use only 8-bits and whose 8-bit
-// representation looks like a UTF-8 string (the second case).
-bool IsString8Bit(const std::wstring& str);
-bool IsStringUTF8(const std::string& str);
-bool IsStringWideUTF8(const std::wstring& str);
 bool IsStringASCII(const std::wstring& str);
 bool IsStringASCII(const std::string& str);
 bool IsStringASCII(const string16& str);
 
-// ASCII-specific tolower.  The standard library's tolower is locale sensitive,
-// so we don't want to use it here.
-template <class Char> inline Char ToLowerASCII(Char c) {
-  return (c >= 'A' && c <= 'Z') ? (c + ('a' - 'A')) : c;
-}
-
-// Converts the elements of the given string.  This version uses a pointer to
-// clearly differentiate it from the non-pointer variant.
-template <class str> inline void StringToLowerASCII(str* s) {
-  for (typename str::iterator i = s->begin(); i != s->end(); ++i)
-    *i = ToLowerASCII(*i);
-}
-
-template <class str> inline str StringToLowerASCII(const str& s) {
-  // for std::string and std::wstring
-  str output(s);
-  StringToLowerASCII(&output);
-  return output;
-}
-
-// ASCII-specific toupper.  The standard library's toupper is locale sensitive,
-// so we don't want to use it here.
-template <class Char> inline Char ToUpperASCII(Char c) {
-  return (c >= 'a' && c <= 'z') ? (c + ('A' - 'a')) : c;
-}
-
-// Converts the elements of the given string.  This version uses a pointer to
-// clearly differentiate it from the non-pointer variant.
-template <class str> inline void StringToUpperASCII(str* s) {
-  for (typename str::iterator i = s->begin(); i != s->end(); ++i)
-    *i = ToUpperASCII(*i);
-}
-
-template <class str> inline str StringToUpperASCII(const str& s) {
-  // for std::string and std::wstring
-  str output(s);
-  StringToUpperASCII(&output);
-  return output;
-}
-
-// Compare the lower-case form of the given string against the given ASCII
-// string.  This is useful for doing checking if an input string matches some
-// token, and it is optimized to avoid intermediate string copies.  This API is
-// borrowed from the equivalent APIs in Mozilla.
-bool LowerCaseEqualsASCII(const std::string& a, const char* b);
-bool LowerCaseEqualsASCII(const std::wstring& a, const char* b);
-
-// Same thing, but with string iterators instead.
-bool LowerCaseEqualsASCII(std::string::const_iterator a_begin,
-                          std::string::const_iterator a_end,
-                          const char* b);
-bool LowerCaseEqualsASCII(std::wstring::const_iterator a_begin,
-                          std::wstring::const_iterator a_end,
-                          const char* b);
-bool LowerCaseEqualsASCII(const char* a_begin,
-                          const char* a_end,
-                          const char* b);
-bool LowerCaseEqualsASCII(const wchar_t* a_begin,
-                          const wchar_t* a_end,
-                          const char* b);
-
-// Returns true if str starts with search, or false otherwise.
-bool StartsWithASCII(const std::string& str,
-                     const std::string& search,
-                     bool case_sensitive);
-bool StartsWith(const std::wstring& str,
-                const std::wstring& search,
-                bool case_sensitive);
-
-// Determines the type of ASCII character, independent of locale (the C
-// library versions will change based on locale).
-template <typename Char>
-inline bool IsAsciiWhitespace(Char c) {
-  return c == ' ' || c == '\r' || c == '\n' || c == '\t';
-}
-template <typename Char>
-inline bool IsAsciiAlpha(Char c) {
-  return ((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z'));
-}
-template <typename Char>
-inline bool IsAsciiDigit(Char c) {
-  return c >= '0' && c <= '9';
-}
-
-// Returns true if it's a whitespace character.
-inline bool IsWhitespace(wchar_t c) {
-  return wcschr(kWhitespaceWide, c) != NULL;
-}
-
-// TODO(mpcomplete): Decide if we should change these names to KIBI, etc,
-// or if we should actually use metric units, or leave as is.
-enum DataUnits {
-  DATA_UNITS_BYTE = 0,
-  DATA_UNITS_KILOBYTE,
-  DATA_UNITS_MEGABYTE,
-  DATA_UNITS_GIGABYTE
-};
-
-// Return the unit type that is appropriate for displaying the amount of bytes
-// passed in.
-DataUnits GetByteDisplayUnits(int64_t bytes);
-
-// Return a byte string in human-readable format, displayed in units appropriate
-// specified by 'units', with an optional unit suffix.
-// Ex: FormatBytes(512, DATA_UNITS_KILOBYTE, true) => "0.5 KB"
-// Ex: FormatBytes(10*1024, DATA_UNITS_MEGABYTE, false) => "0.1"
-std::wstring FormatBytes(int64_t bytes, DataUnits units, bool show_units);
-
-// As above, but with "/s" units.
-// Ex: FormatSpeed(512, DATA_UNITS_KILOBYTE, true) => "0.5 KB/s"
-// Ex: FormatSpeed(10*1024, DATA_UNITS_MEGABYTE, false) => "0.1"
-std::wstring FormatSpeed(int64_t bytes, DataUnits units, bool show_units);
-
-// Return a number formated with separators in the user's locale way.
-// Ex: FormatNumber(1234567) => 1,234,567
-std::wstring FormatNumber(int64_t number);
-
-// Starting at |start_offset| (usually 0), replace the first instance of
-// |find_this| with |replace_with|.
-void ReplaceFirstSubstringAfterOffset(string16* str,
-                                      string16::size_type start_offset,
-                                      const string16& find_this,
-                                      const string16& replace_with);
-void ReplaceFirstSubstringAfterOffset(std::string* str,
-                                      std::string::size_type start_offset,
-                                      const std::string& find_this,
-                                      const std::string& replace_with);
-
-// Starting at |start_offset| (usually 0), look through |str| and replace all
-// instances of |find_this| with |replace_with|.
-//
-// This does entire substrings; use std::replace in <algorithm> for single
-// characters, for example:
-//   std::replace(str.begin(), str.end(), 'a', 'b');
-void ReplaceSubstringsAfterOffset(string16* str,
-                                  string16::size_type start_offset,
-                                  const string16& find_this,
-                                  const string16& replace_with);
-void ReplaceSubstringsAfterOffset(std::string* str,
-                                  std::string::size_type start_offset,
-                                  const std::string& find_this,
-                                  const std::string& replace_with);
-
 // Specialized string-conversion functions.
 std::string IntToString(int value);
 std::wstring IntToWString(int value);
 std::string UintToString(unsigned int value);
 std::wstring UintToWString(unsigned int value);
 std::string Int64ToString(int64_t value);
 std::wstring Int64ToWString(int64_t value);
 std::string Uint64ToString(uint64_t value);
@@ -424,65 +191,38 @@ std::wstring DoubleToWString(double valu
 //    will be set to the value of the number that was parsed.
 //  - No characters parseable as a number at the beginning of the string.
 //    |*output| will be set to 0.
 //  - Empty string.  |*output| will be set to 0.
 bool StringToInt(const std::string& input, int* output);
 bool StringToInt(const string16& input, int* output);
 bool StringToInt64(const std::string& input, int64_t* output);
 bool StringToInt64(const string16& input, int64_t* output);
-bool HexStringToInt(const std::string& input, int* output);
-bool HexStringToInt(const string16& input, int* output);
-
-// Similar to the previous functions, except that output is a vector of bytes.
-// |*output| will contain as many bytes as were successfully parsed prior to th