Merge bug 807883.
authorWan-Teh Chang <wtc@google.com>
Mon, 11 Feb 2013 18:03:06 -0800
changeset 131456 d1b8047ed4dba5ff8669b69534a4e4c416871591
parent 131455 9a6bef63fdc05d756079ec9d725a32ca822949a6 (current diff)
parent 131454 26cfbd9ed00ce53a0a2e09c72ee2a572c11a7628 (diff)
child 131457 04f8351eb2af9279a2d52b7023e116ad1badd68d
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs807883
milestone21.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
Merge bug 807883.
ipc/chromium/src/base/clipboard.cc
ipc/chromium/src/base/clipboard.h
ipc/chromium/src/base/clipboard_linux.cc
ipc/chromium/src/base/clipboard_mac.mm
ipc/chromium/src/base/clipboard_unittest.cc
ipc/chromium/src/base/clipboard_util.cc
ipc/chromium/src/base/clipboard_util.h
ipc/chromium/src/base/clipboard_win.cc
ipc/chromium/src/base/image_util.cc
ipc/chromium/src/base/image_util.h
ipc/chromium/src/base/json_reader.cc
ipc/chromium/src/base/json_reader.h
ipc/chromium/src/base/json_reader_unittest.cc
ipc/chromium/src/base/json_writer.cc
ipc/chromium/src/base/json_writer.h
ipc/chromium/src/base/json_writer_unittest.cc
ipc/chromium/src/chrome/common/accessibility_types.h
ipc/chromium/src/chrome/common/app_cache/app_cache_context_impl.cc
ipc/chromium/src/chrome/common/app_cache/app_cache_context_impl.h
ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher.cc
ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher.h
ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher_host.cc
ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher_host.h
ipc/chromium/src/chrome/common/chrome_plugin_api.h
ipc/chromium/src/chrome/common/chrome_plugin_lib.cc
ipc/chromium/src/chrome/common/chrome_plugin_lib.h
ipc/chromium/src/chrome/common/chrome_plugin_unittest.cc
ipc/chromium/src/chrome/common/chrome_plugin_util.cc
ipc/chromium/src/chrome/common/chrome_plugin_util.h
ipc/chromium/src/chrome/common/classfactory.cc
ipc/chromium/src/chrome/common/classfactory.h
ipc/chromium/src/chrome/common/extensions/url_pattern.cc
ipc/chromium/src/chrome/common/extensions/url_pattern.h
ipc/chromium/src/chrome/common/extensions/url_pattern_unittest.cc
ipc/chromium/src/chrome/common/extensions/user_script.cc
ipc/chromium/src/chrome/common/extensions/user_script.h
ipc/chromium/src/chrome/common/extensions/user_script_unittest.cc
ipc/chromium/src/chrome/common/gfx/DEPS
ipc/chromium/src/chrome/common/gfx/color_utils.cc
ipc/chromium/src/chrome/common/gfx/color_utils.h
ipc/chromium/src/chrome/common/gfx/emf.cc
ipc/chromium/src/chrome/common/gfx/emf.h
ipc/chromium/src/chrome/common/gfx/emf_unittest.cc
ipc/chromium/src/chrome/common/gfx/text_elider.cc
ipc/chromium/src/chrome/common/gfx/text_elider.h
ipc/chromium/src/chrome/common/gfx/text_elider_unittest.cc
ipc/chromium/src/chrome/common/gfx/utils.h
ipc/chromium/src/chrome/common/gtk_util.cc
ipc/chromium/src/chrome/common/gtk_util.h
ipc/chromium/src/chrome/common/important_file_writer.cc
ipc/chromium/src/chrome/common/important_file_writer.h
ipc/chromium/src/chrome/common/important_file_writer_unittest.cc
ipc/chromium/src/chrome/common/json_value_serializer.cc
ipc/chromium/src/chrome/common/json_value_serializer.h
ipc/chromium/src/chrome/common/json_value_serializer_perftest.cc
ipc/chromium/src/chrome/common/json_value_serializer_unittest.cc
ipc/chromium/src/chrome/common/jstemplate_builder.cc
ipc/chromium/src/chrome/common/jstemplate_builder.h
ipc/chromium/src/chrome/common/libxml_utils.cc
ipc/chromium/src/chrome/common/libxml_utils.h
ipc/chromium/src/chrome/common/logging_chrome.cc
ipc/chromium/src/chrome/common/logging_chrome.h
ipc/chromium/src/chrome/common/logging_chrome_uitest.cc
ipc/chromium/src/chrome/common/mru_cache.h
ipc/chromium/src/chrome/common/mru_cache_unittest.cc
ipc/chromium/src/chrome/common/native_web_keyboard_event.h
ipc/chromium/src/chrome/common/native_web_keyboard_event_linux.cc
ipc/chromium/src/chrome/common/native_web_keyboard_event_mac.mm
ipc/chromium/src/chrome/common/native_web_keyboard_event_win.cc
ipc/chromium/src/chrome/common/net/cache_uitest.cc
ipc/chromium/src/chrome/common/net/cookie_monster_sqlite.cc
ipc/chromium/src/chrome/common/net/cookie_monster_sqlite.h
ipc/chromium/src/chrome/common/net/dns.h
ipc/chromium/src/chrome/common/net/url_request_intercept_job.cc
ipc/chromium/src/chrome/common/net/url_request_intercept_job.h
ipc/chromium/src/chrome/common/net/url_util_unittest.cc
ipc/chromium/src/chrome/common/page_action.cc
ipc/chromium/src/chrome/common/page_action.h
ipc/chromium/src/chrome/common/page_transition_types.h
ipc/chromium/src/chrome/common/page_zoom.h
ipc/chromium/src/chrome/common/plugin_messages.h
ipc/chromium/src/chrome/common/plugin_messages_internal.h
ipc/chromium/src/chrome/common/pref_member.cc
ipc/chromium/src/chrome/common/pref_member.h
ipc/chromium/src/chrome/common/pref_member_unittest.cc
ipc/chromium/src/chrome/common/pref_names.cc
ipc/chromium/src/chrome/common/pref_names.h
ipc/chromium/src/chrome/common/pref_service.cc
ipc/chromium/src/chrome/common/pref_service.h
ipc/chromium/src/chrome/common/pref_service_uitest.cc
ipc/chromium/src/chrome/common/pref_service_unittest.cc
ipc/chromium/src/chrome/common/property_bag.cc
ipc/chromium/src/chrome/common/property_bag.h
ipc/chromium/src/chrome/common/property_bag_unittest.cc
ipc/chromium/src/chrome/common/quarantine_mac.h
ipc/chromium/src/chrome/common/quarantine_mac.mm
ipc/chromium/src/chrome/common/security_filter_peer.cc
ipc/chromium/src/chrome/common/security_filter_peer.h
ipc/chromium/src/chrome/common/sqlite_compiled_statement.cc
ipc/chromium/src/chrome/common/sqlite_compiled_statement.h
ipc/chromium/src/chrome/common/sqlite_utils.cc
ipc/chromium/src/chrome/common/sqlite_utils.h
ipc/chromium/src/chrome/common/temp_scaffolding_stubs.cc
ipc/chromium/src/chrome/common/temp_scaffolding_stubs.h
ipc/chromium/src/chrome/common/unzip.cc
ipc/chromium/src/chrome/common/unzip.h
ipc/chromium/src/chrome/common/unzip_unittest.cc
ipc/chromium/src/chrome/common/url_constants.cc
ipc/chromium/src/chrome/common/url_constants.h
ipc/chromium/src/chrome/common/visitedlink_common.cc
ipc/chromium/src/chrome/common/visitedlink_common.h
ipc/chromium/src/chrome/common/win_safe_util.cc
ipc/chromium/src/chrome/common/win_safe_util.h
ipc/chromium/src/chrome/common/worker_messages.h
ipc/chromium/src/chrome/common/worker_messages_internal.h
ipc/chromium/src/chrome/common/worker_thread_ticker.cc
ipc/chromium/src/chrome/common/worker_thread_ticker.h
ipc/chromium/src/chrome/common/worker_thread_ticker_unittest.cc
security/manager/ssl/src/nsSmartCardEvent.cpp
security/manager/ssl/src/nsSmartCardEvent.h
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -494,17 +494,17 @@ nsXMLHttpRequest::Initialize(nsISupports
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return NS_OK;
 }
 
 nsresult
 nsXMLHttpRequest::InitParameters(JSContext* aCx, const jsval* aParams)
 {
-  XMLHttpRequestParameters params;
+  mozilla::idl::XMLHttpRequestParameters params;
   nsresult rv = params.Init(aCx, aParams);
   NS_ENSURE_SUCCESS(rv, rv);
 
   InitParameters(params.mozAnon, params.mozSystem);
   return NS_OK;
 }
 
 void
--- a/content/events/src/DOMWheelEvent.cpp
+++ b/content/events/src/DOMWheelEvent.cpp
@@ -119,17 +119,17 @@ DOMWheelEvent::GetDeltaMode(uint32_t* aD
   *aDeltaMode = static_cast<widget::WheelEvent*>(mEvent)->deltaMode;
   return NS_OK;
 }
 
 nsresult
 DOMWheelEvent::InitFromCtor(const nsAString& aType,
                             JSContext* aCx, jsval* aVal)
 {
-  WheelEventInit d;
+  mozilla::idl::WheelEventInit d;
   nsresult rv = d.Init(aCx, aVal);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString modifierList;
   if (d.ctrlKey) {
     modifierList.AppendLiteral(NS_DOM_KEYNAME_CONTROL);
   }
   if (d.shiftKey) {
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -304,17 +304,17 @@ nsDOMEvent::Initialize(nsISupports* aOwn
   SetTrusted(trusted);
   return NS_OK;
 }
 
 nsresult
 nsDOMEvent::InitFromCtor(const nsAString& aType,
                          JSContext* aCx, jsval* aVal)
 {
-  mozilla::dom::EventInit d;
+  mozilla::idl::EventInit d;
   nsresult rv = d.Init(aCx, aVal);
   NS_ENSURE_SUCCESS(rv, rv);
   return InitEvent(aType, d.bubbles, d.cancelable);
 }
 
 NS_IMETHODIMP
 nsDOMEvent::GetEventPhase(uint16_t* aEventPhase)
 {
--- a/content/events/src/nsDOMMouseEvent.cpp
+++ b/content/events/src/nsDOMMouseEvent.cpp
@@ -149,17 +149,17 @@ nsDOMMouseEvent::InitMouseEvent(const ns
       return NS_ERROR_FAILURE;
   }
 }
 
 nsresult
 nsDOMMouseEvent::InitFromCtor(const nsAString& aType,
                               JSContext* aCx, jsval* aVal)
 {
-  mozilla::dom::MouseEventInit d;
+  mozilla::idl::MouseEventInit d;
   nsresult rv = d.Init(aCx, aVal);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = InitMouseEvent(aType, d.bubbles, d.cancelable,
                       d.view, d.detail, d.screenX, d.screenY,
                       d.clientX, d.clientY, 
                       d.ctrlKey, d.altKey, d.shiftKey, d.metaKey,
                       d.button, d.relatedTarget);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -167,17 +167,17 @@ nsDOMUIEvent::InitUIEvent(const nsAStrin
 
   return NS_OK;
 }
 
 nsresult
 nsDOMUIEvent::InitFromCtor(const nsAString& aType,
                            JSContext* aCx, jsval* aVal)
 {
-  mozilla::dom::UIEventInit d;
+  mozilla::idl::UIEventInit d;
   nsresult rv = d.Init(aCx, aVal);
   NS_ENSURE_SUCCESS(rv, rv);
   return InitUIEvent(aType, d.bubbles, d.cancelable, d.view, d.detail);
 }
 
 // ---- nsDOMNSUIEvent implementation -------------------
 nsIntPoint
 nsDOMUIEvent::GetPagePoint()
--- a/content/events/test/test_eventctors.html
+++ b/content/events/test/test_eventctors.html
@@ -556,16 +556,39 @@ e = new PopupBlockedEvent("hello",
                           { requestingWindow: window,
                             popupWindowFeatures: "features",
                             popupWindowName: "name"
                           });
 is(e.requestingWindow, window);
 is(e.popupWindowFeatures, "features");
 is(e.popupWindowName, "name");
 
+
+// SmartCardEvent
+
+try {
+  e = new SmartCardEvent();
+} catch(exp) {
+  ex = true;
+}
+ok(ex, "SmartCardEvent: First parameter is required!");
+ex = false;
+
+e = new SmartCardEvent("hello");
+ok(e.type, "hello", "SmartCardEvent: Wrong event type!");
+ok(!e.isTrusted, "SmartCardEvent: Event shouldn't be trusted!");
+ok(!e.bubbles, "SmartCardEvent: Event shouldn't bubble!");
+ok(!e.cancelable, "SmartCardEvent: Event shouldn't be cancelable!");
+is(e.tokenName, "");
+document.dispatchEvent(e);
+is(receivedEvent, e, "SmartCardEvent: Wrong event!");
+
+e = new SmartCardEvent("hello", { tokenName: "foo" });
+is(e.tokenName, "foo");
+
 // WheelEvent
 
 try {
   e = new WheelEvent();
 } catch(exp) {
   ex = true;
 }
 ok(ex, "WheelEvent: First parameter is required!");
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -185,17 +185,16 @@
 #include "nsIDOMCompositionEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsIDOMWheelEvent.h"
 #include "nsIDOMDragEvent.h"
 #include "nsIDOMCommandEvent.h"
 #include "nsIDOMBeforeUnloadEvent.h"
 #include "nsIDOMMutationEvent.h"
-#include "nsIDOMSmartCardEvent.h"
 #include "nsIDOMXULCommandEvent.h"
 #include "nsIDOMMessageEvent.h"
 #include "nsPaintRequest.h"
 #include "nsIDOMNotifyPaintEvent.h"
 #include "nsIDOMNotifyAudioAvailableEvent.h"
 #include "nsIDOMScrollAreaEvent.h"
 #include "nsIDOMTransitionEvent.h"
 #include "nsIDOMAnimationEvent.h"
@@ -555,17 +554,16 @@ static const char kDOMStringBundleURL[] 
  * the interfaces in DOMCI_CASTABLE_INTERFACES.
  */
 #define DOMCI_DATA_NO_CLASS(_dom_class)                                       \
 const uint32_t kDOMClassInfo_##_dom_class##_interfaces =                      \
   0;
 
 DOMCI_DATA_NO_CLASS(Crypto)
 DOMCI_DATA_NO_CLASS(CRMFObject)
-DOMCI_DATA_NO_CLASS(SmartCardEvent)
 DOMCI_DATA_NO_CLASS(ContentFrameMessageManager)
 DOMCI_DATA_NO_CLASS(ChromeMessageBroadcaster)
 DOMCI_DATA_NO_CLASS(ChromeMessageSender)
 
 DOMCI_DATA_NO_CLASS(DOMPrototype)
 DOMCI_DATA_NO_CLASS(DOMConstructor)
 
 #define NS_DEFINE_CLASSINFO_DATA_WITH_NAME(_class, _name, _helper,            \
@@ -1119,18 +1117,16 @@ static nsDOMClassInfoData sClassInfoData
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CanvasPattern, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(TextMetrics, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(MozCanvasPrintState, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
-  NS_DEFINE_CLASSINFO_DATA(SmartCardEvent, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(WindowUtils, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(XSLTProcessor, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(XPathExpression, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -2289,20 +2285,16 @@ nsDOMClassInfo::Init()
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(DeviceRotationRate, nsIDOMDeviceRotationRate)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceRotationRate)
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(SmartCardEvent, nsIDOMSmartCardEvent)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSmartCardEvent)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(MutationEvent, nsIDOMMutationEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMMutationEvent)
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(UIEvent, nsIDOMUIEvent)
     DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -240,19 +240,16 @@ DOMCI_CLASS(SVGZoomEvent)
 
 // Canvas
 DOMCI_CLASS(HTMLCanvasElement)
 DOMCI_CLASS(CanvasGradient)
 DOMCI_CLASS(CanvasPattern)
 DOMCI_CLASS(TextMetrics)
 DOMCI_CLASS(MozCanvasPrintState)
 
-// SmartCard Events
-DOMCI_CLASS(SmartCardEvent)
-
 // WindowUtils
 DOMCI_CLASS(WindowUtils)
 
 // XSLTProcessor
 DOMCI_CLASS(XSLTProcessor)
 
 // DOM Level 3 XPath objects
 DOMCI_CLASS(XPathExpression)
--- a/dom/camera/CameraControlImpl.cpp
+++ b/dom/camera/CameraControlImpl.cpp
@@ -5,16 +5,17 @@
 #include "base/basictypes.h"
 #include "DOMCameraPreview.h"
 #include "CameraRecorderProfiles.h"
 #include "CameraControlImpl.h"
 #include "CameraCommon.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
+using namespace mozilla::idl;
 
 CameraControlImpl::CameraControlImpl(uint32_t aCameraId, nsIThread* aCameraThread, uint64_t aWindowId)
   : mCameraId(aCameraId)
   , mCameraThread(aCameraThread)
   , mWindowId(aWindowId)
   , mFileFormat()
   , mMaxMeteringAreas(0)
   , mMaxFocusAreas(0)
--- a/dom/camera/CameraControlImpl.h
+++ b/dom/camera/CameraControlImpl.h
@@ -43,24 +43,24 @@ class CameraControlImpl : public ICamera
   friend class SetParameterTask;
   friend class GetParameterTask;
   friend class GetPreviewStreamVideoModeTask;
   friend class ReleaseHardwareTask;
 
 public:
   CameraControlImpl(uint32_t aCameraId, nsIThread* aCameraThread, uint64_t aWindowId);
 
-  nsresult GetPreviewStream(dom::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError);
+  nsresult GetPreviewStream(idl::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult StartPreview(DOMCameraPreview* aDOMPreview);
   void StopPreview();
   nsresult AutoFocus(nsICameraAutoFocusCallback* onSuccess, nsICameraErrorCallback* onError);
-  nsresult TakePicture(dom::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, dom::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError);
-  nsresult StartRecording(dom::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError);
+  nsresult TakePicture(idl::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, idl::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError);
+  nsresult StartRecording(idl::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult StopRecording();
-  nsresult GetPreviewStreamVideoMode(dom::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError);
+  nsresult GetPreviewStreamVideoMode(idl::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError);
   nsresult ReleaseHardware(nsICameraReleaseCallback* onSuccess, nsICameraErrorCallback* onError);
 
   nsresult Set(uint32_t aKey, const nsAString& aValue);
   nsresult Get(uint32_t aKey, nsAString& aValue);
   nsresult Set(uint32_t aKey, double aValue);
   nsresult Get(uint32_t aKey, double* aValue);
   nsresult Set(JSContext* aCx, uint32_t aKey, const JS::Value& aValue, uint32_t aLimit);
   nsresult Get(JSContext* aCx, uint32_t aKey, JS::Value* aValue);
@@ -82,22 +82,22 @@ public:
   }
 
   already_AddRefed<RecorderProfileManager> GetRecorderProfileManager();
   uint32_t GetCameraId() { return mCameraId; }
 
   virtual const char* GetParameter(const char* aKey) = 0;
   virtual const char* GetParameterConstChar(uint32_t aKey) = 0;
   virtual double GetParameterDouble(uint32_t aKey) = 0;
-  virtual void GetParameter(uint32_t aKey, nsTArray<dom::CameraRegion>& aRegions) = 0;
+  virtual void GetParameter(uint32_t aKey, nsTArray<idl::CameraRegion>& aRegions) = 0;
   virtual void SetParameter(const char* aKey, const char* aValue) = 0;
   virtual void SetParameter(uint32_t aKey, const char* aValue) = 0;
   virtual void SetParameter(uint32_t aKey, double aValue) = 0;
-  virtual void SetParameter(uint32_t aKey, const nsTArray<dom::CameraRegion>& aRegions) = 0;
-  virtual nsresult GetVideoSizes(nsTArray<dom::CameraSize>& aVideoSizes) = 0;
+  virtual void SetParameter(uint32_t aKey, const nsTArray<idl::CameraRegion>& aRegions) = 0;
+  virtual nsresult GetVideoSizes(nsTArray<idl::CameraSize>& aVideoSizes) = 0;
   virtual nsresult PushParameters() = 0;
   virtual void Shutdown();
 
   bool ReceiveFrame(void* aBuffer, ImageFormat aFormat, FrameBuilder aBuilder);
   void OnShutter();
   void OnClosed();
   void OnRecorderStateChange(const nsString& aStateMsg, int32_t aStatus, int32_t aTrackNumber);
 
@@ -212,17 +212,17 @@ protected:
   nsMainThreadPtrHandle<nsICameraPreviewStreamCallback> mOnSuccessCb;
   uint64_t mWindowId;
 };
 
 // Get the desired preview stream.
 class GetPreviewStreamTask : public nsRunnable
 {
 public:
-  GetPreviewStreamTask(CameraControlImpl* aCameraControl, dom::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
+  GetPreviewStreamTask(CameraControlImpl* aCameraControl, idl::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
     : mSize(aSize)
     , mCameraControl(aCameraControl)
     , mOnSuccessCb(new nsMainThreadPtrHolder<nsICameraPreviewStreamCallback>(onSuccess))
     , mOnErrorCb(new nsMainThreadPtrHolder<nsICameraErrorCallback>(onError))
   {
     DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
   }
 
@@ -238,17 +238,17 @@ public:
     if (NS_FAILED(rv)) {
       nsCOMPtr<nsIRunnable> cameraErrorResult = new CameraErrorResult(mOnErrorCb, NS_LITERAL_STRING("FAILURE"), mCameraControl->GetWindowId());
       rv = NS_DispatchToMainThread(cameraErrorResult);
       NS_ENSURE_SUCCESS(rv, rv);
     }
     return rv;
   }
 
-  dom::CameraSize mSize;
+  idl::CameraSize mSize;
   nsRefPtr<CameraControlImpl> mCameraControl;
   nsMainThreadPtrHandle<nsICameraPreviewStreamCallback> mOnSuccessCb;
   nsMainThreadPtrHandle<nsICameraErrorCallback> mOnErrorCb;
 };
 
 // Return the autofocus status to JS.  Runs on the main thread.
 class AutoFocusResult : public nsRunnable
 {
@@ -356,17 +356,17 @@ protected:
   nsMainThreadPtrHandle<nsICameraTakePictureCallback> mOnSuccessCb;
   uint64_t mWindowId;
 };
 
 // Capture a still image with the camera.
 class TakePictureTask : public nsRunnable
 {
 public:
-  TakePictureTask(CameraControlImpl* aCameraControl, bool aCancel, dom::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, dom::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError)
+  TakePictureTask(CameraControlImpl* aCameraControl, bool aCancel, idl::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, idl::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError)
     : mCameraControl(aCameraControl)
     , mCancel(aCancel)
     , mSize(aSize)
     , mRotation(aRotation)
     , mFileFormat(aFileFormat)
     , mPosition(aPosition)
     , mDateTime(aDateTime)
     , mOnSuccessCb(new nsMainThreadPtrHolder<nsICameraTakePictureCallback>(onSuccess))
@@ -391,20 +391,20 @@ public:
       rv = NS_DispatchToMainThread(cameraErrorResult);
       NS_ENSURE_SUCCESS(rv, rv);
     }
     return rv;
   }
 
   nsRefPtr<CameraControlImpl> mCameraControl;
   bool mCancel;
-  dom::CameraSize mSize;
+  idl::CameraSize mSize;
   int32_t mRotation;
   nsString mFileFormat;
-  dom::CameraPosition mPosition;
+  idl::CameraPosition mPosition;
   uint64_t mDateTime;
   nsMainThreadPtrHandle<nsICameraTakePictureCallback> mOnSuccessCb;
   nsMainThreadPtrHandle<nsICameraErrorCallback> mOnErrorCb;
 };
 
 // Return the result of starting recording.  Runs on the main thread.
 class StartRecordingResult : public nsRunnable
 {
@@ -430,17 +430,17 @@ protected:
   nsMainThreadPtrHandle<nsICameraStartRecordingCallback> mOnSuccessCb;
   uint64_t mWindowId;
 };
 
 // Start video recording.
 class StartRecordingTask : public nsRunnable
 {
 public:
-  StartRecordingTask(CameraControlImpl* aCameraControl, dom::CameraStartRecordingOptions aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId)
+  StartRecordingTask(CameraControlImpl* aCameraControl, idl::CameraStartRecordingOptions aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId)
     : mCameraControl(aCameraControl)
     , mOptions(aOptions)
     , mFolder(aFolder)
     , mFilename(aFilename)
     , mOnSuccessCb(new nsMainThreadPtrHolder<nsICameraStartRecordingCallback>(onSuccess))
     , mOnErrorCb(new nsMainThreadPtrHolder<nsICameraErrorCallback>(onError))
     , mWindowId(aWindowId)
   {
@@ -468,17 +468,17 @@ public:
     rv = NS_DispatchToMainThread(startRecordingResult);
     if (NS_FAILED(rv)) {
       DOM_CAMERA_LOGE("Failed to dispatch start recording result to main thread (%d)!", rv);
     }
     return rv;
   }
 
   nsRefPtr<CameraControlImpl> mCameraControl;
-  dom::CameraStartRecordingOptions mOptions;
+  idl::CameraStartRecordingOptions mOptions;
   nsCOMPtr<nsIFile> mFolder;
   nsString mFilename;
   nsMainThreadPtrHandle<nsICameraStartRecordingCallback> mOnSuccessCb;
   nsMainThreadPtrHandle<nsICameraErrorCallback> mOnErrorCb;
   uint64_t mWindowId;
 };
 
 // Stop video recording.
@@ -565,17 +565,17 @@ public:
 
   nsRefPtr<CameraControlImpl> mCameraControl;
 };
 
 // Get the video mode preview stream.
 class GetPreviewStreamVideoModeTask : public nsRunnable
 {
 public:
-  GetPreviewStreamVideoModeTask(CameraControlImpl* aCameraControl, dom::CameraRecorderOptions aOptions,  nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
+  GetPreviewStreamVideoModeTask(CameraControlImpl* aCameraControl, idl::CameraRecorderOptions aOptions,  nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError)
     : mCameraControl(aCameraControl)
     , mOptions(aOptions)
     , mOnSuccessCb(new nsMainThreadPtrHolder<nsICameraPreviewStreamCallback>(onSuccess))
     , mOnErrorCb(new nsMainThreadPtrHolder<nsICameraErrorCallback>(onError))
   { }
 
   NS_IMETHOD Run()
   {
@@ -587,17 +587,17 @@ public:
       nsCOMPtr<nsIRunnable> cameraErrorResult = new CameraErrorResult(mOnErrorCb, NS_LITERAL_STRING("FAILURE"), mCameraControl->GetWindowId());
       rv = NS_DispatchToMainThread(cameraErrorResult);
       NS_ENSURE_SUCCESS(rv, rv);
     }
     return NS_OK;
   }
 
   nsRefPtr<CameraControlImpl> mCameraControl;
-  dom::CameraRecorderOptions mOptions;
+  idl::CameraRecorderOptions mOptions;
   nsMainThreadPtrHandle<nsICameraPreviewStreamCallback> mOnSuccessCb;
   nsMainThreadPtrHandle<nsICameraErrorCallback> mOnErrorCb;
 };
 
 // Return the result of releasing the camera hardware.  Runs on the main thread.
 class ReleaseHardwareResult : public nsRunnable
 {
 public:
--- a/dom/camera/DOMCameraCapabilities.cpp
+++ b/dom/camera/DOMCameraCapabilities.cpp
@@ -345,17 +345,17 @@ DOMCameraCapabilities::GetZoomRatios(JSC
 }
 
 /* readonly attribute jsval videoSizes; */
 NS_IMETHODIMP
 DOMCameraCapabilities::GetVideoSizes(JSContext* cx, JS::Value* aVideoSizes)
 {
   NS_ENSURE_TRUE(mCamera, NS_ERROR_NOT_AVAILABLE);
 
-  nsTArray<CameraSize> sizes;
+  nsTArray<mozilla::idl::CameraSize> sizes;
   nsresult rv = mCamera->GetVideoSizes(sizes);
   NS_ENSURE_SUCCESS(rv, rv);
   if (sizes.Length() == 0) {
     // video recording not supported, return a null object
     *aVideoSizes = JSVAL_NULL;
     return NS_OK;
   }
 
--- a/dom/camera/DOMCameraControl.cpp
+++ b/dom/camera/DOMCameraControl.cpp
@@ -239,17 +239,17 @@ nsDOMCameraControl::SetOnRecorderStateCh
 
 /* [implicit_jscontext] void startRecording (in jsval aOptions, in nsIDOMDeviceStorage storageArea, in DOMString filename, in nsICameraStartRecordingCallback onSuccess, [optional] in nsICameraErrorCallback onError); */
 NS_IMETHODIMP
 nsDOMCameraControl::StartRecording(const JS::Value& aOptions, nsIDOMDeviceStorage* storageArea, const nsAString& filename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError, JSContext* cx)
 {
   NS_ENSURE_TRUE(onSuccess, NS_ERROR_INVALID_ARG);
   NS_ENSURE_TRUE(storageArea, NS_ERROR_INVALID_ARG);
 
-  CameraStartRecordingOptions options;
+  mozilla::idl::CameraStartRecordingOptions options;
 
   // Default values, until the dictionary parser can handle them.
   options.rotation = 0;
   options.maxFileSizeBytes = 0;
   options.maxVideoLengthMs = 0;
   nsresult rv = options.Init(cx, &aOptions);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -316,17 +316,17 @@ nsDOMCameraControl::StopRecording()
 }
 
 /* [implicit_jscontext] void getPreviewStream (in jsval aOptions, in nsICameraPreviewStreamCallback onSuccess, [optional] in nsICameraErrorCallback onError); */
 NS_IMETHODIMP
 nsDOMCameraControl::GetPreviewStream(const JS::Value& aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError, JSContext* cx)
 {
   NS_ENSURE_TRUE(onSuccess, NS_ERROR_INVALID_ARG);
 
-  CameraSize size;
+  mozilla::idl::CameraSize size;
   nsresult rv = size.Init(cx, &aOptions);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return mCameraControl->GetPreviewStream(size, onSuccess, onError);
 }
 
 /* void resumePreview(); */
 NS_IMETHODIMP
@@ -344,19 +344,19 @@ nsDOMCameraControl::AutoFocus(nsICameraA
 }
 
 /* void takePicture (in jsval aOptions, in nsICameraTakePictureCallback onSuccess, [optional] in nsICameraErrorCallback onError); */
 NS_IMETHODIMP
 nsDOMCameraControl::TakePicture(const JS::Value& aOptions, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError, JSContext* cx)
 {
   NS_ENSURE_TRUE(onSuccess, NS_ERROR_INVALID_ARG);
 
-  CameraPictureOptions  options;
-  CameraSize            size;
-  CameraPosition        pos;
+  mozilla::idl::CameraPictureOptions options;
+  mozilla::idl::CameraSize           size;
+  mozilla::idl::CameraPosition       pos;
 
   nsresult rv = options.Init(cx, &aOptions);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = size.Init(cx, &options.pictureSize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   /**
@@ -374,17 +374,17 @@ nsDOMCameraControl::TakePicture(const JS
 }
 
 /* [implicit_jscontext] void GetPreviewStreamVideoMode (in jsval aOptions, in nsICameraPreviewStreamCallback onSuccess, [optional] in nsICameraErrorCallback onError); */
 NS_IMETHODIMP
 nsDOMCameraControl::GetPreviewStreamVideoMode(const JS::Value& aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError, JSContext* cx)
 {
   NS_ENSURE_TRUE(onSuccess, NS_ERROR_INVALID_ARG);
 
-  CameraRecorderOptions options;
+  mozilla::idl::CameraRecorderOptions options;
   nsresult rv = options.Init(cx, &aOptions);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return mCameraControl->GetPreviewStreamVideoMode(&options, onSuccess, onError);
 }
 
 NS_IMETHODIMP
 nsDOMCameraControl::ReleaseHardware(nsICameraReleaseCallback* onSuccess, nsICameraErrorCallback* onError)
--- a/dom/camera/DOMCameraManager.cpp
+++ b/dom/camera/DOMCameraManager.cpp
@@ -103,17 +103,17 @@ nsDOMCameraManager::CheckPermissionAndCr
 
 /* [implicit_jscontext] void getCamera ([optional] in jsval aOptions, in nsICameraGetCameraCallback onSuccess, [optional] in nsICameraErrorCallback onError); */
 NS_IMETHODIMP
 nsDOMCameraManager::GetCamera(const JS::Value& aOptions, nsICameraGetCameraCallback* onSuccess, nsICameraErrorCallback* onError, JSContext* cx)
 {
   NS_ENSURE_TRUE(onSuccess, NS_ERROR_INVALID_ARG);
 
   uint32_t cameraId = 0;  // back (or forward-facing) camera by default
-  CameraSelector selector;
+  mozilla::idl::CameraSelector selector;
 
   nsresult rv = selector.Init(cx, &aOptions);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (selector.camera.EqualsASCII("front")) {
     cameraId = 1;
   }
 
--- a/dom/camera/FallbackCameraControl.cpp
+++ b/dom/camera/FallbackCameraControl.cpp
@@ -19,22 +19,22 @@ class RecorderProfileManager;
 class nsFallbackCameraControl : public CameraControlImpl
 {
 public:
   nsFallbackCameraControl(uint32_t aCameraId, nsIThread* aCameraThread, nsDOMCameraControl* aDOMCameraControl, nsICameraGetCameraCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId);
 
   const char* GetParameter(const char* aKey);
   const char* GetParameterConstChar(uint32_t aKey);
   double GetParameterDouble(uint32_t aKey);
-  void GetParameter(uint32_t aKey, nsTArray<dom::CameraRegion>& aRegions);
+  void GetParameter(uint32_t aKey, nsTArray<idl::CameraRegion>& aRegions);
   void SetParameter(const char* aKey, const char* aValue);
   void SetParameter(uint32_t aKey, const char* aValue);
   void SetParameter(uint32_t aKey, double aValue);
-  void SetParameter(uint32_t aKey, const nsTArray<dom::CameraRegion>& aRegions);
-  nsresult GetVideoSizes(nsTArray<CameraSize>& aVideoSizes);
+  void SetParameter(uint32_t aKey, const nsTArray<idl::CameraRegion>& aRegions);
+  nsresult GetVideoSizes(nsTArray<idl::CameraSize>& aVideoSizes);
   nsresult PushParameters();
 
 protected:
   ~nsFallbackCameraControl();
 
   nsresult GetPreviewStreamImpl(GetPreviewStreamTask* aGetPreviewStream);
   nsresult StartPreviewImpl(StartPreviewTask* aStartPreview);
   nsresult StopPreviewImpl(StopPreviewTask* aStopPreview);
@@ -92,17 +92,17 @@ nsFallbackCameraControl::GetParameterCon
 
 double
 nsFallbackCameraControl::GetParameterDouble(uint32_t aKey)
 {
   return NAN;
 }
 
 void
-nsFallbackCameraControl::GetParameter(uint32_t aKey, nsTArray<dom::CameraRegion>& aRegions)
+nsFallbackCameraControl::GetParameter(uint32_t aKey, nsTArray<idl::CameraRegion>& aRegions)
 {
 }
 
 void
 nsFallbackCameraControl::SetParameter(const char* aKey, const char* aValue)
 {
 }
 
@@ -112,17 +112,17 @@ nsFallbackCameraControl::SetParameter(ui
 }
 
 void
 nsFallbackCameraControl::SetParameter(uint32_t aKey, double aValue)
 {
 }
 
 void
-nsFallbackCameraControl::SetParameter(uint32_t aKey, const nsTArray<dom::CameraRegion>& aRegions)
+nsFallbackCameraControl::SetParameter(uint32_t aKey, const nsTArray<idl::CameraRegion>& aRegions)
 {
 }
 
 nsresult
 nsFallbackCameraControl::PushParameters()
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
@@ -177,17 +177,17 @@ nsFallbackCameraControl::PushParametersI
 
 nsresult
 nsFallbackCameraControl::PullParametersImpl()
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
-nsFallbackCameraControl::GetVideoSizes(nsTArray<CameraSize>& aVideoSizes)
+nsFallbackCameraControl::GetVideoSizes(nsTArray<idl::CameraSize>& aVideoSizes)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 already_AddRefed<RecorderProfileManager> 
 nsFallbackCameraControl::GetRecorderProfileManagerImpl()
 {
   return nullptr;
--- a/dom/camera/GonkCameraControl.cpp
+++ b/dom/camera/GonkCameraControl.cpp
@@ -400,17 +400,18 @@ nsGonkCameraControl::GetParameterDouble(
       return val;
 
     default:
       return mParams.getFloat(key);
   }
 }
 
 void
-nsGonkCameraControl::GetParameter(uint32_t aKey, nsTArray<CameraRegion>& aRegions)
+nsGonkCameraControl::GetParameter(uint32_t aKey,
+                                  nsTArray<idl::CameraRegion>& aRegions)
 {
   aRegions.Clear();
 
   const char* key = getKeyText(aKey);
   if (!key) {
     return;
   }
 
@@ -427,50 +428,51 @@ nsGonkCameraControl::GetParameter(uint32
 
   // count the number of regions in the string
   while ((p = strstr(p, "),("))) {
     ++count;
     p += 3;
   }
 
   aRegions.SetCapacity(count);
-  CameraRegion* r;
+  idl::CameraRegion* r;
 
   // parse all of the region sets
   uint32_t i;
   for (i = 0, p = value; p && i < count; ++i, p = strchr(p + 1, '(')) {
     r = aRegions.AppendElement();
     if (sscanf(p, "(%d,%d,%d,%d,%u)", &r->top, &r->left, &r->bottom, &r->right, &r->weight) != 5) {
       DOM_CAMERA_LOGE("%s:%d : region tuple has bad format: '%s'\n", __func__, __LINE__, p);
       aRegions.Clear();
       return;
     }
   }
 
   return;
 }
 
 void
-nsGonkCameraControl::GetParameter(uint32_t aKey, nsTArray<CameraSize>& aSizes)
+nsGonkCameraControl::GetParameter(uint32_t aKey,
+                                  nsTArray<idl::CameraSize>& aSizes)
 {
   const char* key = getKeyText(aKey);
   if (!key) {
     return;
   }
 
   RwAutoLockRead lock(mRwLock);
 
   const char* value = mParams.get(key);
   DOM_CAMERA_LOGI("key='%s' --> value='%s'\n", key, value);
   if (!value) {
     return;
   }
 
   const char* p = value;
-  CameraSize* s;
+  idl::CameraSize* s;
 
   // The 'value' string is in the format "w1xh1,w2xh2,w3xh3,..."
   while (p) {
     s = aSizes.AppendElement();
     if (sscanf(p, "%dx%d", &s->width, &s->height) != 2) {
       DOM_CAMERA_LOGE("%s:%d : size tuple has bad format: '%s'\n", __func__, __LINE__, p);
       aSizes.Clear();
       return;
@@ -558,17 +560,18 @@ nsGonkCameraControl::SetParameter(uint32
     } else {
       mParams.setFloat(key, aValue);
     }
   }
   PushParameters();
 }
 
 void
-nsGonkCameraControl::SetParameter(uint32_t aKey, const nsTArray<CameraRegion>& aRegions)
+nsGonkCameraControl::SetParameter(uint32_t aKey,
+                                  const nsTArray<idl::CameraRegion>& aRegions)
 {
   const char* key = getKeyText(aKey);
   if (!key) {
     return;
   }
 
   uint32_t length = aRegions.Length();
 
@@ -577,17 +580,17 @@ nsGonkCameraControl::SetParameter(uint32
     mParams.set(key, "(0,0,0,0,0)");
     PushParameters();
     return;
   }
 
   nsCString s;
 
   for (uint32_t i = 0; i < length; ++i) {
-    const CameraRegion* r = &aRegions[i];
+    const idl::CameraRegion* r = &aRegions[i];
     s.AppendPrintf("(%d,%d,%d,%d,%d),", r->top, r->left, r->bottom, r->right, r->weight);
   }
 
   // remove the trailing comma
   s.Trim(",", false, true, true);
 
   DOM_CAMERA_LOGI("camera region string '%s'\n", s.get());
 
@@ -698,17 +701,17 @@ void
 nsGonkCameraControl::SetupThumbnail(uint32_t aPictureWidth, uint32_t aPictureHeight, uint32_t aPercentQuality)
 {
   /**
    * Use the smallest non-0x0 thumbnail size that matches
    *  the aspect ratio of our parameters...
    */
   uint32_t smallestArea = UINT_MAX;
   uint32_t smallestIndex = UINT_MAX;
-  nsAutoTArray<CameraSize, 8> thumbnailSizes;
+  nsAutoTArray<idl::CameraSize, 8> thumbnailSizes;
   GetParameter(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, thumbnailSizes);
 
   for (uint32_t i = 0; i < thumbnailSizes.Length(); ++i) {
     uint32_t area = thumbnailSizes[i].width * thumbnailSizes[i].height;
     if (area != 0
       && area < smallestArea
       && thumbnailSizes[i].width * aPictureHeight / thumbnailSizes[i].height == aPictureWidth
     ) {
@@ -1339,17 +1342,17 @@ nsGonkCameraControl::ReleaseHardwareImpl
 
   return NS_OK;
 }
 
 already_AddRefed<GonkRecorderProfileManager>
 nsGonkCameraControl::GetGonkRecorderProfileManager()
 {
   if (!mProfileManager) {
-    nsTArray<CameraSize> sizes;
+    nsTArray<idl::CameraSize> sizes;
     nsresult rv = GetVideoSizes(sizes);
     NS_ENSURE_SUCCESS(rv, nullptr);
 
     mProfileManager = new GonkRecorderProfileManager(mCameraId);
     mProfileManager->SetSupportedResolutions(sizes);
   }
 
   nsRefPtr<GonkRecorderProfileManager> profileMgr = mProfileManager;
@@ -1359,34 +1362,34 @@ nsGonkCameraControl::GetGonkRecorderProf
 already_AddRefed<RecorderProfileManager>
 nsGonkCameraControl::GetRecorderProfileManagerImpl()
 {
   nsRefPtr<RecorderProfileManager> profileMgr = GetGonkRecorderProfileManager();
   return profileMgr.forget();
 }
 
 nsresult
-nsGonkCameraControl::GetVideoSizes(nsTArray<CameraSize>& aVideoSizes)
+nsGonkCameraControl::GetVideoSizes(nsTArray<idl::CameraSize>& aVideoSizes)
 {
   aVideoSizes.Clear();
 
   Vector<Size> sizes;
   mParams.getSupportedVideoSizes(sizes);
   if (sizes.size() == 0) {
     DOM_CAMERA_LOGI("Camera doesn't support video independent of the preview\n");
     mParams.getSupportedPreviewSizes(sizes);
   }
 
   if (sizes.size() == 0) {
     DOM_CAMERA_LOGW("Camera doesn't report any supported video sizes at all\n");
     return NS_OK;
   }
 
   for (size_t i = 0; i < sizes.size(); ++i) {
-    CameraSize size;
+    idl::CameraSize size;
     size.width = sizes[i].width;
     size.height = sizes[i].height;
     aVideoSizes.AppendElement(size);
   }
   return NS_OK;
 }
 
 // Gonk callback handlers.
--- a/dom/camera/GonkCameraControl.h
+++ b/dom/camera/GonkCameraControl.h
@@ -40,24 +40,24 @@ class nsGonkCameraControl : public Camer
 {
 public:
   nsGonkCameraControl(uint32_t aCameraId, nsIThread* aCameraThread, nsDOMCameraControl* aDOMCameraControl, nsICameraGetCameraCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId);
   nsresult Init();
 
   const char* GetParameter(const char* aKey);
   const char* GetParameterConstChar(uint32_t aKey);
   double GetParameterDouble(uint32_t aKey);
-  void GetParameter(uint32_t aKey, nsTArray<dom::CameraRegion>& aRegions);
-  void GetParameter(uint32_t aKey, nsTArray<dom::CameraSize>& aSizes);
+  void GetParameter(uint32_t aKey, nsTArray<idl::CameraRegion>& aRegions);
+  void GetParameter(uint32_t aKey, nsTArray<idl::CameraSize>& aSizes);
   void SetParameter(const char* aKey, const char* aValue);
   void SetParameter(uint32_t aKey, const char* aValue);
   void SetParameter(uint32_t aKey, double aValue);
-  void SetParameter(uint32_t aKey, const nsTArray<dom::CameraRegion>& aRegions);
+  void SetParameter(uint32_t aKey, const nsTArray<idl::CameraRegion>& aRegions);
   void SetParameter(uint32_t aKey, int aValue);
-  nsresult GetVideoSizes(nsTArray<dom::CameraSize>& aVideoSizes);
+  nsresult GetVideoSizes(nsTArray<idl::CameraSize>& aVideoSizes);
   nsresult PushParameters();
 
   void AutoFocusComplete(bool aSuccess);
   void TakePictureComplete(uint8_t* aData, uint32_t aLength);
   void HandleRecorderEvent(int msg, int ext1, int ext2);
 
 protected:
   ~nsGonkCameraControl();
--- a/dom/camera/GonkRecorderProfiles.h
+++ b/dom/camera/GonkRecorderProfiles.h
@@ -81,17 +81,17 @@ class GonkRecorderProfileManager : publi
 public:
   GonkRecorderProfileManager(uint32_t aCameraId);
 
   /**
    * Call this function to indicate that the specified resolutions are in fact
    * supported by the camera hardware.  (Just because it appears in a recorder
    * profile doesn't mean the hardware can handle it.)
    */
-  void SetSupportedResolutions(const nsTArray<dom::CameraSize>& aSizes)
+  void SetSupportedResolutions(const nsTArray<idl::CameraSize>& aSizes)
     { mSupportedSizes = aSizes; }
 
   /**
    * Call this function to remove all resolutions set by calling
    * SetSupportedResolutions().
    */
   void ClearSupportedResolutions() { mSupportedSizes.Clear(); }
 
@@ -99,14 +99,14 @@ public:
 
   already_AddRefed<RecorderProfile> Get(uint32_t aQualityIndex) const;
   already_AddRefed<GonkRecorderProfile> Get(const char* aProfileName) const;
   nsresult ConfigureRecorder(android::GonkRecorder* aRecorder);
 
 protected:
   virtual ~GonkRecorderProfileManager();
 
-  nsTArray<dom::CameraSize> mSupportedSizes;
+  nsTArray<idl::CameraSize> mSupportedSizes;
 };
 
 }; // namespace mozilla
 
 #endif // DOM_CAMERA_GONK_RECORDER_PROFILES_H
--- a/dom/camera/ICameraControl.h
+++ b/dom/camera/ICameraControl.h
@@ -17,52 +17,52 @@ namespace mozilla {
 class DOMCameraPreview;
 class RecorderProfileManager;
 
 class ICameraControl
 {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ICameraControl)
 
-  virtual nsresult GetPreviewStream(dom::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult GetPreviewStream(idl::CameraSize aSize, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult StartPreview(DOMCameraPreview* aDOMPreview) = 0;
   virtual void StopPreview() = 0;
   virtual nsresult AutoFocus(nsICameraAutoFocusCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
-  virtual nsresult TakePicture(dom::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, dom::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
-  virtual nsresult StartRecording(dom::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult TakePicture(idl::CameraSize aSize, int32_t aRotation, const nsAString& aFileFormat, idl::CameraPosition aPosition, uint64_t aDateTime, nsICameraTakePictureCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult StartRecording(idl::CameraStartRecordingOptions* aOptions, nsIFile* aFolder, const nsAString& aFilename, nsICameraStartRecordingCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult StopRecording() = 0;
-  virtual nsresult GetPreviewStreamVideoMode(dom::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
+  virtual nsresult GetPreviewStreamVideoMode(idl::CameraRecorderOptions* aOptions, nsICameraPreviewStreamCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
   virtual nsresult ReleaseHardware(nsICameraReleaseCallback* onSuccess, nsICameraErrorCallback* onError) = 0;
 
   virtual nsresult Set(uint32_t aKey, const nsAString& aValue) = 0;
   virtual nsresult Get(uint32_t aKey, nsAString& aValue) = 0;
   virtual nsresult Set(uint32_t aKey, double aValue) = 0;
   virtual nsresult Get(uint32_t aKey, double* aValue) = 0;
   virtual nsresult Set(JSContext* aCx, uint32_t aKey, const JS::Value& aValue, uint32_t aLimit) = 0;
   virtual nsresult Get(JSContext* aCx, uint32_t aKey, JS::Value* aValue) = 0;
   virtual nsresult Set(nsICameraShutterCallback* aOnShutter) = 0;
   virtual nsresult Get(nsICameraShutterCallback** aOnShutter) = 0;
   virtual nsresult Set(nsICameraClosedCallback* aOnClosed) = 0;
   virtual nsresult Get(nsICameraClosedCallback** aOnClosed) = 0;
   virtual nsresult Set(nsICameraRecorderStateChange* aOnRecorderStateChange) = 0;
   virtual nsresult Get(nsICameraRecorderStateChange** aOnRecorderStateChange) = 0;
   virtual nsresult SetFocusAreas(JSContext* aCx, const JS::Value& aValue) = 0;
   virtual nsresult SetMeteringAreas(JSContext* aCx, const JS::Value& aValue) = 0;
-  virtual nsresult GetVideoSizes(nsTArray<dom::CameraSize>& aVideoSizes) = 0;
+  virtual nsresult GetVideoSizes(nsTArray<idl::CameraSize>& aVideoSizes) = 0;
   virtual already_AddRefed<RecorderProfileManager> GetRecorderProfileManager() = 0;
   virtual uint32_t GetCameraId() = 0;
 
   virtual const char* GetParameter(const char* aKey) = 0;
   virtual const char* GetParameterConstChar(uint32_t aKey) = 0;
   virtual double GetParameterDouble(uint32_t aKey) = 0;
-  virtual void GetParameter(uint32_t aKey, nsTArray<dom::CameraRegion>& aRegions) = 0;
+  virtual void GetParameter(uint32_t aKey, nsTArray<idl::CameraRegion>& aRegions) = 0;
   virtual void SetParameter(const char* aKey, const char* aValue) = 0;
   virtual void SetParameter(uint32_t aKey, const char* aValue) = 0;
   virtual void SetParameter(uint32_t aKey, double aValue) = 0;
-  virtual void SetParameter(uint32_t aKey, const nsTArray<dom::CameraRegion>& aRegions) = 0;
+  virtual void SetParameter(uint32_t aKey, const nsTArray<idl::CameraRegion>& aRegions) = 0;
 
   virtual void Shutdown() = 0;
 
 protected:
   virtual ~ICameraControl() { }
 };
 
 } // namespace mozilla
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -2156,17 +2156,17 @@ nsDOMDeviceStorage::EnumerateEditable(co
   return EnumerateInternal(aName, aOptions, aCx, aArgc, true, aRetval);
 }
 
 
 static PRTime
 ExtractDateFromOptions(JSContext* aCx, const JS::Value& aOptions)
 {
   PRTime result = 0;
-  DeviceStorageEnumerationParameters params;
+  mozilla::idl::DeviceStorageEnumerationParameters params;
   if (!JSVAL_IS_VOID(aOptions) && !aOptions.isNull()) {
     nsresult rv = params.Init(aCx, &aOptions);
     if (NS_SUCCEEDED(rv) && !JSVAL_IS_VOID(params.since) && !params.since.isNull() && params.since.isObject()) {
       JSObject* obj = JSVAL_TO_OBJECT(params.since);
       if (JS_ObjectIsDate(aCx, obj) && js_DateIsValid(obj)) {
         result = js_DateGetMsecSinceEpoch(obj);
       }
     }
--- a/dom/file/ArchiveReader.h
+++ b/dom/file/ArchiveReader.h
@@ -92,14 +92,14 @@ protected:
   nsTArray<nsRefPtr<ArchiveRequest> > mRequests;
 
   // Everything related to the blobs and the status:
   struct {
     nsTArray<nsCOMPtr<nsIDOMFile> > fileList;
     nsresult status;
   } mData;
 
-  ArchiveReaderOptions mOptions;
+  mozilla::idl::ArchiveReaderOptions mOptions;
 };
 
 END_FILE_NAMESPACE
 
 #endif // mozilla_dom_file_domarchivereader_h__
--- a/dom/file/ArchiveZipEvent.cpp
+++ b/dom/file/ArchiveZipEvent.cpp
@@ -17,17 +17,17 @@ using namespace mozilla::dom;
 USING_FILE_NAMESPACE
 
 #ifndef PATH_MAX
 #  define PATH_MAX 65536 // The filename length is stored in 2 bytes
 #endif
 
 ArchiveZipItem::ArchiveZipItem(const char* aFilename,
                                const ZipCentral& aCentralStruct,
-                               const ArchiveReaderOptions& aOptions)
+                               const mozilla::idl::ArchiveReaderOptions& aOptions)
 : mFilename(aFilename),
   mCentralStruct(aCentralStruct),
   mOptions(aOptions)
 {
   MOZ_COUNT_CTOR(ArchiveZipItem);
 }
 
 ArchiveZipItem::~ArchiveZipItem()
@@ -106,17 +106,17 @@ uint16_t
 ArchiveZipItem::StrToInt16(const uint8_t* aStr)
 {
   return (uint16_t) ((aStr [0]) | (aStr [1] << 8));
 }
 
 // ArchiveReaderZipEvent
 
 ArchiveReaderZipEvent::ArchiveReaderZipEvent(ArchiveReader* aArchiveReader,
-                                             const ArchiveReaderOptions& aOptions)
+                                             const mozilla::idl::ArchiveReaderOptions& aOptions)
 : ArchiveReaderEvent(aArchiveReader),
   mOptions(aOptions)
 {
 }
 
 // NOTE: this runs in a different thread!!
 nsresult
 ArchiveReaderZipEvent::Exec()
--- a/dom/file/ArchiveZipEvent.h
+++ b/dom/file/ArchiveZipEvent.h
@@ -19,17 +19,17 @@ BEGIN_FILE_NAMESPACE
 /**
  * ArchiveZipItem - ArchiveItem for ArchiveReaderZipEvent
  */
 class ArchiveZipItem : public ArchiveItem
 {
 public:
   ArchiveZipItem(const char* aFilename,
                  const ZipCentral& aCentralStruct,
-                 const ArchiveReaderOptions& aOptions);
+                 const mozilla::idl::ArchiveReaderOptions& aOptions);
   virtual ~ArchiveZipItem();
 
   nsresult GetFilename(nsString& aFilename);
 
   // From zipItem to DOMFile:
   virtual nsIDOMFile* File(ArchiveReader* aArchiveReader);
 
 public: // for the event
@@ -40,30 +40,30 @@ private:
   nsresult ConvertFilename();
 
 private: // data
   nsCString mFilename;
 
   nsString mFilenameU;
   ZipCentral mCentralStruct;
 
-  ArchiveReaderOptions mOptions;
+  mozilla::idl::ArchiveReaderOptions mOptions;
 };
 
 /**
  * ArchiveReaderEvent implements the ArchiveReaderEvent for the ZIP format
  */
 class ArchiveReaderZipEvent : public ArchiveReaderEvent
 {
 public:
   ArchiveReaderZipEvent(ArchiveReader* aArchiveReader,
-                        const ArchiveReaderOptions& aOptions);
+                        const mozilla::idl::ArchiveReaderOptions& aOptions);
 
   nsresult Exec();
 
 private:
-  ArchiveReaderOptions mOptions;
+  mozilla::idl::ArchiveReaderOptions mOptions;
 };
 
 END_FILE_NAMESPACE
 
 #endif // mozilla_dom_file_domarchivezipevent_h__
 
--- a/dom/file/MetadataHelper.h
+++ b/dom/file/MetadataHelper.h
@@ -68,17 +68,17 @@ public:
 
   int64_t
   LastModified() const
   {
     return mLastModified;
   }
 
 private:
-  DOMFileMetadataParameters mConfig;
+  mozilla::idl::DOMFileMetadataParameters mConfig;
 
   uint64_t mSize;
   int64_t mLastModified;
 };
 
 class MetadataHelper : public FileHelper
 {
 public:
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -500,17 +500,17 @@ IDBDatabase::CreateObjectStore(const nsA
 
   if (!transaction ||
       transaction->GetMode() != IDBTransaction::VERSION_CHANGE) {
     return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
   }
 
   DatabaseInfo* databaseInfo = transaction->DBInfo();
 
-  mozilla::dom::IDBObjectStoreParameters params;
+  mozilla::idl::IDBObjectStoreParameters params;
   KeyPath keyPath(0);
 
   nsresult rv;
 
   if (!JSVAL_IS_VOID(aOptions) && !JSVAL_IS_NULL(aOptions)) {
     rv = params.Init(aCx, &aOptions);
     if (NS_FAILED(rv)) {
       return rv;
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -2546,17 +2546,17 @@ IDBObjectStore::CreateIndex(const nsAStr
   for (uint32_t index = 0; index < mCreatedIndexes.Length(); index++) {
     if (mCreatedIndexes[index]->Name() == aName) {
       NS_ERROR("Already created this one!");
     }
   }
 #endif
 
   nsresult rv;
-  mozilla::dom::IDBIndexParameters params;
+  mozilla::idl::IDBIndexParameters params;
 
   // Get optional arguments.
   if (!JSVAL_IS_VOID(aOptions) && !JSVAL_IS_NULL(aOptions)) {
     rv = params.Init(aCx, &aOptions);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
--- a/dom/interfaces/events/nsIDOMSmartCardEvent.idl
+++ b/dom/interfaces/events/nsIDOMSmartCardEvent.idl
@@ -1,13 +1,27 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(3747df70-e31a-4399-a394-0f5f969874b5)]
+%{C++
+#define SMARTCARDEVENT_INSERT "smartcard-insert"
+#define SMARTCARDEVENT_REMOVE "smartcard-remove"
+%}
+
+[scriptable, builtinclass, uuid(cd251f11-7020-4f85-a7bd-94c98d884fa7)]
 interface nsIDOMSmartCardEvent : nsIDOMEvent
 {
   readonly attribute DOMString   tokenName;
-  [noscript] void Init(in nsIDOMEvent event);
+  [noscript] void initSmartCardEvent(in DOMString aTypeArg,
+                                     in boolean aCanBubbleArg,
+                                     in boolean aCancelableArg,
+                                     in DOMString aTokenNAme);
 };
+
+dictionary SmartCardEventInit : EventInit
+{
+  DOMString tokenName;
+};
+
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2152,17 +2152,17 @@ ContentParent::RecvAddGeolocationListene
   RecvRemoveGeolocationListener();
 
   nsCOMPtr<nsIDOMGeoGeolocation> geo = do_GetService("@mozilla.org/geolocation;1");
   if (!geo) {
     return true;
   }
 
   nsRefPtr<nsGeolocation> geosvc = static_cast<nsGeolocation*>(geo.get());
-  nsAutoPtr<mozilla::dom::GeoPositionOptions> options(new mozilla::dom::GeoPositionOptions());
+  nsAutoPtr<mozilla::idl::GeoPositionOptions> options(new mozilla::idl::GeoPositionOptions());
   jsval null = JS::NullValue();
   options->Init(nullptr, &null);
   geosvc->WatchPosition(this, nullptr, options.forget(), &mGeolocationWatchID);
   return true;
 }
 
 bool
 ContentParent::RecvRemoveGeolocationListener()
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -528,17 +528,18 @@ PluginModuleParent::EvaluateHangUIState(
     }
     mIsTimerReset = false;
     SetChildTimeout(autoStopSecs);
 }
 
 bool
 PluginModuleParent::GetPluginName(nsAString& aPluginName)
 {
-    nsPluginHost* host = nsPluginHost::GetInst();
+    nsRefPtr<nsPluginHost> host = 
+        dont_AddRef<nsPluginHost>(nsPluginHost::GetInst());
     if (!host) {
         return false;
     }
     nsPluginTag* pluginTag = host->TagForPlugin(mPlugin);
     if (!pluginTag) {
         return false;
     }
     CopyUTF8toUTF16(pluginTag->mName, aPluginName);
--- a/dom/sms/src/SmsRequest.cpp
+++ b/dom/sms/src/SmsRequest.cpp
@@ -471,17 +471,17 @@ SmsRequest::NotifyThreadList(const jsval
 
       for (uint32_t i = 0; i < length; i++) {
         jsval arrayEntry;
         ok = JS_GetElement(aCx, array, i, &arrayEntry);
         NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
 
         MOZ_ASSERT(arrayEntry.isObject());
 
-        SmsThreadListItem item;
+        mozilla::idl::SmsThreadListItem item;
         nsresult rv = item.Init(aCx, &arrayEntry);
         NS_ENSURE_SUCCESS(rv, rv);
 
         ThreadListItem* ipcItem = ipcItems.AppendElement();
         ipcItem->senderOrReceiver() = item.senderOrReceiver;
         ipcItem->timestamp() = item.timestamp;
         ipcItem->body() = item.body;
         ipcItem->unreadCount() = item.unreadCount;
--- a/dom/src/geolocation/nsGeolocation.cpp
+++ b/dom/src/geolocation/nsGeolocation.cpp
@@ -281,17 +281,17 @@ nsDOMGeoPositionError::NotifyCallback(ns
 }
 ////////////////////////////////////////////////////
 // nsGeolocationRequest
 ////////////////////////////////////////////////////
 
 nsGeolocationRequest::nsGeolocationRequest(nsGeolocation* aLocator,
                                            nsIDOMGeoPositionCallback* aCallback,
                                            nsIDOMGeoPositionErrorCallback* aErrorCallback,
-                                           mozilla::dom::GeoPositionOptions* aOptions,
+                                           mozilla::idl::GeoPositionOptions* aOptions,
                                            bool aWatchPositionRequest,
                                            int32_t aWatchId)
   : mAllowed(false),
     mCleared(false),
     mIsFirstUpdate(true),
     mIsWatchPositionRequest(aWatchPositionRequest),
     mCallback(aCallback),
     mErrorCallback(aErrorCallback),
@@ -301,23 +301,23 @@ nsGeolocationRequest::nsGeolocationReque
 {
 }
 
 nsGeolocationRequest::~nsGeolocationRequest()
 {
 }
 
 
-static mozilla::dom::GeoPositionOptions*
+static mozilla::idl::GeoPositionOptions*
 OptionsFromJSOptions(JSContext* aCx, const jsval& aOptions, nsresult* aRv)
 {
   *aRv = NS_OK;
-  nsAutoPtr<mozilla::dom::GeoPositionOptions> options(nullptr);
+  nsAutoPtr<mozilla::idl::GeoPositionOptions> options(nullptr);
   if (aCx && !JSVAL_IS_VOID(aOptions) && !JSVAL_IS_NULL(aOptions)) {
-    options = new mozilla::dom::GeoPositionOptions();
+    options = new mozilla::idl::GeoPositionOptions();
     nsresult rv = options->Init(aCx, &aOptions);
     if (NS_FAILED(rv)) {
       *aRv = rv;
       return nullptr;
     }
   }
   return options.forget();
 }
@@ -1245,26 +1245,26 @@ nsGeolocation::Update(nsIDOMGeoPosition 
 
 NS_IMETHODIMP
 nsGeolocation::GetCurrentPosition(nsIDOMGeoPositionCallback *callback,
                                   nsIDOMGeoPositionErrorCallback *errorCallback,
                                   const jsval& jsoptions,
                                   JSContext* cx)
 {
   nsresult rv;
-  nsAutoPtr<mozilla::dom::GeoPositionOptions> options(
+  nsAutoPtr<mozilla::idl::GeoPositionOptions> options(
       OptionsFromJSOptions(cx, jsoptions, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   return GetCurrentPosition(callback, errorCallback, options.forget());
 }
 
 nsresult
 nsGeolocation::GetCurrentPosition(nsIDOMGeoPositionCallback *callback,
                                   nsIDOMGeoPositionErrorCallback *errorCallback,
-                                  mozilla::dom::GeoPositionOptions *options)
+                                  mozilla::idl::GeoPositionOptions *options)
 {
   NS_ENSURE_ARG_POINTER(callback);
 
   if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsRefPtr<nsGeolocationRequest> request = new nsGeolocationRequest(this,
@@ -1318,26 +1318,26 @@ nsGeolocation::GetCurrentPositionReady(n
 NS_IMETHODIMP
 nsGeolocation::WatchPosition(nsIDOMGeoPositionCallback *callback,
                              nsIDOMGeoPositionErrorCallback *errorCallback,
                              const jsval& jsoptions,
                              JSContext* cx,
                              int32_t *_retval)
 {
   nsresult rv;
-  nsAutoPtr<mozilla::dom::GeoPositionOptions> options(
+  nsAutoPtr<mozilla::idl::GeoPositionOptions> options(
       OptionsFromJSOptions(cx, jsoptions, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   return WatchPosition(callback, errorCallback, options.forget(), _retval);
 }
 
 nsresult
 nsGeolocation::WatchPosition(nsIDOMGeoPositionCallback *callback,
                              nsIDOMGeoPositionErrorCallback *errorCallback,
-                             mozilla::dom::GeoPositionOptions *options,
+                             mozilla::idl::GeoPositionOptions *options,
                              int32_t *_retval)
 {
   NS_ENSURE_ARG_POINTER(callback);
 
   if (mWatchingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
--- a/dom/src/geolocation/nsGeolocation.h
+++ b/dom/src/geolocation/nsGeolocation.h
@@ -48,17 +48,17 @@ class nsGeolocationRequest
   NS_DECL_NSICONTENTPERMISSIONREQUEST
   NS_DECL_NSITIMERCALLBACK
 
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsGeolocationRequest, nsIContentPermissionRequest)
 
   nsGeolocationRequest(nsGeolocation* locator,
                        nsIDOMGeoPositionCallback* callback,
                        nsIDOMGeoPositionErrorCallback* errorCallback,
-                       mozilla::dom::GeoPositionOptions* aOptions,
+                       mozilla::idl::GeoPositionOptions* aOptions,
                        bool watchPositionRequest = false,
                        int32_t watchId = 0);
   void Shutdown();
 
   // Called by the geolocation device to notify that a location has changed.
   // isBetter: the accuracy is as good or better than the previous position. 
   bool Update(nsIDOMGeoPosition* aPosition, bool aIsBetter);
 
@@ -81,17 +81,17 @@ class nsGeolocationRequest
   bool mAllowed;
   bool mCleared;
   bool mIsFirstUpdate;
   bool mIsWatchPositionRequest;
 
   nsCOMPtr<nsITimer> mTimeoutTimer;
   nsCOMPtr<nsIDOMGeoPositionCallback> mCallback;
   nsCOMPtr<nsIDOMGeoPositionErrorCallback> mErrorCallback;
-  nsAutoPtr<mozilla::dom::GeoPositionOptions> mOptions;
+  nsAutoPtr<mozilla::idl::GeoPositionOptions> mOptions;
 
   nsRefPtr<nsGeolocation> mLocator;
 
   int32_t mWatchId;
 };
 
 /**
  * Singleton that manages the geolocation provider
@@ -199,21 +199,21 @@ public:
   bool WindowOwnerStillExists();
 
   // Notification from the service:
   void ServiceReady();
 
   // Versions of the DOM APIs that don't require JS option values
   nsresult WatchPosition(nsIDOMGeoPositionCallback *callback,
                          nsIDOMGeoPositionErrorCallback *errorCallback,
-                         mozilla::dom::GeoPositionOptions *options,
+                         mozilla::idl::GeoPositionOptions *options,
                          int32_t *_retval);
   nsresult GetCurrentPosition(nsIDOMGeoPositionCallback *callback,
                               nsIDOMGeoPositionErrorCallback *errorCallback,
-                              mozilla::dom::GeoPositionOptions *options);
+                              mozilla::idl::GeoPositionOptions *options);
 private:
 
   ~nsGeolocation();
 
   bool RegisterRequestWithPrompt(nsGeolocationRequest* request);
 
   // Methods for the service when it's ready to process requests:
   nsresult GetCurrentPositionReady(nsGeolocationRequest* aRequest);
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard.cc
+++ /dev/null
@@ -1,64 +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/clipboard.h"
-
-#include "base/logging.h"
-
-namespace {
-
-// A compromised renderer could send us bad data, so validate it.
-bool IsBitmapSafe(const Clipboard::ObjectMapParams& params) {
-  const gfx::Size* size =
-      reinterpret_cast<const gfx::Size*>(&(params[1].front()));
-  return params[0].size() ==
-      static_cast<size_t>(size->width() * size->height() * 4);
-}
-
-}
-
-void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) {
-  switch (type) {
-    case CBF_TEXT:
-      WriteText(&(params[0].front()), params[0].size());
-      break;
-
-    case CBF_HTML:
-      if (params.size() == 2)
-        WriteHTML(&(params[0].front()), params[0].size(),
-                  &(params[1].front()), params[1].size());
-      else
-        WriteHTML(&(params[0].front()), params[0].size(), NULL, 0);
-      break;
-
-    case CBF_BOOKMARK:
-      WriteBookmark(&(params[0].front()), params[0].size(),
-                    &(params[1].front()), params[1].size());
-      break;
-
-    case CBF_LINK:
-      WriteHyperlink(&(params[0].front()), params[0].size(),
-                     &(params[1].front()), params[1].size());
-      break;
-
-    case CBF_FILES:
-      WriteFiles(&(params[0].front()), params[0].size());
-      break;
-
-    case CBF_WEBKIT:
-      WriteWebSmartPaste();
-      break;
-
-#if defined(OS_WIN) || defined(OS_LINUX)
-    case CBF_BITMAP:
-      if (!IsBitmapSafe(params))
-        return;
-      WriteBitmap(&(params[0].front()), &(params[1].front()));
-      break;
-#endif  // defined(OS_WIN) || defined(OS_LINUX)
-
-    default:
-      NOTREACHED();
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard.h
+++ /dev/null
@@ -1,204 +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_CLIPBOARD_H_
-#define BASE_CLIPBOARD_H_
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "base/file_path.h"
-#include "base/process.h"
-#include "base/string16.h"
-#include "base/gfx/size.h"
-
-class Clipboard {
- public:
-  typedef std::string FormatType;
-#if defined(OS_LINUX)
-  typedef struct _GtkClipboard GtkClipboard;
-  typedef std::map<FormatType, std::pair<char*, size_t> > TargetMap;
-#endif
-
-  // ObjectType designates the type of data to be stored in the clipboard. This
-  // designation is shared across all OSes. The system-specific designation
-  // is defined by FormatType. A single ObjectType might be represented by
-  // several system-specific FormatTypes. For example, on Linux the CBF_TEXT
-  // ObjectType maps to "text/plain", "STRING", and several other formats. On
-  // windows it maps to CF_UNICODETEXT.
-  enum ObjectType {
-    CBF_TEXT,
-    CBF_HTML,
-    CBF_BOOKMARK,
-    CBF_LINK,
-    CBF_FILES,
-    CBF_WEBKIT,
-    CBF_BITMAP,
-    CBF_SMBITMAP // bitmap from shared memory
-  };
-
-  // ObjectMap is a map from ObjectType to associated data.
-  // The data is organized differently for each ObjectType. The following
-  // table summarizes what kind of data is stored for each key.
-  // * indicates an optional argument.
-  //
-  // Key           Arguments    Type
-  // -------------------------------------
-  // CBF_TEXT      text         char array
-  // CBF_HTML      html         char array
-  //               url*         char array
-  // CBF_BOOKMARK  html         char array
-  //               url          char array
-  // CBF_LINK      html         char array
-  //               url          char array
-  // CBF_FILES     files        char array representing multiple files.
-  //                            Filenames are separated by null characters and
-  //                            the final filename is double null terminated.
-  //                            The filenames are encoded in platform-specific
-  //                            encoding.
-  // CBF_WEBKIT    none         empty vector
-  // CBF_BITMAP    pixels       byte array
-  //               size         gfx::Size struct
-  // CBF_SMBITMAP  shared_mem   shared memory handle
-  //               size         gfx::Size struct
-  typedef std::vector<char> ObjectMapParam;
-  typedef std::vector<ObjectMapParam> ObjectMapParams;
-  typedef std::map<int /* ObjectType */, ObjectMapParams> ObjectMap;
-
-  Clipboard();
-  ~Clipboard();
-
-  // Write a bunch of objects to the system clipboard. Copies are made of the
-  // contents of |objects|. On Windows they are copied to the system clipboard.
-  // On linux they are copied into a structure owned by the Clipboard object and
-  // kept until the system clipboard is set again.
-  void WriteObjects(const ObjectMap& objects);
-
-  // Behaves as above. If there is some shared memory handle passed as one of
-  // the objects, it came from the process designated by |process|. This will
-  // assist in turning it into a shared memory region that the current process
-  // can use.
-  void WriteObjects(const ObjectMap& objects, base::ProcessHandle process);
-
-  // Tests whether the clipboard contains a certain format
-  bool IsFormatAvailable(const FormatType& format) const;
-
-  // Reads UNICODE text from the clipboard, if available.
-  void ReadText(string16* result) const;
-
-  // Reads ASCII text from the clipboard, if available.
-  void ReadAsciiText(std::string* result) const;
-
-  // Reads HTML from the clipboard, if available.
-  void ReadHTML(string16* markup, std::string* src_url) const;
-
-  // Reads a bookmark from the clipboard, if available.
-  void ReadBookmark(string16* title, std::string* url) const;
-
-  // Reads a file or group of files from the clipboard, if available, into the
-  // out parameter.
-  void ReadFile(FilePath* file) const;
-  void ReadFiles(std::vector<FilePath>* files) const;
-
-  // Get format Identifiers for various types.
-  static FormatType GetUrlFormatType();
-  static FormatType GetUrlWFormatType();
-  static FormatType GetMozUrlFormatType();
-  static FormatType GetPlainTextFormatType();
-  static FormatType GetPlainTextWFormatType();
-  static FormatType GetFilenameFormatType();
-  static FormatType GetFilenameWFormatType();
-  static FormatType GetWebKitSmartPasteFormatType();
-  // Win: MS HTML Format, Other: Generic HTML format
-  static FormatType GetHtmlFormatType();
-#if defined(OS_WIN)
-  static FormatType GetBitmapFormatType();
-  // Firefox text/html
-  static FormatType GetTextHtmlFormatType();
-  static FormatType GetCFHDropFormatType();
-  static FormatType GetFileDescriptorFormatType();
-  static FormatType GetFileContentFormatZeroType();
-
-  // Duplicates any remote shared memory handle embedded inside |objects| that
-  // was created by |process| so that it can be used by this process.
-  static void DuplicateRemoteHandles(base::ProcessHandle process,
-                                     ObjectMap* objects);
-#endif
-
- private:
-  void WriteText(const char* text_data, size_t text_len);
-
-  void WriteHTML(const char* markup_data,
-                 size_t markup_len,
-                 const char* url_data,
-                 size_t url_len);
-
-  void WriteBookmark(const char* title_data,
-                     size_t title_len,
-                     const char* url_data,
-                     size_t url_len);
-
-  void WriteHyperlink(const char* title_data,
-                      size_t title_len,
-                      const char* url_data,
-                      size_t url_len);
-
-  void WriteWebSmartPaste();
-
-  void WriteFiles(const char* file_data, size_t file_len);
-
-  void DispatchObject(ObjectType type, const ObjectMapParams& params);
-
-  void WriteBitmap(const char* pixel_data, const char* size_data);
-#if defined(OS_WIN)
-  void WriteBitmapFromSharedMemory(const char* bitmap_data,
-                                   const char* size_data,
-                                   base::ProcessHandle handle);
-
-  void WriteBitmapFromHandle(HBITMAP source_hbitmap,
-                             const gfx::Size& size);
-
-  // Safely write to system clipboard. Free |handle| on failure.
-  void WriteToClipboard(unsigned int format, HANDLE handle);
-
-  static void ParseBookmarkClipboardFormat(const string16& bookmark,
-                                           string16* title,
-                                           std::string* url);
-
-  // Free a handle depending on its type (as intuited from format)
-  static void FreeData(unsigned int format, HANDLE data);
-
-  // Return the window that should be the clipboard owner, creating it
-  // if neccessary.  Marked const for lazily initialization by const methods.
-  HWND GetClipboardWindow() const;
-
-  // Mark this as mutable so const methods can still do lazy initialization.
-  mutable HWND clipboard_owner_;
-
-  // True if we can create a window.
-  bool create_window_;
-#elif defined(OS_LINUX)
-  // Data is stored in the |clipboard_data_| map until it is saved to the system
-  // clipboard. The Store* functions save data to the |clipboard_data_| map. The
-  // SetGtkClipboard function replaces whatever is on the system clipboard with
-  // the contents of |clipboard_data_|.
-  // The Write* functions make a deep copy of the data passed to them an store
-  // it in |clipboard_data_|.
-
-  // Write changes to gtk clipboard.
-  void SetGtkClipboard();
-  // Free pointers in clipboard_data_ and clear() the map.
-  void FreeTargetMap();
-  // Insert a mapping into clipboard_data_.
-  void InsertMapping(const char* key, char* data, size_t data_len);
-
-  TargetMap* clipboard_data_;
-  GtkClipboard* clipboard_;
-#endif
-
-  DISALLOW_EVIL_CONSTRUCTORS(Clipboard);
-};
-
-#endif  // BASE_CLIPBOARD_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard_linux.cc
+++ /dev/null
@@ -1,328 +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/clipboard.h"
-
-#include <gtk/gtk.h>
-#include <map>
-#include <set>
-#include <string>
-#include <utility>
-
-#include "base/scoped_ptr.h"
-#include "base/linux_util.h"
-#include "base/string_util.h"
-
-namespace {
-
-const char kMimeBmp[] = "image/bmp";
-const char kMimeHtml[] = "text/html";
-const char kMimeText[] = "text/plain";
-const char kMimeWebkitSmartPaste[] = "chromium-internal/webkit-paste";
-
-std::string GdkAtomToString(const GdkAtom& atom) {
-  gchar* name = gdk_atom_name(atom);
-  std::string rv(name);
-  g_free(name);
-  return rv;
-}
-
-GdkAtom StringToGdkAtom(const std::string& str) {
-  return gdk_atom_intern(str.c_str(), false);
-}
-
-// GtkClipboardGetFunc callback.
-// GTK will call this when an application wants data we copied to the clipboard.
-void GetData(GtkClipboard* clipboard,
-             GtkSelectionData* selection_data,
-             guint info,
-             gpointer user_data) {
-  Clipboard::TargetMap* data_map =
-      reinterpret_cast<Clipboard::TargetMap*>(user_data);
-
-  std::string target_string = GdkAtomToString(selection_data->target);
-  Clipboard::TargetMap::iterator iter = data_map->find(target_string);
-
-  if (iter == data_map->end())
-    return;
-
-  if (target_string == kMimeBmp) {
-    gtk_selection_data_set_pixbuf(selection_data,
-        reinterpret_cast<GdkPixbuf*>(iter->second.first));
-  } else {
-    gtk_selection_data_set(selection_data, selection_data->target, 8,
-                           reinterpret_cast<guchar*>(iter->second.first),
-                           iter->second.second);
-  }
-}
-
-// GtkClipboardClearFunc callback.
-// We are guaranteed this will be called exactly once for each call to
-// gtk_clipboard_set_with_data
-void ClearData(GtkClipboard* clipboard,
-               gpointer user_data) {
-  Clipboard::TargetMap* map =
-      reinterpret_cast<Clipboard::TargetMap*>(user_data);
-  std::set<char*> ptrs;
-
-  for (Clipboard::TargetMap::iterator iter = map->begin();
-       iter != map->end(); ++iter) {
-    if (iter->first == kMimeBmp)
-      g_object_unref(reinterpret_cast<GdkPixbuf*>(iter->second.first));
-    else
-      ptrs.insert(iter->second.first);
-  }
-
-  for (std::set<char*>::iterator iter = ptrs.begin();
-       iter != ptrs.end(); ++iter)
-    delete[] *iter;
-
-  delete map;
-}
-
-// Frees the pointers in the given map and clears the map.
-// Does not double-free any pointers.
-void FreeTargetMap(Clipboard::TargetMap map) {
-  std::set<char*> ptrs;
-
-  for (Clipboard::TargetMap::iterator iter = map.begin();
-       iter != map.end(); ++iter)
-    ptrs.insert(iter->second.first);
-
-  for (std::set<char*>::iterator iter = ptrs.begin();
-       iter != ptrs.end(); ++iter)
-    delete[] *iter;
-
-  map.clear();
-}
-
-// Called on GdkPixbuf destruction; see WriteBitmap().
-void GdkPixbufFree(guchar* pixels, gpointer data) {
-  free(pixels);
-}
-
-}  // namespace
-
-Clipboard::Clipboard() {
-  clipboard_ = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
-}
-
-Clipboard::~Clipboard() {
-  // TODO(estade): do we want to save clipboard data after we exit?
-  // gtk_clipboard_set_can_store and gtk_clipboard_store work
-  // but have strangely awful performance.
-}
-
-void Clipboard::WriteObjects(const ObjectMap& objects) {
-  clipboard_data_ = new TargetMap();
-
-  for (ObjectMap::const_iterator iter = objects.begin();
-       iter != objects.end(); ++iter) {
-    DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
-  }
-
-  SetGtkClipboard();
-}
-
-// Take ownership of the GTK clipboard and inform it of the targets we support.
-void Clipboard::SetGtkClipboard() {
-  scoped_array<GtkTargetEntry> targets(
-      new GtkTargetEntry[clipboard_data_->size()]);
-
-  int i = 0;
-  for (Clipboard::TargetMap::iterator iter = clipboard_data_->begin();
-       iter != clipboard_data_->end(); ++iter, ++i) {
-    char* target_string = new char[iter->first.size() + 1];
-    strcpy(target_string, iter->first.c_str());
-    targets[i].target = target_string;
-    targets[i].flags = 0;
-    targets[i].info = i;
-  }
-
-  gtk_clipboard_set_with_data(clipboard_, targets.get(),
-                              clipboard_data_->size(),
-                              GetData, ClearData,
-                              clipboard_data_);
-
-  for (size_t i = 0; i < clipboard_data_->size(); i++)
-    delete[] targets[i].target;
-}
-
-void Clipboard::WriteText(const char* text_data, size_t text_len) {
-  char* data = new char[text_len];
-  memcpy(data, text_data, text_len);
-
-  InsertMapping(kMimeText, data, text_len);
-  InsertMapping("TEXT", data, text_len);
-  InsertMapping("STRING", data, text_len);
-  InsertMapping("UTF8_STRING", data, text_len);
-  InsertMapping("COMPOUND_TEXT", data, text_len);
-}
-
-void Clipboard::WriteHTML(const char* markup_data,
-                          size_t markup_len,
-                          const char* url_data,
-                          size_t url_len) {
-  // TODO(estade): might not want to ignore |url_data|
-  char* data = new char[markup_len];
-  memcpy(data, markup_data, markup_len);
-
-  InsertMapping(kMimeHtml, data, markup_len);
-}
-
-// Write an extra flavor that signifies WebKit was the last to modify the
-// pasteboard. This flavor has no data.
-void Clipboard::WriteWebSmartPaste() {
-  InsertMapping(kMimeWebkitSmartPaste, NULL, 0);
-}
-
-void Clipboard::WriteBitmap(const char* pixel_data, const char* size_data) {
-  const gfx::Size* size = reinterpret_cast<const gfx::Size*>(size_data);
-
-  guchar* data = base::BGRAToRGBA(reinterpret_cast<const uint8_t*>(pixel_data),
-                                  size->width(), size->height(), 0);
-
-  GdkPixbuf* pixbuf =
-      gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, TRUE,
-                               8, size->width(), size->height(),
-                               size->width() * 4, GdkPixbufFree, NULL);
-  // We store the GdkPixbuf*, and the size_t half of the pair is meaningless.
-  // Note that this contrasts with the vast majority of entries in our target
-  // map, which directly store the data and its length.
-  InsertMapping(kMimeBmp, reinterpret_cast<char*>(pixbuf), 0);
-}
-
-void Clipboard::WriteBookmark(const char* title_data, size_t title_len,
-                              const char* url_data, size_t url_len) {
-  // TODO(estade): implement this, but for now fail silently so we do not
-  // write error output during layout tests.
-  // NOTIMPLEMENTED();
-}
-
-void Clipboard::WriteHyperlink(const char* title_data, size_t title_len,
-                               const char* url_data, size_t url_len) {
-  NOTIMPLEMENTED();
-}
-
-void Clipboard::WriteFiles(const char* file_data, size_t file_len) {
-  NOTIMPLEMENTED();
-}
-
-// We do not use gtk_clipboard_wait_is_target_available because of
-// a bug with the gtk clipboard. It caches the available targets
-// and does not always refresh the cache when it is appropriate.
-// TODO(estade): When gnome bug 557315 is resolved, change this function
-// to use gtk_clipboard_wait_is_target_available. Also, catch requests
-// for plain text and change them to gtk_clipboard_wait_is_text_available
-// (which checks for several standard text targets).
-bool Clipboard::IsFormatAvailable(const Clipboard::FormatType& format) const {
-  bool retval = false;
-  GdkAtom* targets = NULL;
-  GtkSelectionData* data =
-      gtk_clipboard_wait_for_contents(clipboard_,
-                                      gdk_atom_intern("TARGETS", false));
-
-  if (!data)
-    return false;
-
-  int num = 0;
-  gtk_selection_data_get_targets(data, &targets, &num);
-
-  GdkAtom format_atom = StringToGdkAtom(format);
-
-  for (int i = 0; i < num; i++) {
-    if (targets[i] == format_atom) {
-      retval = true;
-      break;
-    }
-  }
-
-  gtk_selection_data_free(data);
-  g_free(targets);
-
-  return retval;
-}
-
-void Clipboard::ReadText(string16* result) const {
-  result->clear();
-  gchar* text = gtk_clipboard_wait_for_text(clipboard_);
-
-  if (text == NULL)
-   return;
-
-  // TODO(estade): do we want to handle the possible error here?
-  UTF8ToUTF16(text, strlen(text), result);
-  g_free(text);
-}
-
-void Clipboard::ReadAsciiText(std::string* result) const {
-  result->clear();
-  gchar* text = gtk_clipboard_wait_for_text(clipboard_);
-
-  if (text == NULL)
-   return;
-
-  result->assign(text);
-  g_free(text);
-}
-
-void Clipboard::ReadFile(FilePath* file) const {
-  *file = FilePath();
-}
-
-// TODO(estade): handle different charsets.
-void Clipboard::ReadHTML(string16* markup, std::string* src_url) const {
-  markup->clear();
-
-  GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard_,
-      StringToGdkAtom(GetHtmlFormatType()));
-
-  if (!data)
-    return;
-
-  UTF8ToUTF16(reinterpret_cast<char*>(data->data),
-              strlen(reinterpret_cast<char*>(data->data)),
-              markup);
-  gtk_selection_data_free(data);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetPlainTextFormatType() {
-  return GdkAtomToString(GDK_TARGET_STRING);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetPlainTextWFormatType() {
-  return GetPlainTextFormatType();
-}
-
-// static
-Clipboard::FormatType Clipboard::GetHtmlFormatType() {
-  return std::string(kMimeHtml);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() {
-  return std::string(kMimeWebkitSmartPaste);
-}
-
-// Insert the key/value pair in the clipboard_data structure. If
-// the mapping already exists, it frees the associated data. Don't worry
-// about double freeing because if the same key is inserted into the
-// map twice, it must have come from different Write* functions and the
-// data pointer cannot be the same.
-void Clipboard::InsertMapping(const char* key,
-                              char* data,
-                              size_t data_len) {
-  TargetMap::iterator iter = clipboard_data_->find(key);
-
-  if (iter != clipboard_data_->end()) {
-    if (strcmp(kMimeBmp, key) == 0)
-      g_object_unref(reinterpret_cast<GdkPixbuf*>(iter->second.first));
-    else
-      delete[] iter->second.first;
-  }
-
-  (*clipboard_data_)[key] = std::make_pair(data, data_len);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard_mac.mm
+++ /dev/null
@@ -1,283 +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/clipboard.h"
-
-#import <Cocoa/Cocoa.h>
-
-#include "base/logging.h"
-#include "base/string_util.h"
-#include "base/sys_string_conversions.h"
-
-namespace {
-
-// Would be nice if this were in UTCoreTypes.h, but it isn't
-const NSString* kUTTypeURLName = @"public.url-name";
-
-// Tells us if WebKit was the last to write to the pasteboard. There's no
-// actual data associated with this type.
-const NSString *kWebSmartPastePboardType = @"NeXT smart paste pasteboard type";
-
-NSPasteboard* GetPasteboard() {
-  // The pasteboard should not be nil in a UI session, but this handy DCHECK
-  // can help track down problems if someone tries using clipboard code outside
-  // of a UI session.
-  NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
-  DCHECK(pasteboard);
-  return pasteboard;
-}
-
-}  // namespace
-
-Clipboard::Clipboard() {
-}
-
-Clipboard::~Clipboard() {
-}
-
-void Clipboard::WriteObjects(const ObjectMap& objects) {
-  NSPasteboard* pb = GetPasteboard();
-  [pb declareTypes:[NSArray array] owner:nil];
-
-  for (ObjectMap::const_iterator iter = objects.begin();
-       iter != objects.end(); ++iter) {
-    DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
-  }
-
-}
-
-void Clipboard::WriteText(const char* text_data, size_t text_len) {
-  std::string text_str(text_data, text_len);
-  NSString *text = base::SysUTF8ToNSString(text_str);
-  NSPasteboard* pb = GetPasteboard();
-  [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
-  [pb setString:text forType:NSStringPboardType];
-}
-
-void Clipboard::WriteHTML(const char* markup_data,
-                          size_t markup_len,
-                          const char* url_data,
-                          size_t url_len) {
-  std::string html_fragment_str(markup_data, markup_len);
-  NSString *html_fragment = base::SysUTF8ToNSString(html_fragment_str);
-
-  // TODO(avi): url_data?
-  NSPasteboard* pb = GetPasteboard();
-  [pb addTypes:[NSArray arrayWithObject:NSHTMLPboardType] owner:nil];
-  [pb setString:html_fragment forType:NSHTMLPboardType];
-}
-
-void Clipboard::WriteBookmark(const char* title_data,
-                              size_t title_len,
-                              const char* url_data,
-                              size_t url_len) {
-  WriteHyperlink(title_data, title_len, url_data, url_len);
-}
-
-void Clipboard::WriteHyperlink(const char* title_data,
-                               size_t title_len,
-                               const char* url_data,
-                               size_t url_len) {
-  std::string title_str(title_data, title_len);
-  NSString *title =  base::SysUTF8ToNSString(title_str);
-  std::string url_str(url_data, url_len);
-  NSString *url =  base::SysUTF8ToNSString(url_str);
-
-  // TODO(playmobil): In the Windows version of this function, an HTML
-  // representation of the bookmark is also added to the clipboard, to support
-  // drag and drop of web shortcuts.  I don't think we need to do this on the
-  // Mac, but we should double check later on.
-  NSURL* nsurl = [NSURL URLWithString:url];
-
-  NSPasteboard* pb = GetPasteboard();
-  // passing UTIs into the pasteboard methods is valid >= 10.5
-  [pb addTypes:[NSArray arrayWithObjects:NSURLPboardType,
-                                         kUTTypeURLName,
-                                         nil]
-         owner:nil];
-  [nsurl writeToPasteboard:pb];
-  [pb setString:title forType:kUTTypeURLName];
-}
-
-void Clipboard::WriteFiles(const char* file_data, size_t file_len) {
-  NSMutableArray* fileList = [NSMutableArray arrayWithCapacity:1];
-
-  // Offset of current filename from start of file_data array.
-  size_t current_filename_offset = 0;
-
-  // file_data is double null terminated (see table at top of clipboard.h).
-  // So this loop can ignore the second null terminator, thus file_len - 1.
-  // TODO(playmobil): If we need a loop like this on other platforms then split
-  // this out into a common function that outputs a std::vector<const char*>.
-  for (size_t i = 0; i < file_len - 1; ++i) {
-    if (file_data[i] == '\0') {
-      const char* filename = &file_data[current_filename_offset];
-      [fileList addObject:[NSString stringWithUTF8String:filename]];
-
-      current_filename_offset = i + 1;
-      continue;
-    }
-  }
-
-  NSPasteboard* pb = GetPasteboard();
-  [pb addTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil];
-  [pb setPropertyList:fileList forType:NSFilenamesPboardType];
-}
-
-// Write an extra flavor that signifies WebKit was the last to modify the
-// pasteboard. This flavor has no data.
-void Clipboard::WriteWebSmartPaste() {
-  NSPasteboard* pb = GetPasteboard();
-  NSString* format = base::SysUTF8ToNSString(GetWebKitSmartPasteFormatType());
-  [pb addTypes:[NSArray arrayWithObject:format] owner:nil];
-  [pb setData:nil forType:format];
-}
-
-bool Clipboard::IsFormatAvailable(const Clipboard::FormatType& format) const {
-  NSString* format_ns = base::SysUTF8ToNSString(format);
-
-  NSPasteboard* pb = GetPasteboard();
-  NSArray* types = [pb types];
-
-  return [types containsObject:format_ns];
-}
-
-void Clipboard::ReadText(string16* result) const {
-  NSPasteboard* pb = GetPasteboard();
-  NSString* contents = [pb stringForType:NSStringPboardType];
-
-  UTF8ToUTF16([contents UTF8String],
-              [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding],
-              result);
-}
-
-void Clipboard::ReadAsciiText(std::string* result) const {
-  NSPasteboard* pb = GetPasteboard();
-  NSString* contents = [pb stringForType:NSStringPboardType];
-
-  if (!contents)
-    result->clear();
-  else
-    result->assign([contents UTF8String]);
-}
-
-void Clipboard::ReadHTML(string16* markup, std::string* src_url) const {
-  if (markup) {
-    NSPasteboard* pb = GetPasteboard();
-    NSArray *supportedTypes = [NSArray arrayWithObjects:NSHTMLPboardType,
-                                                        NSStringPboardType,
-                                                        nil];
-    NSString *bestType = [pb availableTypeFromArray:supportedTypes];
-    NSString* contents = [pb stringForType:bestType];
-    UTF8ToUTF16([contents UTF8String],
-                [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding],
-                markup);
-  }
-
-  // TODO(avi): src_url?
-  if (src_url)
-    src_url->clear();
-}
-
-void Clipboard::ReadBookmark(string16* title, std::string* url) const {
-  NSPasteboard* pb = GetPasteboard();
-
-  if (title) {
-    NSString* contents = [pb stringForType:kUTTypeURLName];
-    UTF8ToUTF16([contents UTF8String],
-                [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding],
-                title);
-  }
-
-  if (url) {
-    NSString* url_string = [[NSURL URLFromPasteboard:pb] absoluteString];
-    if (!url_string)
-      url->clear();
-    else
-      url->assign([url_string UTF8String]);
-  }
-}
-
-void Clipboard::ReadFile(FilePath* file) const {
-  if (!file) {
-    NOTREACHED();
-    return;
-  }
-
-  *file = FilePath();
-  std::vector<FilePath> files;
-  ReadFiles(&files);
-
-  // Take the first file, if available.
-  if (!files.empty())
-    *file = files[0];
-}
-
-void Clipboard::ReadFiles(std::vector<FilePath>* files) const {
-  if (!files) {
-    NOTREACHED();
-    return;
-  }
-
-  files->clear();
-
-  NSPasteboard* pb = GetPasteboard();
-  NSArray* fileList = [pb propertyListForType:NSFilenamesPboardType];
-
-  for (unsigned int i = 0; i < [fileList count]; ++i) {
-    std::string file = [[fileList objectAtIndex:i] UTF8String];
-    files->push_back(FilePath(file));
-  }
-}
-
-// static
-Clipboard::FormatType Clipboard::GetUrlFormatType() {
-  static const std::string type = base::SysNSStringToUTF8(NSURLPboardType);
-  return type;
-}
-
-// static
-Clipboard::FormatType Clipboard::GetUrlWFormatType() {
-  static const std::string type = base::SysNSStringToUTF8(NSURLPboardType);
-  return type;
-}
-
-// static
-Clipboard::FormatType Clipboard::GetPlainTextFormatType() {
-  static const std::string type = base::SysNSStringToUTF8(NSStringPboardType);
-  return type;
-}
-
-// static
-Clipboard::FormatType Clipboard::GetPlainTextWFormatType() {
-  static const std::string type = base::SysNSStringToUTF8(NSStringPboardType);
-  return type;
-}
-
-// static
-Clipboard::FormatType Clipboard::GetFilenameFormatType() {
-  static const std::string type =
-      base::SysNSStringToUTF8(NSFilenamesPboardType);
-  return type;
-}
-
-// static
-Clipboard::FormatType Clipboard::GetFilenameWFormatType() {
-  static const std::string type =
-      base::SysNSStringToUTF8(NSFilenamesPboardType);
-  return type;
-}
-
-// static
-Clipboard::FormatType Clipboard::GetHtmlFormatType() {
-  static const std::string type = base::SysNSStringToUTF8(NSHTMLPboardType);
-  return type;
-}
-
-// static
-Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() {
-  static const std::string type =
-      base::SysNSStringToUTF8(kWebSmartPastePboardType);
-  return type;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard_unittest.cc
+++ /dev/null
@@ -1,282 +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 <string>
-
-#include "base/basictypes.h"
-#include "base/clipboard.h"
-#include "base/message_loop.h"
-#include "base/scoped_clipboard_writer.h"
-#include "base/string_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/platform_test.h"
-
-#if defined(OS_WIN)
-class ClipboardTest : public PlatformTest {
- protected:
-  virtual void SetUp() {
-    message_loop_.reset(new MessageLoopForUI());
-  }
-  virtual void TearDown() {
-  }
-
- private:
-  scoped_ptr<MessageLoop> message_loop_;
-};
-#elif defined(OS_POSIX)
-typedef PlatformTest ClipboardTest;
-#endif  // defined(OS_WIN)
-
-TEST_F(ClipboardTest, ClearTest) {
-  Clipboard clipboard;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteText(ASCIIToUTF16("clear me"));
-  }
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteHTML(ASCIIToUTF16("<b>broom</b>"), "");
-  }
-
-  EXPECT_FALSE(clipboard.IsFormatAvailable(
-      Clipboard::GetPlainTextWFormatType()));
-  EXPECT_FALSE(clipboard.IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType()));
-}
-
-TEST_F(ClipboardTest, TextTest) {
-  Clipboard clipboard;
-
-  string16 text(ASCIIToUTF16("This is a string16!#$")), text_result;
-  std::string ascii_text;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteText(text);
-  }
-
-  EXPECT_TRUE(clipboard.IsFormatAvailable(
-      Clipboard::GetPlainTextWFormatType()));
-  EXPECT_TRUE(clipboard.IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType()));
-  clipboard.ReadText(&text_result);
-
-  EXPECT_EQ(text, text_result);
-  clipboard.ReadAsciiText(&ascii_text);
-  EXPECT_EQ(UTF16ToUTF8(text), ascii_text);
-}
-
-TEST_F(ClipboardTest, HTMLTest) {
-  Clipboard clipboard;
-
-  string16 markup(ASCIIToUTF16("<string>Hi!</string>")), markup_result;
-  std::string url("http://www.example.com/"), url_result;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteHTML(markup, url);
-  }
-
-  EXPECT_EQ(true, clipboard.IsFormatAvailable(
-      Clipboard::GetHtmlFormatType()));
-  clipboard.ReadHTML(&markup_result, &url_result);
-  EXPECT_EQ(markup, markup_result);
-#if defined(OS_WIN)
-  // TODO(playmobil): It's not clear that non windows clipboards need to support
-  // this.
-  EXPECT_EQ(url, url_result);
-#endif  // defined(OS_WIN)
-}
-
-TEST_F(ClipboardTest, TrickyHTMLTest) {
-  Clipboard clipboard;
-
-  string16 markup(ASCIIToUTF16("<em>Bye!<!--EndFragment --></em>")),
-      markup_result;
-  std::string url, url_result;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteHTML(markup, url);
-  }
-
-  EXPECT_EQ(true, clipboard.IsFormatAvailable(
-      Clipboard::GetHtmlFormatType()));
-  clipboard.ReadHTML(&markup_result, &url_result);
-  EXPECT_EQ(markup, markup_result);
-#if defined(OS_WIN)
-  // TODO(playmobil): It's not clear that non windows clipboards need to support
-  // this.
-  EXPECT_EQ(url, url_result);
-#endif  // defined(OS_WIN)
-}
-
-// TODO(estade): Port the following test (decide what target we use for urls)
-#if !defined(OS_LINUX)
-TEST_F(ClipboardTest, BookmarkTest) {
-  Clipboard clipboard;
-
-  string16 title(ASCIIToUTF16("The Example Company")), title_result;
-  std::string url("http://www.example.com/"), url_result;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteBookmark(title, url);
-  }
-
-  EXPECT_EQ(true,
-      clipboard.IsFormatAvailable(Clipboard::GetUrlWFormatType()));
-  clipboard.ReadBookmark(&title_result, &url_result);
-  EXPECT_EQ(title, title_result);
-  EXPECT_EQ(url, url_result);
-}
-#endif  // defined(OS_WIN)
-
-TEST_F(ClipboardTest, MultiFormatTest) {
-  Clipboard clipboard;
-
-  string16 text(ASCIIToUTF16("Hi!")), text_result;
-  string16 markup(ASCIIToUTF16("<strong>Hi!</string>")), markup_result;
-  std::string url("http://www.example.com/"), url_result;
-  std::string ascii_text;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteHTML(markup, url);
-    clipboard_writer.WriteText(text);
-  }
-
-  EXPECT_EQ(true,
-      clipboard.IsFormatAvailable(Clipboard::GetHtmlFormatType()));
-  EXPECT_EQ(true, clipboard.IsFormatAvailable(
-      Clipboard::GetPlainTextWFormatType()));
-  EXPECT_EQ(true, clipboard.IsFormatAvailable(
-      Clipboard::GetPlainTextFormatType()));
-  clipboard.ReadHTML(&markup_result, &url_result);
-  EXPECT_EQ(markup, markup_result);
-#if defined(OS_WIN)
-  // TODO(playmobil): It's not clear that non windows clipboards need to support
-  // this.
-  EXPECT_EQ(url, url_result);
-#endif  // defined(OS_WIN)
-  clipboard.ReadText(&text_result);
-  EXPECT_EQ(text, text_result);
-  clipboard.ReadAsciiText(&ascii_text);
-  EXPECT_EQ(UTF16ToUTF8(text), ascii_text);
-}
-
-// TODO(estade): Port the following tests (decide what targets we use for files)
-#if !defined(OS_LINUX)
-// Files for this test don't actually need to exist on the file system, just
-// don't try to use a non-existent file you've retrieved from the clipboard.
-TEST_F(ClipboardTest, FileTest) {
-  Clipboard clipboard;
-#if defined(OS_WIN)
-  FilePath file(L"C:\\Downloads\\My Downloads\\A Special File.txt");
-#elif defined(OS_MACOSX)
-  // OS X will print a warning message if we stick a non-existant file on the
-  // clipboard.
-  FilePath file("/usr/bin/make");
-#endif  // defined(OS_MACOSX)
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteFile(file);
-  }
-
-  FilePath out_file;
-  clipboard.ReadFile(&out_file);
-  EXPECT_EQ(file.value(), out_file.value());
-}
-
-TEST_F(ClipboardTest, MultipleFilesTest) {
-  Clipboard clipboard;
-
-#if defined(OS_WIN)
-  FilePath file1(L"C:\\Downloads\\My Downloads\\File 1.exe");
-  FilePath file2(L"C:\\Downloads\\My Downloads\\File 2.pdf");
-  FilePath file3(L"C:\\Downloads\\My Downloads\\File 3.doc");
-#elif defined(OS_MACOSX)
-  // OS X will print a warning message if we stick a non-existant file on the
-  // clipboard.
-  FilePath file1("/usr/bin/make");
-  FilePath file2("/usr/bin/man");
-  FilePath file3("/usr/bin/perl");
-#endif  // defined(OS_MACOSX)
-  std::vector<FilePath> files;
-  files.push_back(file1);
-  files.push_back(file2);
-  files.push_back(file3);
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteFiles(files);
-  }
-
-  std::vector<FilePath> out_files;
-  clipboard.ReadFiles(&out_files);
-
-  EXPECT_EQ(files.size(), out_files.size());
-  for (size_t i = 0; i < out_files.size(); ++i)
-    EXPECT_EQ(files[i].value(), out_files[i].value());
-}
-#endif  // !defined(OS_LINUX)
-
-#if defined(OS_WIN)  // Windows only tests.
-TEST_F(ClipboardTest, HyperlinkTest) {
-  Clipboard clipboard;
-
-  string16 title(ASCIIToUTF16("The Example Company")), title_result;
-  std::string url("http://www.example.com/"), url_result;
-  string16 html(ASCIIToUTF16("<a href=\"http://www.example.com/\">"
-                             "The Example Company</a>")), html_result;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteHyperlink(title, url);
-  }
-
-  EXPECT_EQ(true,
-            clipboard.IsFormatAvailable(Clipboard::GetUrlWFormatType()));
-  EXPECT_EQ(true,
-            clipboard.IsFormatAvailable(Clipboard::GetHtmlFormatType()));
-  clipboard.ReadBookmark(&title_result, &url_result);
-  EXPECT_EQ(title, title_result);
-  EXPECT_EQ(url, url_result);
-  clipboard.ReadHTML(&html_result, &url_result);
-  EXPECT_EQ(html, html_result);
-}
-
-TEST_F(ClipboardTest, WebSmartPasteTest) {
-  Clipboard clipboard;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteWebSmartPaste();
-  }
-
-  EXPECT_EQ(true, clipboard.IsFormatAvailable(
-      Clipboard::GetWebKitSmartPasteFormatType()));
-}
-
-TEST_F(ClipboardTest, BitmapTest) {
-  unsigned int fake_bitmap[] = {
-    0x46155189, 0xF6A55C8D, 0x79845674, 0xFA57BD89,
-    0x78FD46AE, 0x87C64F5A, 0x36EDC5AF, 0x4378F568,
-    0x91E9F63A, 0xC31EA14F, 0x69AB32DF, 0x643A3FD1,
-  };
-
-  Clipboard clipboard;
-
-  {
-    ScopedClipboardWriter clipboard_writer(&clipboard);
-    clipboard_writer.WriteBitmapFromPixels(fake_bitmap, gfx::Size(3, 4));
-  }
-
-  EXPECT_EQ(true, clipboard.IsFormatAvailable(
-                      Clipboard::GetBitmapFormatType()));
-}
-#endif  // defined(OS_WIN)
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard_util.cc
+++ /dev/null
@@ -1,488 +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/clipboard_util.h"
-
-#include <shellapi.h>
-#include <shlwapi.h>
-#include <wininet.h>
-
-#include "base/basictypes.h"
-#include "base/logging.h"
-#include "base/scoped_handle.h"
-#include "base/string_util.h"
-
-namespace {
-
-bool GetUrlFromHDrop(IDataObject* data_object, std::wstring* url,
-                     std::wstring* title) {
-  DCHECK(data_object && url && title);
-
-  STGMEDIUM medium;
-  if (FAILED(data_object->GetData(ClipboardUtil::GetCFHDropFormat(), &medium)))
-    return false;
-
-  HDROP hdrop = static_cast<HDROP>(GlobalLock(medium.hGlobal));
-
-  if (!hdrop)
-    return false;
-
-  bool success = false;
-  wchar_t filename[MAX_PATH];
-  if (DragQueryFileW(hdrop, 0, filename, arraysize(filename))) {
-    wchar_t url_buffer[INTERNET_MAX_URL_LENGTH];
-    if (0 == _wcsicmp(PathFindExtensionW(filename), L".url") &&
-        GetPrivateProfileStringW(L"InternetShortcut", L"url", 0, url_buffer,
-                                 arraysize(url_buffer), filename)) {
-      *url = url_buffer;
-      PathRemoveExtension(filename);
-      title->assign(PathFindFileName(filename));
-      success = true;
-    }
-  }
-
-  DragFinish(hdrop);
-  GlobalUnlock(medium.hGlobal);
-  // We don't need to call ReleaseStgMedium here because as far as I can tell,
-  // DragFinish frees the hGlobal for us.
-  return success;
-}
-
-bool SplitUrlAndTitle(const std::wstring& str, std::wstring* url,
-    std::wstring* title) {
-  DCHECK(url && title);
-  size_t newline_pos = str.find('\n');
-  bool success = false;
-  if (newline_pos != std::string::npos) {
-    *url = str.substr(0, newline_pos);
-    title->assign(str.substr(newline_pos + 1));
-    success = true;
-  } else {
-    *url = str;
-    title->assign(str);
-    success = true;
-  }
-  return success;
-}
-
-}  // namespace
-
-
-FORMATETC* ClipboardUtil::GetUrlFormat() {
-  static UINT cf = RegisterClipboardFormat(CFSTR_INETURLA);
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetUrlWFormat() {
-  static UINT cf = RegisterClipboardFormat(CFSTR_INETURLW);
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetMozUrlFormat() {
-  // The format is "URL\nTitle"
-  static UINT cf = RegisterClipboardFormat(L"text/x-moz-url");
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetPlainTextFormat() {
-  // We don't need to register this format since it's a built in format.
-  static FORMATETC format = {CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetPlainTextWFormat() {
-  // We don't need to register this format since it's a built in format.
-  static FORMATETC format = {CF_UNICODETEXT, 0, DVASPECT_CONTENT, -1,
-                             TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetFilenameWFormat() {
-  static UINT cf = RegisterClipboardFormat(CFSTR_FILENAMEW);
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetFilenameFormat()
-{
-  static UINT cf = RegisterClipboardFormat(CFSTR_FILENAMEA);
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetHtmlFormat() {
-  static UINT cf = RegisterClipboardFormat(L"HTML Format");
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetTextHtmlFormat() {
-  static UINT cf = RegisterClipboardFormat(L"text/html");
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetCFHDropFormat() {
-  // We don't need to register this format since it's a built in format.
-  static FORMATETC format = {CF_HDROP, 0, DVASPECT_CONTENT, -1,
-                             TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetFileDescriptorFormat() {
-  static UINT cf = RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR);
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetFileContentFormatZero() {
-  static UINT cf = RegisterClipboardFormat(CFSTR_FILECONTENTS);
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, 0, TYMED_HGLOBAL};
-  return &format;
-}
-
-FORMATETC* ClipboardUtil::GetWebKitSmartPasteFormat() {
-  static UINT cf = RegisterClipboardFormat(L"WebKit Smart Paste Format");
-  static FORMATETC format = {cf, 0, DVASPECT_CONTENT, 0, TYMED_HGLOBAL};
-  return &format;
-}
-
-
-bool ClipboardUtil::HasUrl(IDataObject* data_object) {
-  DCHECK(data_object);
-  return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) ||
-      SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) ||
-      SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) ||
-      SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) ||
-      SUCCEEDED(data_object->QueryGetData(GetFilenameFormat()));
-}
-
-bool ClipboardUtil::HasFilenames(IDataObject* data_object) {
-  DCHECK(data_object);
-  return SUCCEEDED(data_object->QueryGetData(GetCFHDropFormat()));
-}
-
-bool ClipboardUtil::HasPlainText(IDataObject* data_object) {
-  DCHECK(data_object);
-  return SUCCEEDED(data_object->QueryGetData(GetPlainTextWFormat())) ||
-      SUCCEEDED(data_object->QueryGetData(GetPlainTextFormat()));
-}
-
-
-bool ClipboardUtil::GetUrl(IDataObject* data_object,
-    std::wstring* url, std::wstring* title) {
-  DCHECK(data_object && url && title);
-  if (!HasUrl(data_object))
-    return false;
-
-  // Try to extract a URL from |data_object| in a variety of formats.
-  STGMEDIUM store;
-  if (GetUrlFromHDrop(data_object, url, title)) {
-    return true;
-  }
-
-  if (SUCCEEDED(data_object->GetData(GetMozUrlFormat(), &store)) ||
-      SUCCEEDED(data_object->GetData(GetUrlWFormat(), &store))) {
-    // Mozilla URL format or unicode URL
-    ScopedHGlobal<wchar_t> data(store.hGlobal);
-    bool success = SplitUrlAndTitle(data.get(), url, title);
-    ReleaseStgMedium(&store);
-    if (success)
-      return true;
-  }
-
-  if (SUCCEEDED(data_object->GetData(GetUrlFormat(), &store))) {
-    // URL using ascii
-    ScopedHGlobal<char> data(store.hGlobal);
-    bool success = SplitUrlAndTitle(UTF8ToWide(data.get()), url, title);
-    ReleaseStgMedium(&store);
-    if (success)
-      return true;
-  }
-
-  if (SUCCEEDED(data_object->GetData(GetFilenameWFormat(), &store))) {
-    // filename using unicode
-    ScopedHGlobal<wchar_t> data(store.hGlobal);
-    bool success = false;
-    if (data.get() && data.get()[0] && (PathFileExists(data.get()) ||
-                                        PathIsUNC(data.get()))) {
-      wchar_t file_url[INTERNET_MAX_URL_LENGTH];
-      DWORD file_url_len = sizeof(file_url) / sizeof(file_url[0]);
-      if (SUCCEEDED(::UrlCreateFromPathW(data.get(), file_url, &file_url_len,
-                                         0))) {
-        *url = file_url;
-        title->assign(file_url);
-        success = true;
-      }
-    }
-    ReleaseStgMedium(&store);
-    if (success)
-      return true;
-  }
-
-  if (SUCCEEDED(data_object->GetData(GetFilenameFormat(), &store))) {
-    // filename using ascii
-    ScopedHGlobal<char> data(store.hGlobal);
-    bool success = false;
-    if (data.get() && data.get()[0] && (PathFileExistsA(data.get()) ||
-                                        PathIsUNCA(data.get()))) {
-      char file_url[INTERNET_MAX_URL_LENGTH];
-      DWORD file_url_len = sizeof(file_url) / sizeof(file_url[0]);
-      if (SUCCEEDED(::UrlCreateFromPathA(data.get(),
-                                         file_url,
-                                         &file_url_len,
-                                         0))) {
-        *url = UTF8ToWide(file_url);
-        title->assign(*url);
-        success = true;
-      }
-    }
-    ReleaseStgMedium(&store);
-    if (success)
-      return true;
-  }
-
-  return false;
-}
-
-bool ClipboardUtil::GetFilenames(IDataObject* data_object,
-                                 std::vector<std::wstring>* filenames) {
-  DCHECK(data_object && filenames);
-  if (!HasFilenames(data_object))
-    return false;
-
-  STGMEDIUM medium;
-  if (FAILED(data_object->GetData(GetCFHDropFormat(), &medium)))
-    return false;
-
-  HDROP hdrop = static_cast<HDROP>(GlobalLock(medium.hGlobal));
-  if (!hdrop)
-    return false;
-
-  const int kMaxFilenameLen = 4096;
-  const unsigned num_files = DragQueryFileW(hdrop, 0xffffffff, 0, 0);
-  for (unsigned int i = 0; i < num_files; ++i) {
-    wchar_t filename[kMaxFilenameLen];
-    if (!DragQueryFileW(hdrop, i, filename, kMaxFilenameLen))
-      continue;
-    filenames->push_back(filename);
-  }
-
-  DragFinish(hdrop);
-  GlobalUnlock(medium.hGlobal);
-  // We don't need to call ReleaseStgMedium here because as far as I can tell,
-  // DragFinish frees the hGlobal for us.
-  return true;
-}
-
-bool ClipboardUtil::GetPlainText(IDataObject* data_object,
-                                 std::wstring* plain_text) {
-  DCHECK(data_object && plain_text);
-  if (!HasPlainText(data_object))
-    return false;
-
-  STGMEDIUM store;
-  bool success = false;
-  if (SUCCEEDED(data_object->GetData(GetPlainTextWFormat(), &store))) {
-    // Unicode text
-    ScopedHGlobal<wchar_t> data(store.hGlobal);
-    plain_text->assign(data.get());
-    ReleaseStgMedium(&store);
-    success = true;
-  } else if (SUCCEEDED(data_object->GetData(GetPlainTextFormat(), &store))) {
-    // ascii text
-    ScopedHGlobal<char> data(store.hGlobal);
-    plain_text->assign(UTF8ToWide(data.get()));
-    ReleaseStgMedium(&store);
-    success = true;
-  } else {
-    //If a file is dropped on the window, it does not provide either of the
-    //plain text formats, so here we try to forcibly get a url.
-    std::wstring title;
-    success = GetUrl(data_object, plain_text, &title);
-  }
-
-  return success;
-}
-
-bool ClipboardUtil::GetHtml(IDataObject* data_object,
-                            std::wstring* html, std::string* base_url) {
-  DCHECK(data_object && html && base_url);
-
-  if (SUCCEEDED(data_object->QueryGetData(GetHtmlFormat()))) {
-    STGMEDIUM store;
-    if (SUCCEEDED(data_object->GetData(GetHtmlFormat(), &store))) {
-      // MS CF html
-      ScopedHGlobal<char> data(store.hGlobal);
-
-      std::string html_utf8;
-      CFHtmlToHtml(std::string(data.get(), data.Size()), &html_utf8, base_url);
-      html->assign(UTF8ToWide(html_utf8));
-
-      ReleaseStgMedium(&store);
-      return true;
-    }
-  }
-
-  if (FAILED(data_object->QueryGetData(GetTextHtmlFormat())))
-    return false;
-
-  STGMEDIUM store;
-  if (FAILED(data_object->GetData(GetTextHtmlFormat(), &store)))
-    return false;
-
-  // text/html
-  ScopedHGlobal<wchar_t> data(store.hGlobal);
-  html->assign(data.get());
-  ReleaseStgMedium(&store);
-  return true;
-}
-
-bool ClipboardUtil::GetFileContents(IDataObject* data_object,
-    std::wstring* filename, std::string* file_contents) {
-  DCHECK(data_object && filename && file_contents);
-  bool has_data =
-      SUCCEEDED(data_object->QueryGetData(GetFileContentFormatZero())) ||
-      SUCCEEDED(data_object->QueryGetData(GetFileDescriptorFormat()));
-
-  if (!has_data)
-    return false;
-
-  STGMEDIUM content;
-  // The call to GetData can be very slow depending on what is in
-  // |data_object|.
-  if (SUCCEEDED(data_object->GetData(GetFileContentFormatZero(), &content))) {
-    if (TYMED_HGLOBAL == content.tymed) {
-      ScopedHGlobal<char> data(content.hGlobal);
-      file_contents->assign(data.get(), data.Size());
-    }
-    ReleaseStgMedium(&content);
-  }
-
-  STGMEDIUM description;
-  if (SUCCEEDED(data_object->GetData(GetFileDescriptorFormat(),
-                                     &description))) {
-    ScopedHGlobal<FILEGROUPDESCRIPTOR> fgd(description.hGlobal);
-    // We expect there to be at least one file in here.
-    DCHECK(fgd->cItems >= 1);
-    filename->assign(fgd->fgd[0].cFileName);
-    ReleaseStgMedium(&description);
-  }
-  return true;
-}
-
-// HtmlToCFHtml and CFHtmlToHtml are based on similar methods in
-// WebCore/platform/win/ClipboardUtilitiesWin.cpp.
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// Helper method for converting from text/html to MS CF_HTML.
-// Documentation for the CF_HTML format is available at
-// http://msdn.microsoft.com/en-us/library/aa767917(VS.85).aspx
-std::string ClipboardUtil::HtmlToCFHtml(const std::string& html,
-                                        const std::string& base_url) {
-  if (html.empty())
-    return std::string();
-
-  #define MAX_DIGITS 10
-  #define MAKE_NUMBER_FORMAT_1(digits) MAKE_NUMBER_FORMAT_2(digits)
-  #define MAKE_NUMBER_FORMAT_2(digits) "%0" #digits "u"
-  #define NUMBER_FORMAT MAKE_NUMBER_FORMAT_1(MAX_DIGITS)
-
-  static const char* header = "Version:0.9\r\n"
-      "StartHTML:" NUMBER_FORMAT "\r\n"
-      "EndHTML:" NUMBER_FORMAT "\r\n"
-      "StartFragment:" NUMBER_FORMAT "\r\n"
-      "EndFragment:" NUMBER_FORMAT "\r\n";
-  static const char* source_url_prefix = "SourceURL:";
-
-  static const char* start_markup =
-      "<html>\r\n<body>\r\n<!--StartFragment-->\r\n";
-  static const char* end_markup =
-      "\r\n<!--EndFragment-->\r\n</body>\r\n</html>";
-
-  // Calculate offsets
-  size_t start_html_offset = strlen(header) - strlen(NUMBER_FORMAT) * 4 +
-      MAX_DIGITS * 4;
-  if (!base_url.empty()) {
-    start_html_offset += strlen(source_url_prefix) +
-        base_url.length() + 2;  // Add 2 for \r\n.
-  }
-  size_t start_fragment_offset = start_html_offset + strlen(start_markup);
-  size_t end_fragment_offset = start_fragment_offset + html.length();
-  size_t end_html_offset = end_fragment_offset + strlen(end_markup);
-
-  std::string result = StringPrintf(header, start_html_offset,
-      end_html_offset, start_fragment_offset, end_fragment_offset);
-  if (!base_url.empty()) {
-    result.append(source_url_prefix);
-    result.append(base_url);
-    result.append("\r\n");
-  }
-  result.append(start_markup);
-  result.append(html);
-  result.append(end_markup);
-
-  #undef MAX_DIGITS
-  #undef MAKE_NUMBER_FORMAT_1
-  #undef MAKE_NUMBER_FORMAT_2
-  #undef NUMBER_FORMAT
-
-  return result;
-}
-
-// Helper method for converting from MS CF_HTML to text/html.
-void ClipboardUtil::CFHtmlToHtml(const std::string& cf_html,
-                                 std::string* html,
-                                 std::string* base_url) {
-  // Obtain base_url if present.
-  static std::string src_url_str("SourceURL:");
-  size_t line_start = cf_html.find(src_url_str);
-  if (line_start != std::string::npos) {
-    size_t src_end = cf_html.find("\n", line_start);
-    size_t src_start = line_start + src_url_str.length();
-    if (src_end != std::string::npos && src_start != std::string::npos) {
-      *base_url = cf_html.substr(src_start, src_end - src_start);
-      TrimWhitespace(*base_url, TRIM_ALL, base_url);
-    }
-  }
-
-  // Find the markup between "<!--StartFragment -->" and "<!--EndFragment-->".
-  std::string cf_html_lower = StringToLowerASCII(cf_html);
-  size_t markup_start = cf_html_lower.find("<html", 0);
-  size_t tag_start = cf_html.find("StartFragment", markup_start);
-  size_t fragment_start = cf_html.find('>', tag_start) + 1;
-  size_t tag_end = cf_html.rfind("EndFragment", std::string::npos);
-  size_t fragment_end = cf_html.rfind('<', tag_end);
-  if (fragment_start != std::string::npos &&
-      fragment_end != std::string::npos) {
-    *html = cf_html.substr(fragment_start, fragment_end - fragment_start);
-    TrimWhitespace(*html, TRIM_ALL, html);
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard_util.h
+++ /dev/null
@@ -1,63 +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.
-//
-// Some helper functions for working with the clipboard and IDataObjects.
-
-#ifndef BASE_CLIPBOARD_UTIL_H_
-#define BASE_CLIPBOARD_UTIL_H_
-
-#include <shlobj.h>
-#include <string>
-#include <vector>
-
-class ClipboardUtil {
- public:
-  /////////////////////////////////////////////////////////////////////////////
-  // Clipboard formats.
-  static FORMATETC* GetUrlFormat();
-  static FORMATETC* GetUrlWFormat();
-  static FORMATETC* GetMozUrlFormat();
-  static FORMATETC* GetPlainTextFormat();
-  static FORMATETC* GetPlainTextWFormat();
-  static FORMATETC* GetFilenameFormat();
-  static FORMATETC* GetFilenameWFormat();
-  // MS HTML Format
-  static FORMATETC* GetHtmlFormat();
-  // Firefox text/html
-  static FORMATETC* GetTextHtmlFormat();
-  static FORMATETC* GetCFHDropFormat();
-  static FORMATETC* GetFileDescriptorFormat();
-  static FORMATETC* GetFileContentFormatZero();
-  static FORMATETC* GetWebKitSmartPasteFormat();
-
-  /////////////////////////////////////////////////////////////////////////////
-  // These methods check to see if |data_object| has the requested type.
-  // Returns true if it does.
-  static bool HasUrl(IDataObject* data_object);
-  static bool HasFilenames(IDataObject* data_object);
-  static bool HasPlainText(IDataObject* data_object);
-
-  /////////////////////////////////////////////////////////////////////////////
-  // Helper methods to extract information from an IDataObject.  These methods
-  // return true if the requested data type is found in |data_object|.
-  static bool GetUrl(IDataObject* data_object,
-      std::wstring* url, std::wstring* title);
-  static bool GetFilenames(IDataObject* data_object,
-                           std::vector<std::wstring>* filenames);
-  static bool GetPlainText(IDataObject* data_object, std::wstring* plain_text);
-  static bool GetHtml(IDataObject* data_object, std::wstring* text_html,
-                      std::string* base_url);
-  static bool GetFileContents(IDataObject* data_object,
-                              std::wstring* filename,
-                              std::string* file_contents);
-
-  // A helper method for converting between MS CF_HTML format and plain
-  // text/html.
-  static std::string HtmlToCFHtml(const std::string& html,
-                                  const std::string& base_url);
-  static void CFHtmlToHtml(const std::string& cf_html, std::string* html,
-                           std::string* base_url);
-};
-
-#endif  // BASE_CLIPBOARD_UTIL_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/clipboard_win.cc
+++ /dev/null
@@ -1,650 +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.
-
-// Many of these functions are based on those found in
-// webkit/port/platform/PasteboardWin.cpp
-
-#include "base/clipboard.h"
-
-#include <shlobj.h>
-#include <shellapi.h>
-
-#include "base/clipboard_util.h"
-#include "base/lock.h"
-#include "base/logging.h"
-#include "base/message_loop.h"
-#include "base/shared_memory.h"
-#include "base/string_util.h"
-
-namespace {
-
-// A scoper to manage acquiring and automatically releasing the clipboard.
-class ScopedClipboard {
- public:
-  ScopedClipboard() : opened_(false) { }
-
-  ~ScopedClipboard() {
-    if (opened_)
-      Release();
-  }
-
-  bool Acquire(HWND owner) {
-    const int kMaxAttemptsToOpenClipboard = 5;
-
-    if (opened_) {
-      NOTREACHED();
-      return false;
-    }
-
-    // Attempt to open the clipboard, which will acquire the Windows clipboard
-    // lock.  This may fail if another process currently holds this lock.
-    // We're willing to try a few times in the hopes of acquiring it.
-    //
-    // This turns out to be an issue when using remote desktop because the
-    // rdpclip.exe process likes to read what we've written to the clipboard and
-    // send it to the RDP client.  If we open and close the clipboard in quick
-    // succession, we might be trying to open it while rdpclip.exe has it open,
-    // See Bug 815425.
-    //
-    // In fact, we believe we'll only spin this loop over remote desktop.  In
-    // normal situations, the user is initiating clipboard operations and there
-    // shouldn't be contention.
-
-    for (int attempts = 0; attempts < kMaxAttemptsToOpenClipboard; ++attempts) {
-      // If we didn't manage to open the clipboard, sleep a bit and be hopeful.
-      if (attempts != 0)
-        ::Sleep(5);
-
-      if (::OpenClipboard(owner)) {
-        opened_ = true;
-        return true;
-      }
-    }
-
-    // We failed to acquire the clipboard.
-    return false;
-  }
-
-  void Release() {
-    if (opened_) {
-      ::CloseClipboard();
-      opened_ = false;
-    } else {
-      NOTREACHED();
-    }
-  }
-
- private:
-  bool opened_;
-};
-
-LRESULT CALLBACK ClipboardOwnerWndProc(HWND hwnd,
-                                       UINT message,
-                                       WPARAM wparam,
-                                       LPARAM lparam) {
-  LRESULT lresult = 0;
-
-  switch (message) {
-  case WM_RENDERFORMAT:
-    // This message comes when SetClipboardData was sent a null data handle
-    // and now it's come time to put the data on the clipboard.
-    // We always set data, so there isn't a need to actually do anything here.
-    break;
-  case WM_RENDERALLFORMATS:
-    // This message comes when SetClipboardData was sent a null data handle
-    // and now this application is about to quit, so it must put data on
-    // the clipboard before it exits.
-    // We always set data, so there isn't a need to actually do anything here.
-    break;
-  case WM_DRAWCLIPBOARD:
-    break;
-  case WM_DESTROY:
-    break;
-  case WM_CHANGECBCHAIN:
-    break;
-  default:
-    lresult = DefWindowProc(hwnd, message, wparam, lparam);
-    break;
-  }
-  return lresult;
-}
-
-template <typename charT>
-HGLOBAL CreateGlobalData(const std::basic_string<charT>& str) {
-  HGLOBAL data =
-    ::GlobalAlloc(GMEM_MOVEABLE, ((str.size() + 1) * sizeof(charT)));
-  if (data) {
-    charT* raw_data = static_cast<charT*>(::GlobalLock(data));
-    memcpy(raw_data, str.data(), str.size() * sizeof(charT));
-    raw_data[str.size()] = '\0';
-    ::GlobalUnlock(data);
-  }
-  return data;
-};
-
-} // namespace
-
-Clipboard::Clipboard() : create_window_(false) {
-  if (MessageLoop::current()->type() == MessageLoop::TYPE_UI) {
-    // Make a dummy HWND to be the clipboard's owner.
-    WNDCLASSEX wcex = {0};
-    wcex.cbSize = sizeof(WNDCLASSEX);
-    wcex.lpfnWndProc = ClipboardOwnerWndProc;
-    wcex.hInstance = GetModuleHandle(NULL);
-    wcex.lpszClassName = L"ClipboardOwnerWindowClass";
-    ::RegisterClassEx(&wcex);
-    create_window_ = true;
-  }
-
-  clipboard_owner_ = NULL;
-}
-
-Clipboard::~Clipboard() {
-  if (clipboard_owner_)
-    ::DestroyWindow(clipboard_owner_);
-  clipboard_owner_ = NULL;
-}
-
-void Clipboard::WriteObjects(const ObjectMap& objects) {
-  WriteObjects(objects, NULL);
-}
-
-void Clipboard::WriteObjects(const ObjectMap& objects,
-                             base::ProcessHandle process) {
-  ScopedClipboard clipboard;
-  if (!clipboard.Acquire(GetClipboardWindow()))
-    return;
-
-  ::EmptyClipboard();
-
-  for (ObjectMap::const_iterator iter = objects.begin();
-       iter != objects.end(); ++iter) {
-    if (iter->first == CBF_SMBITMAP)
-      WriteBitmapFromSharedMemory(&(iter->second[0].front()),
-                                  &(iter->second[1].front()),
-                                  process);
-    else
-      DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
-  }
-}
-
-void Clipboard::WriteText(const char* text_data, size_t text_len) {
-  string16 text;
-  UTF8ToUTF16(text_data, text_len, &text);
-  HGLOBAL glob = CreateGlobalData(text);
-
-  WriteToClipboard(CF_UNICODETEXT, glob);
-}
-
-void Clipboard::WriteHTML(const char* markup_data,
-                          size_t markup_len,
-                          const char* url_data,
-                          size_t url_len) {
-  std::string markup(markup_data, markup_len);
-  std::string url;
-
-  if (url_len > 0)
-    url.assign(url_data, url_len);
-
-  std::string html_fragment = ClipboardUtil::HtmlToCFHtml(markup, url);
-  HGLOBAL glob = CreateGlobalData(html_fragment);
-
-  WriteToClipboard(StringToInt(GetHtmlFormatType()), glob);
-}
-
-void Clipboard::WriteBookmark(const char* title_data,
-                              size_t title_len,
-                              const char* url_data,
-                              size_t url_len) {
-  std::string bookmark(title_data, title_len);
-  bookmark.append(1, L'\n');
-  bookmark.append(url_data, url_len);
-
-  string16 wide_bookmark = UTF8ToWide(bookmark);
-  HGLOBAL glob = CreateGlobalData(wide_bookmark);
-
-  WriteToClipboard(StringToInt(GetUrlWFormatType()), glob);
-}
-
-void Clipboard::WriteHyperlink(const char* title_data,
-                               size_t title_len,
-                               const char* url_data,
-                               size_t url_len) {
-  // Store as a bookmark.
-  WriteBookmark(title_data, title_len, url_data, url_len);
-
-  std::string title(title_data, title_len),
-      url(url_data, url_len),
-      link("<a href=\"");
-
-  // Construct the hyperlink.
-  link.append(url);
-  link.append("\">");
-  link.append(title);
-  link.append("</a>");
-
-  // Store hyperlink as html.
-  WriteHTML(link.c_str(), link.size(), NULL, 0);
-}
-
-void Clipboard::WriteWebSmartPaste() {
-  DCHECK(clipboard_owner_);
-  ::SetClipboardData(StringToInt(GetWebKitSmartPasteFormatType()), NULL);
-}
-
-void Clipboard::WriteBitmap(const char* pixel_data, const char* size_data) {
-  const gfx::Size* size = reinterpret_cast<const gfx::Size*>(size_data);
-  HDC dc = ::GetDC(NULL);
-
-  // This doesn't actually cost us a memcpy when the bitmap comes from the
-  // renderer as we load it into the bitmap using setPixels which just sets a
-  // pointer.  Someone has to memcpy it into GDI, it might as well be us here.
-
-  // TODO(darin): share data in gfx/bitmap_header.cc somehow
-  BITMAPINFO bm_info = {0};
-  bm_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-  bm_info.bmiHeader.biWidth = size->width();
-  bm_info.bmiHeader.biHeight = -size->height();  // sets vertical orientation
-  bm_info.bmiHeader.biPlanes = 1;
-  bm_info.bmiHeader.biBitCount = 32;
-  bm_info.bmiHeader.biCompression = BI_RGB;
-
-  // ::CreateDIBSection allocates memory for us to copy our bitmap into.
-  // Unfortunately, we can't write the created bitmap to the clipboard,
-  // (see http://msdn2.microsoft.com/en-us/library/ms532292.aspx)
-  void *bits;
-  HBITMAP source_hbitmap =
-      ::CreateDIBSection(dc, &bm_info, DIB_RGB_COLORS, &bits, NULL, 0);
-
-  if (bits && source_hbitmap) {
-    // Copy the bitmap out of shared memory and into GDI
-    memcpy(bits, pixel_data, 4 * size->width() * size->height());
-
-    // Now we have an HBITMAP, we can write it to the clipboard
-    WriteBitmapFromHandle(source_hbitmap, *size);
-  }
-
-  ::DeleteObject(source_hbitmap);
-  ::ReleaseDC(NULL, dc);
-}
-
-void Clipboard::WriteBitmapFromSharedMemory(const char* bitmap_data,
-                                            const char* size_data,
-                                            base::ProcessHandle process) {
-  const gfx::Size* size = reinterpret_cast<const gfx::Size*>(size_data);
-
-  // bitmap_data has an encoded shared memory object. See
-  // DuplicateRemoteHandles().
-  char* ptr = const_cast<char*>(bitmap_data);
-  scoped_ptr<const base::SharedMemory> bitmap(*
-      reinterpret_cast<const base::SharedMemory**>(ptr));
-
-  // TODO(darin): share data in gfx/bitmap_header.cc somehow.
-  BITMAPINFO bm_info = {0};
-  bm_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-  bm_info.bmiHeader.biWidth = size->width();
-  // Sets the vertical orientation.
-  bm_info.bmiHeader.biHeight = -size->height();
-  bm_info.bmiHeader.biPlanes = 1;
-  bm_info.bmiHeader.biBitCount = 32;
-  bm_info.bmiHeader.biCompression = BI_RGB;
-
-  HDC dc = ::GetDC(NULL);
-
-  // We can create an HBITMAP directly using the shared memory handle, saving
-  // a memcpy.
-  HBITMAP source_hbitmap =
-      ::CreateDIBSection(dc, &bm_info, DIB_RGB_COLORS, NULL,
-                         bitmap->handle(), 0);
-
-  if (source_hbitmap) {
-    // Now we can write the HBITMAP to the clipboard
-    WriteBitmapFromHandle(source_hbitmap, *size);
-  }
-
-  ::DeleteObject(source_hbitmap);
-  ::ReleaseDC(NULL, dc);
-}
-
-void Clipboard::WriteBitmapFromHandle(HBITMAP source_hbitmap,
-                                      const gfx::Size& size) {
-  // We would like to just call ::SetClipboardData on the source_hbitmap,
-  // but that bitmap might not be of a sort we can write to the clipboard.
-  // For this reason, we create a new bitmap, copy the bits over, and then
-  // write that to the clipboard.
-
-  HDC dc = ::GetDC(NULL);
-  HDC compatible_dc = ::CreateCompatibleDC(NULL);
-  HDC source_dc = ::CreateCompatibleDC(NULL);
-
-  // This is the HBITMAP we will eventually write to the clipboard
-  HBITMAP hbitmap = ::CreateCompatibleBitmap(dc, size.width(), size.height());
-  if (!hbitmap) {
-    // Failed to create the bitmap
-    ::DeleteDC(compatible_dc);
-    ::DeleteDC(source_dc);
-    ::ReleaseDC(NULL, dc);
-    return;
-  }
-
-  HBITMAP old_hbitmap = (HBITMAP)SelectObject(compatible_dc, hbitmap);
-  HBITMAP old_source = (HBITMAP)SelectObject(source_dc, source_hbitmap);
-
-  // Now we need to blend it into an HBITMAP we can place on the clipboard
-  BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
-  ::GdiAlphaBlend(compatible_dc, 0, 0, size.width(), size.height(),
-                  source_dc, 0, 0, size.width(), size.height(), bf);
-
-  // Clean up all the handles we just opened
-  ::SelectObject(compatible_dc, old_hbitmap);
-  ::SelectObject(source_dc, old_source);
-  ::DeleteObject(old_hbitmap);
-  ::DeleteObject(old_source);
-  ::DeleteDC(compatible_dc);
-  ::DeleteDC(source_dc);
-  ::ReleaseDC(NULL, dc);
-
-  WriteToClipboard(CF_BITMAP, hbitmap);
-}
-
-// Write a file or set of files to the clipboard in HDROP format. When the user
-// invokes a paste command (in a Windows explorer shell, for example), the files
-// will be copied to the paste location.
-void Clipboard::WriteFiles(const char* file_data, size_t file_len) {
-  // Calculate the amount of space we'll need store the strings and
-  // a DROPFILES struct.
-  size_t bytes = sizeof(DROPFILES) + file_len;
-
-  HANDLE hdata = ::GlobalAlloc(GMEM_MOVEABLE, bytes);
-  if (!hdata)
-    return;
-
-  char* data = static_cast<char*>(::GlobalLock(hdata));
-  DROPFILES* drop_files = reinterpret_cast<DROPFILES*>(data);
-  drop_files->pFiles = sizeof(DROPFILES);
-  drop_files->fWide = TRUE;
-
-  memcpy(data + sizeof(DROPFILES), file_data, file_len);
-
-  ::GlobalUnlock(hdata);
-  WriteToClipboard(CF_HDROP, hdata);
-}
-
-void Clipboard::WriteToClipboard(unsigned int format, HANDLE handle) {
-  DCHECK(clipboard_owner_);
-  if (handle && !::SetClipboardData(format, handle)) {
-    DCHECK(ERROR_CLIPBOARD_NOT_OPEN != GetLastError());
-    FreeData(format, handle);
-  }
-}
-
-bool Clipboard::IsFormatAvailable(const Clipboard::FormatType& format) const {
-  return ::IsClipboardFormatAvailable(StringToInt(format)) != FALSE;
-}
-
-void Clipboard::ReadText(string16* result) const {
-  if (!result) {
-    NOTREACHED();
-    return;
-  }
-
-  result->clear();
-
-  // Acquire the clipboard.
-  ScopedClipboard clipboard;
-  if (!clipboard.Acquire(GetClipboardWindow()))
-    return;
-
-  HANDLE data = ::GetClipboardData(CF_UNICODETEXT);
-  if (!data)
-    return;
-
-  result->assign(static_cast<const char16*>(::GlobalLock(data)));
-  ::GlobalUnlock(data);
-}
-
-void Clipboard::ReadAsciiText(std::string* result) const {
-  if (!result) {
-    NOTREACHED();
-    return;
-  }
-
-  result->clear();
-
-  // Acquire the clipboard.
-  ScopedClipboard clipboard;
-  if (!clipboard.Acquire(GetClipboardWindow()))
-    return;
-
-  HANDLE data = ::GetClipboardData(CF_TEXT);
-  if (!data)
-    return;
-
-  result->assign(static_cast<const char*>(::GlobalLock(data)));
-  ::GlobalUnlock(data);
-}
-
-void Clipboard::ReadHTML(string16* markup, std::string* src_url) const {
-  if (markup)
-    markup->clear();
-
-  if (src_url)
-    src_url->clear();
-
-  // Acquire the clipboard.
-  ScopedClipboard clipboard;
-  if (!clipboard.Acquire(GetClipboardWindow()))
-    return;
-
-  HANDLE data = ::GetClipboardData(StringToInt(GetHtmlFormatType()));
-  if (!data)
-    return;
-
-  std::string html_fragment(static_cast<const char*>(::GlobalLock(data)));
-  ::GlobalUnlock(data);
-
-  std::string markup_utf8;
-  ClipboardUtil::CFHtmlToHtml(html_fragment, &markup_utf8, src_url);
-  markup->assign(UTF8ToWide(markup_utf8));
-}
-
-void Clipboard::ReadBookmark(string16* title, std::string* url) const {
-  if (title)
-    title->clear();
-
-  if (url)
-    url->clear();
-
-  // Acquire the clipboard.
-  ScopedClipboard clipboard;
-  if (!clipboard.Acquire(GetClipboardWindow()))
-    return;
-
-  HANDLE data = ::GetClipboardData(StringToInt(GetUrlWFormatType()));
-  if (!data)
-    return;
-
-  string16 bookmark(static_cast<const char16*>(::GlobalLock(data)));
-  ::GlobalUnlock(data);
-
-  ParseBookmarkClipboardFormat(bookmark, title, url);
-}
-
-// Read a file in HDROP format from the clipboard.
-void Clipboard::ReadFile(FilePath* file) const {
-  if (!file) {
-    NOTREACHED();
-    return;
-  }
-
-  *file = FilePath();
-  std::vector<FilePath> files;
-  ReadFiles(&files);
-
-  // Take the first file, if available.
-  if (!files.empty())
-    *file = files[0];
-}
-
-// Read a set of files in HDROP format from the clipboard.
-void Clipboard::ReadFiles(std::vector<FilePath>* files) const {
-  if (!files) {
-    NOTREACHED();
-    return;
-  }
-
-  files->clear();
-
-  ScopedClipboard clipboard;
-  if (!clipboard.Acquire(GetClipboardWindow()))
-    return;
-
-  HDROP drop = static_cast<HDROP>(::GetClipboardData(CF_HDROP));
-  if (!drop)
-    return;
-
-  // Count of files in the HDROP.
-  int count = ::DragQueryFile(drop, 0xffffffff, NULL, 0);
-
-  if (count) {
-    for (int i = 0; i < count; ++i) {
-      int size = ::DragQueryFile(drop, i, NULL, 0) + 1;
-      std::wstring file;
-      ::DragQueryFile(drop, i, WriteInto(&file, size), size);
-      files->push_back(FilePath(file));
-    }
-  }
-}
-
-// static
-void Clipboard::ParseBookmarkClipboardFormat(const string16& bookmark,
-                                             string16* title,
-                                             std::string* url) {
-  const string16 kDelim = ASCIIToUTF16("\r\n");
-
-  const size_t title_end = bookmark.find_first_of(kDelim);
-  if (title)
-    title->assign(bookmark.substr(0, title_end));
-
-  if (url) {
-    const size_t url_start = bookmark.find_first_not_of(kDelim, title_end);
-    if (url_start != string16::npos)
-      *url = UTF16ToUTF8(bookmark.substr(url_start, string16::npos));
-  }
-}
-
-// static
-Clipboard::FormatType Clipboard::GetUrlFormatType() {
-  return IntToString(ClipboardUtil::GetUrlFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetUrlWFormatType() {
-  return IntToString(ClipboardUtil::GetUrlWFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetMozUrlFormatType() {
-  return IntToString(ClipboardUtil::GetMozUrlFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetPlainTextFormatType() {
-  return IntToString(ClipboardUtil::GetPlainTextFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetPlainTextWFormatType() {
-  return IntToString(ClipboardUtil::GetPlainTextWFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetFilenameFormatType() {
-  return IntToString(ClipboardUtil::GetFilenameFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetFilenameWFormatType() {
-  return IntToString(ClipboardUtil::GetFilenameWFormat()->cfFormat);
-}
-
-// MS HTML Format
-// static
-Clipboard::FormatType Clipboard::GetHtmlFormatType() {
-  return IntToString(ClipboardUtil::GetHtmlFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetBitmapFormatType() {
-  return IntToString(CF_BITMAP);
-}
-
-// Firefox text/html
-// static
-Clipboard::FormatType Clipboard::GetTextHtmlFormatType() {
-  return IntToString(ClipboardUtil::GetTextHtmlFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetCFHDropFormatType() {
-  return IntToString(ClipboardUtil::GetCFHDropFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetFileDescriptorFormatType() {
-  return IntToString(ClipboardUtil::GetFileDescriptorFormat()->cfFormat);
-}
-
-// static
-Clipboard::FormatType Clipboard::GetFileContentFormatZeroType() {
-  return IntToString(ClipboardUtil::GetFileContentFormatZero()->cfFormat);
-}
-
-// static
-void Clipboard::DuplicateRemoteHandles(base::ProcessHandle process,
-                                       ObjectMap* objects) {
-  for (ObjectMap::iterator iter = objects->begin(); iter != objects->end();
-       ++iter) {
-    if (iter->first == CBF_SMBITMAP) {
-      // There is a shared memory handle encoded on the first ObjectMapParam.
-      // Use it to open a local handle to the memory.
-      char* bitmap_data = &(iter->second[0].front());
-      base::SharedMemoryHandle* remote_bitmap_handle =
-          reinterpret_cast<base::SharedMemoryHandle*>(bitmap_data);
-
-      base::SharedMemory* bitmap = new base::SharedMemory(*remote_bitmap_handle,
-                                                          false, process);
-
-      // We store the object where the remote handle was located so it can
-      // be retrieved by the UI thread (see WriteBitmapFromSharedMemory()).
-      iter->second[0].clear();
-      for (size_t i = 0; i < sizeof(bitmap); i++)
-        iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]);
-    }
-  }
-}
-
-// static
-Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() {
-  return IntToString(ClipboardUtil::GetWebKitSmartPasteFormat()->cfFormat);
-}
-
-// static
-void Clipboard::FreeData(unsigned int format, HANDLE data) {
-  if (format == CF_BITMAP)
-    ::DeleteObject(static_cast<HBITMAP>(data));
-  else
-    ::GlobalFree(data);
-}
-
-HWND Clipboard::GetClipboardWindow() const {
-  if (!clipboard_owner_ && create_window_) {
-    clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass",
-                                      L"ClipboardOwnerWindow",
-                                      0, 0, 0, 0, 0,
-                                      HWND_MESSAGE,
-                                      0, 0, 0);
-  }
-  return clipboard_owner_;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/image_util.cc
+++ /dev/null
@@ -1,72 +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>
-#include <ImageHlp.h>
-#include <psapi.h>
-
-#include "base/image_util.h"
-#include "base/process_util.h"
-
-// imagehlp.dll appears to ship in all win versions after Win95.
-// nsylvain verified it is present in win2k.
-// Using #pragma comment for dependency, instead of LoadLibrary/GetProcAddress.
-#pragma comment(lib, "imagehlp.lib")
-
-namespace image_util {
-
-// ImageMetrics
-ImageMetrics::ImageMetrics(HANDLE process) : process_(process) {
-}
-
-ImageMetrics::~ImageMetrics() {
-}
-
-bool ImageMetrics::GetDllImageSectionData(const std::string& loaded_dll_name,
-                                          ImageSectionsData* section_sizes) {
-  // Get a handle to the loaded DLL
-  HMODULE the_dll = GetModuleHandleA(loaded_dll_name.c_str());
-  char full_filename[MAX_PATH];
-  // Get image path
-  if (GetModuleFileNameExA(process_, the_dll, full_filename, MAX_PATH)) {
-    return GetImageSectionSizes(full_filename, section_sizes);
-  }
-  return false;
-}
-
-bool ImageMetrics::GetProcessImageSectionData(ImageSectionsData*
-                                              section_sizes) {
-  char exe_path[MAX_PATH];
-  // Get image path
-  if (GetModuleFileNameExA(process_, NULL, exe_path, MAX_PATH)) {
-    return GetImageSectionSizes(exe_path, section_sizes);
-  }
-  return false;
-}
-
-// private
-bool ImageMetrics::GetImageSectionSizes(char* qualified_path,
-                                        ImageSectionsData* result) {
-  LOADED_IMAGE li;
-  // TODO (timsteele): There is no unicode version for MapAndLoad, hence
-  // why ansi functions are used in this class. Should we try and rewrite
-  // this call ourselves to be safe?
-  if (MapAndLoad(qualified_path, 0, &li, FALSE, TRUE)) {
-    IMAGE_SECTION_HEADER* section_header = li.Sections;
-    for (unsigned i = 0; i < li.NumberOfSections; i++, section_header++) {
-      std::string name(reinterpret_cast<char*>(section_header->Name));
-      ImageSectionData data(name, section_header->Misc.VirtualSize ?
-          section_header->Misc.VirtualSize :
-          section_header->SizeOfRawData);
-      // copy into result
-      result->push_back(data);
-    }
-  } else {
-    // map and load failed
-    return false;
-  }
-  UnMapAndLoad(&li);
-  return true;
-}
-
-} // namespace image_util
deleted file mode 100644
--- a/ipc/chromium/src/base/image_util.h
+++ /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.
-
-// This file/namespace contains utility functions for gathering
-// information about PE (Portable Executable) headers within
-// images (dll's / exe's )
-
-#ifndef BASE_IMAGE_UTIL_H_
-#define BASE_IMAGE_UTIL_H_
-
-#include <windows.h>
-#include <vector>
-
-#include "base/basictypes.h"
-
-namespace image_util {
-
-// Contains both the PE section name (.text, .reloc etc) and its size.
-struct ImageSectionData {
-  ImageSectionData (const std::string& section_name, size_t section_size)
-      : name (section_name),
-        size_in_bytes(section_size) {
-  }
-
-  std::string name;
-  size_t size_in_bytes;
-};
-
-typedef std::vector<ImageSectionData> ImageSectionsData;
-
-// Provides image statistics for modules of a specified process, or for the
-// specified process' own executable file. To use, invoke CreateImageMetrics()
-// to get an instance for a specified process, then access the information via
-// methods.
-class ImageMetrics {
- public:
-  // Creates an ImageMetrics instance for given process owned by
-  // the caller.
-  explicit ImageMetrics(HANDLE process);
-  ~ImageMetrics();
-
-  // Fills a vector of ImageSectionsData containing name/size info
-  // for every section found in the specified dll's PE section table.
-  // The DLL must be loaded by the process associated with this ImageMetrics
-  // instance.
-  bool GetDllImageSectionData(const std::string& loaded_dll_name,
-                              ImageSectionsData* section_sizes);
-
-  // Fills a vector if ImageSectionsData containing name/size info
-  // for every section found in the executable file of the process
-  // associated with this ImageMetrics instance.
-  bool GetProcessImageSectionData(ImageSectionsData* section_sizes);
-
- private:
-  // Helper for GetDllImageSectionData and GetProcessImageSectionData
-  bool GetImageSectionSizes(char* qualified_path, ImageSectionsData* result);
-
-  HANDLE process_;
-
-  DISALLOW_COPY_AND_ASSIGN(ImageMetrics);
-};
-
-}  // namespace image_util
-
-#endif  // BASE_IMAGE_UTIL_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/json_reader.cc
+++ /dev/null
@@ -1,641 +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/json_reader.h"
-
-#include "base/float_util.h"
-#include "base/logging.h"
-#include "base/scoped_ptr.h"
-#include "base/string_util.h"
-#include "base/values.h"
-
-static const JSONReader::Token kInvalidToken(JSONReader::Token::INVALID_TOKEN,
-                                             0, 0);
-static const int kStackLimit = 100;
-
-namespace {
-
-inline int HexToInt(wchar_t c) {
-  if ('0' <= c && c <= '9') {
-    return c - '0';
-  } else if ('A' <= c && c <= 'F') {
-    return c - 'A' + 10;
-  } else if ('a' <= c && c <= 'f') {
-    return c - 'a' + 10;
-  }
-  NOTREACHED();
-  return 0;
-}
-
-// A helper method for ParseNumberToken.  It reads an int from the end of
-// token.  The method returns false if there is no valid integer at the end of
-// the token.
-bool ReadInt(JSONReader::Token& token, bool can_have_leading_zeros) {
-  wchar_t first = token.NextChar();
-  int len = 0;
-
-  // Read in more digits
-  wchar_t c = first;
-  while ('\0' != c && '0' <= c && c <= '9') {
-    ++token.length;
-    ++len;
-    c = token.NextChar();
-  }
-  // We need at least 1 digit.
-  if (len == 0)
-    return false;
-
-  if (!can_have_leading_zeros && len > 1 && '0' == first)
-    return false;
-
-  return true;
-}
-
-// A helper method for ParseStringToken.  It reads |digits| hex digits from the
-// token. If the sequence if digits is not valid (contains other characters),
-// the method returns false.
-bool ReadHexDigits(JSONReader::Token& token, int digits) {
-  for (int i = 1; i <= digits; ++i) {
-    wchar_t c = *(token.begin + token.length + i);
-    if ('\0' == c)
-      return false;
-    if (!(('0' <= c && c <= '9') || ('a' <= c && c <= 'f') ||
-          ('A' <= c && c <= 'F'))) {
-      return false;
-    }
-  }
-
-  token.length += digits;
-  return true;
-}
-
-}  // anonymous namespace
-
-const char* JSONReader::kBadRootElementType =
-    "Root value must be an array or object.";
-const char* JSONReader::kInvalidEscape =
-    "Invalid escape sequence.";
-const char* JSONReader::kSyntaxError =
-    "Syntax error.";
-const char* JSONReader::kTrailingComma =
-    "Trailing comma not allowed.";
-const char* JSONReader::kTooMuchNesting =
-    "Too much nesting.";
-const char* JSONReader::kUnexpectedDataAfterRoot =
-    "Unexpected data after root element.";
-const char* JSONReader::kUnsupportedEncoding =
-    "Unsupported encoding. JSON must be UTF-8.";
-const char* JSONReader::kUnquotedDictionaryKey =
-    "Dictionary keys must be quoted.";
-
-/* static */
-Value* JSONReader::Read(const std::string& json,
-                        bool allow_trailing_comma) {
-  return ReadAndReturnError(json, allow_trailing_comma, NULL);
-}
-
-/* static */
-Value* JSONReader::ReadAndReturnError(const std::string& json,
-                                      bool allow_trailing_comma,
-                                      std::string *error_message_out) {
-  JSONReader reader = JSONReader();
-  Value* root = reader.JsonToValue(json, true, allow_trailing_comma);
-  if (root)
-    return root;
-
-  if (error_message_out)
-    *error_message_out = reader.error_message();
-
-  return NULL;
-}
-
-/* static */
-std::string JSONReader::FormatErrorMessage(int line, int column,
-                                           const char* description) {
-  return StringPrintf("Line: %i, column: %i, %s",
-                      line, column, description);
-}
-
-JSONReader::JSONReader()
-  : start_pos_(NULL), json_pos_(NULL), stack_depth_(0),
-    allow_trailing_comma_(false) {}
-
-Value* JSONReader::JsonToValue(const std::string& json, bool check_root,
-                               bool allow_trailing_comma) {
-  // The input must be in UTF-8.
-  if (!IsStringUTF8(json.c_str())) {
-    error_message_ = kUnsupportedEncoding;
-    return NULL;
-  }
-
-  // The conversion from UTF8 to wstring removes null bytes for us
-  // (a good thing).
-  std::wstring json_wide(UTF8ToWide(json));
-  start_pos_ = json_wide.c_str();
-
-  // When the input JSON string starts with a UTF-8 Byte-Order-Mark
-  // (0xEF, 0xBB, 0xBF), the UTF8ToWide() function converts it to a Unicode
-  // BOM (U+FEFF). To avoid the JSONReader::BuildValue() function from
-  // mis-treating a Unicode BOM as an invalid character and returning NULL,
-  // skip a converted Unicode BOM if it exists.
-  if (!json_wide.empty() && start_pos_[0] == 0xFEFF) {
-    ++start_pos_;
-  }
-
-  json_pos_ = start_pos_;
-  allow_trailing_comma_ = allow_trailing_comma;
-  stack_depth_ = 0;
-  error_message_.clear();
-
-  scoped_ptr<Value> root(BuildValue(check_root));
-  if (root.get()) {
-    if (ParseToken().type == Token::END_OF_INPUT) {
-      return root.release();
-    } else {
-      SetErrorMessage(kUnexpectedDataAfterRoot, json_pos_);
-    }
-  }
-
-  // Default to calling errors "syntax errors".
-  if (error_message_.empty())
-    SetErrorMessage(kSyntaxError, json_pos_);
-
-  return NULL;
-}
-
-Value* JSONReader::BuildValue(bool is_root) {
-  ++stack_depth_;
-  if (stack_depth_ > kStackLimit) {
-    SetErrorMessage(kTooMuchNesting, json_pos_);
-    return NULL;
-  }
-
-  Token token = ParseToken();
-  // The root token must be an array or an object.
-  if (is_root && token.type != Token::OBJECT_BEGIN &&
-      token.type != Token::ARRAY_BEGIN) {
-    SetErrorMessage(kBadRootElementType, json_pos_);
-    return NULL;
-  }
-
-  scoped_ptr<Value> node;
-
-  switch (token.type) {
-    case Token::END_OF_INPUT:
-    case Token::INVALID_TOKEN:
-      return NULL;
-
-    case Token::NULL_TOKEN:
-      node.reset(Value::CreateNullValue());
-      break;
-
-    case Token::BOOL_TRUE:
-      node.reset(Value::CreateBooleanValue(true));
-      break;
-
-    case Token::BOOL_FALSE:
-      node.reset(Value::CreateBooleanValue(false));
-      break;
-
-    case Token::NUMBER:
-      node.reset(DecodeNumber(token));
-      if (!node.get())
-        return NULL;
-      break;
-
-    case Token::STRING:
-      node.reset(DecodeString(token));
-      if (!node.get())
-        return NULL;
-      break;
-
-    case Token::ARRAY_BEGIN:
-      {
-        json_pos_ += token.length;
-        token = ParseToken();
-
-        node.reset(new ListValue());
-        while (token.type != Token::ARRAY_END) {
-          Value* array_node = BuildValue(false);
-          if (!array_node)
-            return NULL;
-          static_cast<ListValue*>(node.get())->Append(array_node);
-
-          // After a list value, we expect a comma or the end of the list.
-          token = ParseToken();
-          if (token.type == Token::LIST_SEPARATOR) {
-            json_pos_ += token.length;
-            token = ParseToken();
-            // Trailing commas are invalid according to the JSON RFC, but some
-            // consumers need the parsing leniency, so handle accordingly.
-            if (token.type == Token::ARRAY_END) {
-              if (!allow_trailing_comma_) {
-                SetErrorMessage(kTrailingComma, json_pos_);
-                return NULL;
-              }
-              // Trailing comma OK, stop parsing the Array.
-              break;
-            }
-          } else if (token.type != Token::ARRAY_END) {
-            // Unexpected value after list value.  Bail out.
-            return NULL;
-          }
-        }
-        if (token.type != Token::ARRAY_END) {
-          return NULL;
-        }
-        break;
-      }
-
-    case Token::OBJECT_BEGIN:
-      {
-        json_pos_ += token.length;
-        token = ParseToken();
-
-        node.reset(new DictionaryValue);
-        while (token.type != Token::OBJECT_END) {
-          if (token.type != Token::STRING) {
-            SetErrorMessage(kUnquotedDictionaryKey, json_pos_);
-            return NULL;
-          }
-          scoped_ptr<Value> dict_key_value(DecodeString(token));
-          if (!dict_key_value.get())
-            return NULL;
-
-          // Convert the key into a wstring.
-          std::wstring dict_key;
-          bool success = dict_key_value->GetAsString(&dict_key);
-          DCHECK(success);
-
-          json_pos_ += token.length;
-          token = ParseToken();
-          if (token.type != Token::OBJECT_PAIR_SEPARATOR)
-            return NULL;
-
-          json_pos_ += token.length;
-          token = ParseToken();
-          Value* dict_value = BuildValue(false);
-          if (!dict_value)
-            return NULL;
-          static_cast<DictionaryValue*>(node.get())->Set(dict_key, dict_value);
-
-          // After a key/value pair, we expect a comma or the end of the
-          // object.
-          token = ParseToken();
-          if (token.type == Token::LIST_SEPARATOR) {
-            json_pos_ += token.length;
-            token = ParseToken();
-            // Trailing commas are invalid according to the JSON RFC, but some
-            // consumers need the parsing leniency, so handle accordingly.
-            if (token.type == Token::OBJECT_END) {
-              if (!allow_trailing_comma_) {
-                SetErrorMessage(kTrailingComma, json_pos_);
-                return NULL;
-              }
-              // Trailing comma OK, stop parsing the Object.
-              break;
-            }
-          } else if (token.type != Token::OBJECT_END) {
-            // Unexpected value after last object value.  Bail out.
-            return NULL;
-          }
-        }
-        if (token.type != Token::OBJECT_END)
-          return NULL;
-
-        break;
-      }
-
-    default:
-      // We got a token that's not a value.
-      return NULL;
-  }
-  json_pos_ += token.length;
-
-  --stack_depth_;
-  return node.release();
-}
-
-JSONReader::Token JSONReader::ParseNumberToken() {
-  // We just grab the number here.  We validate the size in DecodeNumber.
-  // According   to RFC4627, a valid number is: [minus] int [frac] [exp]
-  Token token(Token::NUMBER, json_pos_, 0);
-  wchar_t c = *json_pos_;
-  if ('-' == c) {
-    ++token.length;
-    c = token.NextChar();
-  }
-
-  if (!ReadInt(token, false))
-    return kInvalidToken;
-
-  // Optional fraction part
-  c = token.NextChar();
-  if ('.' == c) {
-    ++token.length;
-    if (!ReadInt(token, true))
-      return kInvalidToken;
-    c = token.NextChar();
-  }
-
-  // Optional exponent part
-  if ('e' == c || 'E' == c) {
-    ++token.length;
-    c = token.NextChar();
-    if ('-' == c || '+' == c) {
-      ++token.length;
-      c = token.NextChar();
-    }
-    if (!ReadInt(token, true))
-      return kInvalidToken;
-  }
-
-  return token;
-}
-
-Value* JSONReader::DecodeNumber(const Token& token) {
-  const std::wstring num_string(token.begin, token.length);
-
-  int num_int;
-  if (StringToInt(WideToUTF16Hack(num_string), &num_int))
-    return Value::CreateIntegerValue(num_int);
-
-  double num_double;
-  if (StringToDouble(WideToUTF16Hack(num_string), &num_double) &&
-      base::IsFinite(num_double))
-    return Value::CreateRealValue(num_double);
-
-  return NULL;
-}
-
-JSONReader::Token JSONReader::ParseStringToken() {
-  Token token(Token::STRING, json_pos_, 1);
-  wchar_t c = token.NextChar();
-  while ('\0' != c) {
-    if ('\\' == c) {
-      ++token.length;
-      c = token.NextChar();
-      // Make sure the escaped char is valid.
-      switch (c) {
-        case 'x':
-          if (!ReadHexDigits(token, 2)) {
-            SetErrorMessage(kInvalidEscape, json_pos_ + token.length);
-            return kInvalidToken;
-          }
-          break;
-        case 'u':
-          if (!ReadHexDigits(token, 4)) {
-            SetErrorMessage(kInvalidEscape, json_pos_ + token.length);
-            return kInvalidToken;
-          }
-          break;
-        case '\\':
-        case '/':
-        case 'b':
-        case 'f':
-        case 'n':
-        case 'r':
-        case 't':
-        case 'v':
-        case '"':
-          break;
-        default:
-          SetErrorMessage(kInvalidEscape, json_pos_ + token.length);
-          return kInvalidToken;
-      }
-    } else if ('"' == c) {
-      ++token.length;
-      return token;
-    }
-    ++token.length;
-    c = token.NextChar();
-  }
-  return kInvalidToken;
-}
-
-Value* JSONReader::DecodeString(const Token& token) {
-  std::wstring decoded_str;
-  decoded_str.reserve(token.length - 2);
-
-  for (int i = 1; i < token.length - 1; ++i) {
-    wchar_t c = *(token.begin + i);
-    if ('\\' == c) {
-      ++i;
-      c = *(token.begin + i);
-      switch (c) {
-        case '"':
-        case '/':
-        case '\\':
-          decoded_str.push_back(c);
-          break;
-        case 'b':
-          decoded_str.push_back('\b');
-          break;
-        case 'f':
-          decoded_str.push_back('\f');
-          break;
-        case 'n':
-          decoded_str.push_back('\n');
-          break;
-        case 'r':
-          decoded_str.push_back('\r');
-          break;
-        case 't':
-          decoded_str.push_back('\t');
-          break;
-        case 'v':
-          decoded_str.push_back('\v');
-          break;
-
-        case 'x':
-          decoded_str.push_back((HexToInt(*(token.begin + i + 1)) << 4) +
-                                HexToInt(*(token.begin + i + 2)));
-          i += 2;
-          break;
-        case 'u':
-          decoded_str.push_back((HexToInt(*(token.begin + i + 1)) << 12 ) +
-                                (HexToInt(*(token.begin + i + 2)) << 8) +
-                                (HexToInt(*(token.begin + i + 3)) << 4) +
-                                HexToInt(*(token.begin + i + 4)));
-          i += 4;
-          break;
-
-        default:
-          // We should only have valid strings at this point.  If not,
-          // ParseStringToken didn't do it's job.
-          NOTREACHED();
-          return NULL;
-      }
-    } else {
-      // Not escaped
-      decoded_str.push_back(c);
-    }
-  }
-  return Value::CreateStringValue(decoded_str);
-}
-
-JSONReader::Token JSONReader::ParseToken() {
-  static const std::wstring kNullString(L"null");
-  static const std::wstring kTrueString(L"true");
-  static const std::wstring kFalseString(L"false");
-
-  EatWhitespaceAndComments();
-
-  Token token(Token::INVALID_TOKEN, 0, 0);
-  switch (*json_pos_) {
-    case '\0':
-      token.type = Token::END_OF_INPUT;
-      break;
-
-    case 'n':
-      if (NextStringMatch(kNullString))
-        token = Token(Token::NULL_TOKEN, json_pos_, 4);
-      break;
-
-    case 't':
-      if (NextStringMatch(kTrueString))
-        token = Token(Token::BOOL_TRUE, json_pos_, 4);
-      break;
-
-    case 'f':
-      if (NextStringMatch(kFalseString))
-        token = Token(Token::BOOL_FALSE, json_pos_, 5);
-      break;
-
-    case '[':
-      token = Token(Token::ARRAY_BEGIN, json_pos_, 1);
-      break;
-
-    case ']':
-      token = Token(Token::ARRAY_END, json_pos_, 1);
-      break;
-
-    case ',':
-      token = Token(Token::LIST_SEPARATOR, json_pos_, 1);
-      break;
-
-    case '{':
-      token = Token(Token::OBJECT_BEGIN, json_pos_, 1);
-      break;
-
-    case '}':
-      token = Token(Token::OBJECT_END, json_pos_, 1);
-      break;
-
-    case ':':
-      token = Token(Token::OBJECT_PAIR_SEPARATOR, json_pos_, 1);
-      break;
-
-    case '0':
-    case '1':
-    case '2':
-    case '3':
-    case '4':
-    case '5':
-    case '6':
-    case '7':
-    case '8':
-    case '9':
-    case '-':
-      token = ParseNumberToken();
-      break;
-
-    case '"':
-      token = ParseStringToken();
-      break;
-  }
-  return token;
-}
-
-bool JSONReader::NextStringMatch(const std::wstring& str) {
-  for (size_t i = 0; i < str.length(); ++i) {
-    if ('\0' == *json_pos_)
-      return false;
-    if (*(json_pos_ + i) != str[i])
-      return false;
-  }
-  return true;
-}
-
-void JSONReader::EatWhitespaceAndComments() {
-  while ('\0' != *json_pos_) {
-    switch (*json_pos_) {
-      case ' ':
-      case '\n':
-      case '\r':
-      case '\t':
-        ++json_pos_;
-        break;
-      case '/':
-        // TODO(tc): This isn't in the RFC so it should be a parser flag.
-        if (!EatComment())
-          return;
-        break;
-      default:
-        // Not a whitespace char, just exit.
-        return;
-    }
-  }
-}
-
-bool JSONReader::EatComment() {
-  if ('/' != *json_pos_)
-    return false;
-
-  wchar_t next_char = *(json_pos_ + 1);
-  if ('/' == next_char) {
-    // Line comment, read until \n or \r
-    json_pos_ += 2;
-    while ('\0' != *json_pos_) {
-      switch (*json_pos_) {
-        case '\n':
-        case '\r':
-          ++json_pos_;
-          return true;
-        default:
-          ++json_pos_;
-      }
-    }
-  } else if ('*' == next_char) {
-    // Block comment, read until */
-    json_pos_ += 2;
-    while ('\0' != *json_pos_) {
-      switch (*json_pos_) {
-        case '*':
-          if ('/' == *(json_pos_ + 1)) {
-            json_pos_ += 2;
-            return true;
-          }
-        default:
-          ++json_pos_;
-      }
-    }
-  } else {
-    return false;
-  }
-  return true;
-}
-
-void JSONReader::SetErrorMessage(const char* description,
-                                 const wchar_t* error_pos) {
-  int line_number = 1;
-  int column_number = 1;
-
-  // Figure out the line and column the error occured at.
-  for (const wchar_t* pos = start_pos_; pos != error_pos; ++pos) {
-    if (*pos == '\0') {
-      NOTREACHED();
-      return;
-    }
-
-    if (*pos == '\n') {
-      ++line_number;
-      column_number = 1;
-    } else {
-      ++column_number;
-    }
-  }
-
-  error_message_ = FormatErrorMessage(line_number, column_number, description);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/json_reader.h
+++ /dev/null
@@ -1,186 +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.
-//
-// A JSON parser.  Converts strings of JSON into a Value object (see
-// base/values.h).
-// http://www.ietf.org/rfc/rfc4627.txt?number=4627
-//
-// Known limitations/deviations from the RFC:
-// - Only knows how to parse ints within the range of a signed 32 bit int and
-//   decimal numbers within a double.
-// - Assumes input is encoded as UTF8.  The spec says we should allow UTF-16
-//   (BE or LE) and UTF-32 (BE or LE) as well.
-// - We limit nesting to 100 levels to prevent stack overflow (this is allowed
-//   by the RFC).
-// - A Unicode FAQ ("http://unicode.org/faq/utf_bom.html") writes a data
-//   stream may start with a Unicode Byte-Order-Mark (U+FEFF), i.e. the input
-//   UTF-8 string for the JSONReader::JsonToValue() function may start with a
-//   UTF-8 BOM (0xEF, 0xBB, 0xBF).
-//   To avoid the function from mis-treating a UTF-8 BOM as an invalid
-//   character, the function skips a Unicode BOM at the beginning of the
-//   Unicode string (converted from the input UTF-8 string) before parsing it.
-//
-// TODO(tc): Add a parsing option to to relax object keys being wrapped in
-//   double quotes
-// TODO(tc): Add an option to disable comment stripping
-// TODO(aa): Consider making the constructor public and the static Read() method
-// only a convenience for the common uses with more complex configuration going
-// on the instance.
-
-#ifndef BASE_JSON_READER_H_
-#define BASE_JSON_READER_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "testing/gtest/include/gtest/gtest_prod.h"
-
-class Value;
-
-class JSONReader {
- public:
-  // A struct to hold a JS token.
-  class Token {
-   public:
-    enum Type {
-     OBJECT_BEGIN,           // {
-     OBJECT_END,             // }
-     ARRAY_BEGIN,            // [
-     ARRAY_END,              // ]
-     STRING,
-     NUMBER,
-     BOOL_TRUE,              // true
-     BOOL_FALSE,             // false
-     NULL_TOKEN,             // null
-     LIST_SEPARATOR,         // ,
-     OBJECT_PAIR_SEPARATOR,  // :
-     END_OF_INPUT,
-     INVALID_TOKEN,
-    };
-    Token(Type t, const wchar_t* b, int len)
-      : type(t), begin(b), length(len) {}
-
-    Type type;
-
-    // A pointer into JSONReader::json_pos_ that's the beginning of this token.
-    const wchar_t* begin;
-
-    // End should be one char past the end of the token.
-    int length;
-
-    // Get the character that's one past the end of this token.
-    wchar_t NextChar() {
-      return *(begin + length);
-    }
-  };
-
-  // Error messages that can be returned.
-  static const char* kBadRootElementType;
-  static const char* kInvalidEscape;
-  static const char* kSyntaxError;
-  static const char* kTrailingComma;
-  static const char* kTooMuchNesting;
-  static const char* kUnexpectedDataAfterRoot;
-  static const char* kUnsupportedEncoding;
-  static const char* kUnquotedDictionaryKey;
-
-  JSONReader();
-
-  // Reads and parses |json|, returning a Value. The caller owns the returned
-  // instance. If |json| is not a properly formed JSON string, returns NULL.
-  // If |allow_trailing_comma| is true, we will ignore trailing commas in
-  // objects and arrays even though this goes against the RFC.
-  static Value* Read(const std::string& json, bool allow_trailing_comma);
-
-  // Reads and parses |json| like Read(). |error_message_out| is optional. If
-  // specified and NULL is returned, |error_message_out| will be populated with
-  // a string describing the error. Otherwise, |error_message_out| is
-  // unmodified.
-  static Value* ReadAndReturnError(const std::string& json,
-                                   bool allow_trailing_comma,
-                                   std::string* error_message_out);
-
-  // Returns the error message if the last call to JsonToValue() failed. If the
-  // last call did not fail, returns a valid empty string.
-  std::string error_message() { return error_message_; }
-
-  // Reads and parses |json|, returning a Value. The caller owns the returned
-  // instance. If |json| is not a properly formed JSON string, returns NULL and
-  // a detailed error can be retrieved from |error_message()|.
-  // If |check_root| is true, we require that the root object be an object or
-  // array. Otherwise, it can be any valid JSON type.
-  // If |allow_trailing_comma| is true, we will ignore trailing commas in
-  // objects and arrays even though this goes against the RFC.
-  Value* JsonToValue(const std::string& json, bool check_root,
-                     bool allow_trailing_comma);
-
- private:
-  static std::string FormatErrorMessage(int line, int column,
-                                        const char* description);
-
-  DISALLOW_EVIL_CONSTRUCTORS(JSONReader);
-
-  FRIEND_TEST(JSONReaderTest, Reading);
-  FRIEND_TEST(JSONReaderTest, ErrorMessages);
-
-  // Recursively build Value.  Returns NULL if we don't have a valid JSON
-  // string.  If |is_root| is true, we verify that the root element is either
-  // an object or an array.
-  Value* BuildValue(bool is_root);
-
-  // Parses a sequence of characters into a Token::NUMBER. If the sequence of
-  // characters is not a valid number, returns a Token::INVALID_TOKEN. Note
-  // that DecodeNumber is used to actually convert from a string to an
-  // int/double.
-  Token ParseNumberToken();
-
-  // Try and convert the substring that token holds into an int or a double. If
-  // we can (ie., no overflow), return the value, else return NULL.
-  Value* DecodeNumber(const Token& token);
-
-  // Parses a sequence of characters into a Token::STRING. If the sequence of
-  // characters is not a valid string, returns a Token::INVALID_TOKEN. Note
-  // that DecodeString is used to actually decode the escaped string into an
-  // actual wstring.
-  Token ParseStringToken();
-
-  // Convert the substring into a value string.  This should always succeed
-  // (otherwise ParseStringToken would have failed).
-  Value* DecodeString(const Token& token);
-
-  // Grabs the next token in the JSON stream.  This does not increment the
-  // stream so it can be used to look ahead at the next token.
-  Token ParseToken();
-
-  // Increments |json_pos_| past leading whitespace and comments.
-  void EatWhitespaceAndComments();
-
-  // If |json_pos_| is at the start of a comment, eat it, otherwise, returns
-  // false.
-  bool EatComment();
-
-  // Checks if |json_pos_| matches str.
-  bool NextStringMatch(const std::wstring& str);
-
-  // Creates the error message that will be returned to the caller. The current
-  // line and column are determined and added into the final message.
-  void SetErrorMessage(const char* description, const wchar_t* error_pos);
-
-  // Pointer to the starting position in the input string.
-  const wchar_t* start_pos_;
-
-  // Pointer to the current position in the input string.
-  const wchar_t* json_pos_;
-
-  // Used to keep track of how many nested lists/dicts there are.
-  int stack_depth_;
-
-  // A parser flag that allows trailing commas in objects and arrays.
-  bool allow_trailing_comma_;
-
-  // Contains the error message for the last call to JsonToValue(), if any.
-  std::string error_message_;
-};
-
-#endif  // BASE_JSON_READER_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/json_reader_unittest.cc
+++ /dev/null
@@ -1,492 +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 "testing/gtest/include/gtest/gtest.h"
-#include "base/json_reader.h"
-#include "base/scoped_ptr.h"
-#include "base/values.h"
-#include "build/build_config.h"
-
-TEST(JSONReaderTest, Reading) {
-  // some whitespace checking
-  scoped_ptr<Value> root;
-  root.reset(JSONReader().JsonToValue("   null   ", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_NULL));
-
-  // Invalid JSON string
-  root.reset(JSONReader().JsonToValue("nu", false, false));
-  ASSERT_FALSE(root.get());
-
-  // Simple bool
-  root.reset(JSONReader().JsonToValue("true  ", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_BOOLEAN));
-
-  // Test number formats
-  root.reset(JSONReader().JsonToValue("43", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_INTEGER));
-  int int_val = 0;
-  ASSERT_TRUE(root->GetAsInteger(&int_val));
-  ASSERT_EQ(43, int_val);
-
-  // According to RFC4627, oct, hex, and leading zeros are invalid JSON.
-  root.reset(JSONReader().JsonToValue("043", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("0x43", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("00", false, false));
-  ASSERT_FALSE(root.get());
-
-  // Test 0 (which needs to be special cased because of the leading zero
-  // clause).
-  root.reset(JSONReader().JsonToValue("0", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_INTEGER));
-  int_val = 1;
-  ASSERT_TRUE(root->GetAsInteger(&int_val));
-  ASSERT_EQ(0, int_val);
-
-  // Numbers that overflow ints should succeed, being internally promoted to
-  // storage as doubles
-  root.reset(JSONReader().JsonToValue("2147483648", false, false));
-  ASSERT_TRUE(root.get());
-  double real_val;
-#ifdef ARCH_CPU_32_BITS
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(2147483648.0, real_val);
-#else
-  ASSERT_TRUE(root->IsType(Value::TYPE_INTEGER));
-  int_val = 0;
-  ASSERT_TRUE(root->GetAsInteger(&int_val));
-  ASSERT_EQ(2147483648, int_val);
-#endif
-  root.reset(JSONReader().JsonToValue("-2147483649", false, false));
-  ASSERT_TRUE(root.get());
-#ifdef ARCH_CPU_32_BITS
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(-2147483649.0, real_val);
-#else
-  ASSERT_TRUE(root->IsType(Value::TYPE_INTEGER));
-  int_val = 0;
-  ASSERT_TRUE(root->GetAsInteger(&int_val));
-  ASSERT_EQ(-2147483649, int_val);
-#endif
-
-  // Parse a double
-  root.reset(JSONReader().JsonToValue("43.1", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(43.1, real_val);
-
-  root.reset(JSONReader().JsonToValue("4.3e-1", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(.43, real_val);
-
-  root.reset(JSONReader().JsonToValue("2.1e0", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(2.1, real_val);
-
-  root.reset(JSONReader().JsonToValue("2.1e+0001", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(21.0, real_val);
-
-  root.reset(JSONReader().JsonToValue("0.01", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(0.01, real_val);
-
-  root.reset(JSONReader().JsonToValue("1.00", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_REAL));
-  real_val = 0.0;
-  ASSERT_TRUE(root->GetAsReal(&real_val));
-  ASSERT_DOUBLE_EQ(1.0, real_val);
-
-  // Fractional parts must have a digit before and after the decimal point.
-  root.reset(JSONReader().JsonToValue("1.", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue(".1", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("1.e10", false, false));
-  ASSERT_FALSE(root.get());
-
-  // Exponent must have a digit following the 'e'.
-  root.reset(JSONReader().JsonToValue("1e", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("1E", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("1e1.", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("1e1.0", false, false));
-  ASSERT_FALSE(root.get());
-
-  // INF/-INF/NaN are not valid
-  root.reset(JSONReader().JsonToValue("1e1000", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("-1e1000", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("NaN", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("nan", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("inf", false, false));
-  ASSERT_FALSE(root.get());
-
-  // Invalid number formats
-  root.reset(JSONReader().JsonToValue("4.3.1", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("4e3.1", false, false));
-  ASSERT_FALSE(root.get());
-
-  // Test string parser
-  root.reset(JSONReader().JsonToValue("\"hello world\"", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_STRING));
-  std::wstring str_val;
-  ASSERT_TRUE(root->GetAsString(&str_val));
-  ASSERT_EQ(L"hello world", str_val);
-
-  // Empty string
-  root.reset(JSONReader().JsonToValue("\"\"", false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_STRING));
-  str_val.clear();
-  ASSERT_TRUE(root->GetAsString(&str_val));
-  ASSERT_EQ(L"", str_val);
-
-  // Test basic string escapes
-  root.reset(JSONReader().JsonToValue("\" \\\"\\\\\\/\\b\\f\\n\\r\\t\\v\"",
-                                      false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_STRING));
-  str_val.clear();
-  ASSERT_TRUE(root->GetAsString(&str_val));
-  ASSERT_EQ(L" \"\\/\b\f\n\r\t\v", str_val);
-
-  // Test hex and unicode escapes including the null character.
-  root.reset(JSONReader().JsonToValue("\"\\x41\\x00\\u1234\"", false,
-                                      false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_STRING));
-  str_val.clear();
-  ASSERT_TRUE(root->GetAsString(&str_val));
-  ASSERT_EQ(std::wstring(L"A\0\x1234", 3), str_val);
-
-  // Test invalid strings
-  root.reset(JSONReader().JsonToValue("\"no closing quote", false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("\"\\z invalid escape char\"", false,
-                                      false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("\"\\xAQ invalid hex code\"", false,
-                                      false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("not enough hex chars\\x1\"", false,
-                                      false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("\"not enough escape chars\\u123\"",
-                                      false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("\"extra backslash at end of input\\\"",
-                                      false, false));
-  ASSERT_FALSE(root.get());
-
-  // Basic array
-  root.reset(JSONReader::Read("[true, false, null]", false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_LIST));
-  ListValue* list = static_cast<ListValue*>(root.get());
-  ASSERT_EQ(3U, list->GetSize());
-
-  // Test with trailing comma.  Should be parsed the same as above.
-  scoped_ptr<Value> root2;
-  root2.reset(JSONReader::Read("[true, false, null, ]", true));
-  EXPECT_TRUE(root->Equals(root2.get()));
-
-  // Empty array
-  root.reset(JSONReader::Read("[]", false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_LIST));
-  list = static_cast<ListValue*>(root.get());
-  ASSERT_EQ(0U, list->GetSize());
-
-  // Nested arrays
-  root.reset(JSONReader::Read("[[true], [], [false, [], [null]], null]",
-                              false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_LIST));
-  list = static_cast<ListValue*>(root.get());
-  ASSERT_EQ(4U, list->GetSize());
-
-  // Lots of trailing commas.
-  root2.reset(JSONReader::Read("[[true], [], [false, [], [null, ]  , ], null,]",
-                               true));
-  EXPECT_TRUE(root->Equals(root2.get()));
-
-  // Invalid, missing close brace.
-  root.reset(JSONReader::Read("[[true], [], [false, [], [null]], null", false));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, too many commas
-  root.reset(JSONReader::Read("[true,, null]", false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("[true,, null]", true));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, no commas
-  root.reset(JSONReader::Read("[true null]", false));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, trailing comma
-  root.reset(JSONReader::Read("[true,]", false));
-  ASSERT_FALSE(root.get());
-
-  // Valid if we set |allow_trailing_comma| to true.
-  root.reset(JSONReader::Read("[true,]", true));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_LIST));
-  list = static_cast<ListValue*>(root.get());
-  EXPECT_EQ(1U, list->GetSize());
-  Value* tmp_value = NULL;
-  ASSERT_TRUE(list->Get(0, &tmp_value));
-  EXPECT_TRUE(tmp_value->IsType(Value::TYPE_BOOLEAN));
-  bool bool_value = false;
-  ASSERT_TRUE(tmp_value->GetAsBoolean(&bool_value));
-  EXPECT_TRUE(bool_value);
-
-  // Don't allow empty elements, even if |allow_trailing_comma| is
-  // true.
-  root.reset(JSONReader::Read("[,]", true));
-  EXPECT_FALSE(root.get());
-  root.reset(JSONReader::Read("[true,,]", true));
-  EXPECT_FALSE(root.get());
-  root.reset(JSONReader::Read("[,true,]", true));
-  EXPECT_FALSE(root.get());
-  root.reset(JSONReader::Read("[true,,false]", true));
-  EXPECT_FALSE(root.get());
-
-  // Test objects
-  root.reset(JSONReader::Read("{}", false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
-
-  root.reset(JSONReader::Read(
-    "{\"number\":9.87654321, \"null\":null , \"\\x53\" : \"str\" }",
-    false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
-  DictionaryValue* dict_val = static_cast<DictionaryValue*>(root.get());
-  real_val = 0.0;
-  ASSERT_TRUE(dict_val->GetReal(L"number", &real_val));
-  ASSERT_DOUBLE_EQ(9.87654321, real_val);
-  Value* null_val = NULL;
-  ASSERT_TRUE(dict_val->Get(L"null", &null_val));
-  ASSERT_TRUE(null_val->IsType(Value::TYPE_NULL));
-  str_val.clear();
-  ASSERT_TRUE(dict_val->GetString(L"S", &str_val));
-  ASSERT_EQ(L"str", str_val);
-
-  root2.reset(JSONReader::Read(
-    "{\"number\":9.87654321, \"null\":null , \"\\x53\" : \"str\", }", true));
-  EXPECT_TRUE(root->Equals(root2.get()));
-
-  // Test nesting
-  root.reset(JSONReader::Read(
-    "{\"inner\":{\"array\":[true]},\"false\":false,\"d\":{}}", false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
-  dict_val = static_cast<DictionaryValue*>(root.get());
-  DictionaryValue* inner_dict = NULL;
-  ASSERT_TRUE(dict_val->GetDictionary(L"inner", &inner_dict));
-  ListValue* inner_array = NULL;
-  ASSERT_TRUE(inner_dict->GetList(L"array", &inner_array));
-  ASSERT_EQ(1U, inner_array->GetSize());
-  bool_value = true;
-  ASSERT_TRUE(dict_val->GetBoolean(L"false", &bool_value));
-  ASSERT_FALSE(bool_value);
-  inner_dict = NULL;
-  ASSERT_TRUE(dict_val->GetDictionary(L"d", &inner_dict));
-
-  root2.reset(JSONReader::Read(
-    "{\"inner\": {\"array\":[true] , },\"false\":false,\"d\":{},}", true));
-  EXPECT_TRUE(root->Equals(root2.get()));
-
-  // Invalid, no closing brace
-  root.reset(JSONReader::Read("{\"a\": true", false));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, keys must be quoted
-  root.reset(JSONReader::Read("{foo:true}", false));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, trailing comma
-  root.reset(JSONReader::Read("{\"a\":true,}", false));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, too many commas
-  root.reset(JSONReader::Read("{\"a\":true,,\"b\":false}", false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("{\"a\":true,,\"b\":false}", true));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, no separator
-  root.reset(JSONReader::Read("{\"a\" \"b\"}", false));
-  ASSERT_FALSE(root.get());
-
-  // Invalid, lone comma.
-  root.reset(JSONReader::Read("{,}", false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("{,}", true));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("{\"a\":true,,}", true));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("{,\"a\":true}", true));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("{\"a\":true,,\"b\":false}", true));
-  ASSERT_FALSE(root.get());
-
-  // Test stack overflow
-  std::string evil(1000000, '[');
-  evil.append(std::string(1000000, ']'));
-  root.reset(JSONReader::Read(evil, false));
-  ASSERT_FALSE(root.get());
-
-  // A few thousand adjacent lists is fine.
-  std::string not_evil("[");
-  not_evil.reserve(15010);
-  for (int i = 0; i < 5000; ++i) {
-    not_evil.append("[],");
-  }
-  not_evil.append("[]]");
-  root.reset(JSONReader::Read(not_evil, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_LIST));
-  list = static_cast<ListValue*>(root.get());
-  ASSERT_EQ(5001U, list->GetSize());
-
-  // Test utf8 encoded input
-  root.reset(JSONReader().JsonToValue("\"\xe7\xbd\x91\xe9\xa1\xb5\"",
-                                      false, false));
-  ASSERT_TRUE(root.get());
-  ASSERT_TRUE(root->IsType(Value::TYPE_STRING));
-  str_val.clear();
-  ASSERT_TRUE(root->GetAsString(&str_val));
-  ASSERT_EQ(L"\x7f51\x9875", str_val);
-
-  // Test invalid utf8 encoded input
-  root.reset(JSONReader().JsonToValue("\"345\xb0\xa1\xb0\xa2\"",
-                                      false, false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader().JsonToValue("\"123\xc0\x81\"",
-                                      false, false));
-  ASSERT_FALSE(root.get());
-
-  // Test invalid root objects.
-  root.reset(JSONReader::Read("null", false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("true", false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("10", false));
-  ASSERT_FALSE(root.get());
-  root.reset(JSONReader::Read("\"root\"", false));
-  ASSERT_FALSE(root.get());
-}
-
-TEST(JSONReaderTest, ErrorMessages) {
-  // Error strings should not be modified in case of success.
-  std::string error_message;
-  scoped_ptr<Value> root;
-  root.reset(JSONReader::ReadAndReturnError("[42]", false, &error_message));
-  EXPECT_TRUE(error_message.empty());
-
-  // Test line and column counting
-  const char* big_json = "[\n0,\n1,\n2,\n3,4,5,6 7,\n8,\n9\n]";
-  // error here --------------------------------^
-  root.reset(JSONReader::ReadAndReturnError(big_json, false, &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(5, 9, JSONReader::kSyntaxError),
-            error_message);
-
-  // Test each of the error conditions
-  root.reset(JSONReader::ReadAndReturnError("{},{}", false, &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 3,
-      JSONReader::kUnexpectedDataAfterRoot), error_message);
-
-  std::string nested_json;
-  for (int i = 0; i < 101; ++i) {
-    nested_json.insert(nested_json.begin(), '[');
-    nested_json.append(1, ']');
-  }
-  root.reset(JSONReader::ReadAndReturnError(nested_json, false,
-                                            &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 101, JSONReader::kTooMuchNesting),
-            error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("42", false, &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 1,
-      JSONReader::kBadRootElementType), error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("[1,]", false, &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 4, JSONReader::kTrailingComma),
-            error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("{foo:\"bar\"}", false,
-                                            &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 2,
-      JSONReader::kUnquotedDictionaryKey), error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("{\"foo\":\"bar\",}", false,
-                                            &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 14, JSONReader::kTrailingComma),
-            error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("[nu]", false, &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 2, JSONReader::kSyntaxError),
-            error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("[\"xxx\\xq\"]", false,
-                                            &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape),
-            error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("[\"xxx\\uq\"]", false,
-                                            &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape),
-            error_message);
-
-  root.reset(JSONReader::ReadAndReturnError("[\"xxx\\q\"]", false,
-                                            &error_message));
-  EXPECT_FALSE(root.get());
-  EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape),
-            error_message);
-
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/json_writer.cc
+++ /dev/null
@@ -1,175 +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/json_writer.h"
-
-#include "base/logging.h"
-#include "base/string_util.h"
-#include "base/values.h"
-#include "base/string_escape.h"
-
-const char kPrettyPrintLineEnding[] = "\r\n";
-
-/* static */
-void JSONWriter::Write(const Value* const node, bool pretty_print,
-                       std::string* json) {
-  json->clear();
-  // Is there a better way to estimate the size of the output?
-  json->reserve(1024);
-  JSONWriter writer(pretty_print, json);
-  writer.BuildJSONString(node, 0);
-  if (pretty_print)
-    json->append(kPrettyPrintLineEnding);
-}
-
-JSONWriter::JSONWriter(bool pretty_print, std::string* json)
-    : json_string_(json),
-      pretty_print_(pretty_print) {
-  DCHECK(json);
-}
-
-void JSONWriter::BuildJSONString(const Value* const node, int depth) {
-  switch(node->GetType()) {
-    case Value::TYPE_NULL:
-      json_string_->append("null");
-      break;
-
-    case Value::TYPE_BOOLEAN:
-      {
-        bool value;
-        bool result = node->GetAsBoolean(&value);
-        DCHECK(result);
-        json_string_->append(value ? "true" : "false");
-        break;
-      }
-
-    case Value::TYPE_INTEGER:
-      {
-        int value;
-        bool result = node->GetAsInteger(&value);
-        DCHECK(result);
-        StringAppendF(json_string_, "%d", value);
-        break;
-      }
-
-    case Value::TYPE_REAL:
-      {
-        double value;
-        bool result = node->GetAsReal(&value);
-        DCHECK(result);
-        std::string real = DoubleToString(value);
-        // Ensure that the number has a .0 if there's no decimal or 'e'.  This
-        // makes sure that when we read the JSON back, it's interpreted as a
-        // real rather than an int.
-        if (real.find('.') == std::string::npos &&
-            real.find('e') == std::string::npos &&
-            real.find('E') == std::string::npos) {
-          real.append(".0");
-        }
-        // The JSON spec requires that non-integer values in the range (-1,1)
-        // have a zero before the decimal point - ".52" is not valid, "0.52" is.
-        if (real[0] == '.') {
-          real.insert(0, "0");
-        } else if (real.length() > 1 && real[0] == '-' && real[1] == '.') {
-          // "-.1" bad "-0.1" good
-          real.insert(1, "0");
-        }
-        json_string_->append(real);
-        break;
-      }
-
-    case Value::TYPE_STRING:
-      {
-        std::wstring value;
-        bool result = node->GetAsString(&value);
-        DCHECK(result);
-        AppendQuotedString(value);
-        break;
-      }
-
-    case Value::TYPE_LIST:
-      {
-        json_string_->append("[");
-        if (pretty_print_)
-          json_string_->append(" ");
-
-        const ListValue* list = static_cast<const ListValue*>(node);
-        for (size_t i = 0; i < list->GetSize(); ++i) {
-          if (i != 0) {
-            json_string_->append(",");
-            if (pretty_print_)
-              json_string_->append(" ");
-          }
-
-          Value* value = NULL;
-          bool result = list->Get(i, &value);
-          DCHECK(result);
-          BuildJSONString(value, depth);
-        }
-
-        if (pretty_print_)
-          json_string_->append(" ");
-        json_string_->append("]");
-        break;
-      }
-
-    case Value::TYPE_DICTIONARY:
-      {
-        json_string_->append("{");
-        if (pretty_print_)
-          json_string_->append(kPrettyPrintLineEnding);
-
-        const DictionaryValue* dict =
-          static_cast<const DictionaryValue*>(node);
-        for (DictionaryValue::key_iterator key_itr = dict->begin_keys();
-             key_itr != dict->end_keys();
-             ++key_itr) {
-
-          if (key_itr != dict->begin_keys()) {
-            json_string_->append(",");
-            if (pretty_print_)
-              json_string_->append(kPrettyPrintLineEnding);
-          }
-
-          Value* value = NULL;
-          bool result = dict->Get(*key_itr, &value);
-          DCHECK(result);
-
-          if (pretty_print_)
-            IndentLine(depth + 1);
-          AppendQuotedString(*key_itr);
-          if (pretty_print_) {
-            json_string_->append(": ");
-          } else {
-            json_string_->append(":");
-          }
-          BuildJSONString(value, depth + 1);
-        }
-
-        if (pretty_print_) {
-          json_string_->append(kPrettyPrintLineEnding);
-          IndentLine(depth);
-          json_string_->append("}");
-        } else {
-          json_string_->append("}");
-        }
-        break;
-      }
-
-    default:
-      // TODO(jhughes): handle TYPE_BINARY
-      NOTREACHED() << "unknown json type";
-  }
-}
-
-void JSONWriter::AppendQuotedString(const std::wstring& str) {
-  string_escape::JavascriptDoubleQuote(WideToUTF16Hack(str), true,
-                                       json_string_);
-}
-
-void JSONWriter::IndentLine(int depth) {
-  // It may be faster to keep an indent string so we don't have to keep
-  // reallocating.
-  json_string_->append(std::string(depth * 3, ' '));
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/json_writer.h
+++ /dev/null
@@ -1,47 +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_JSON_WRITER_H_
-#define BASE_JSON_WRITER_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-
-class Value;
-
-class JSONWriter {
- public:
-  // Given a root node, generates a JSON string and puts it into |json|.
-  // If |pretty_print| is true, return a slightly nicer formated json string
-  // (pads with whitespace to help readability).  If |pretty_print| is false,
-  // we try to generate as compact a string as possible.
-  // TODO(tc): Should we generate json if it would be invalid json (e.g.,
-  // |node| is not a DictionaryValue/ListValue or if there are inf/-inf float
-  // values)?
-  static void Write(const Value* const node, bool pretty_print,
-                    std::string* json);
-
- private:
-  JSONWriter(bool pretty_print, std::string* json);
-
-  // Called recursively to build the JSON string.  Whe completed, value is
-  // json_string_ will contain the JSON.
-  void BuildJSONString(const Value* const node, int depth);
-
-  // Appends a quoted, escaped, version of str to json_string_.
-  void AppendQuotedString(const std::wstring& str);
-
-  // Adds space to json_string_ for the indent level.
-  void IndentLine(int depth);
-
-  // Where we write JSON data as we generate it.
-  std::string* json_string_;
-
-  bool pretty_print_;
-
-  DISALLOW_COPY_AND_ASSIGN(JSONWriter);
-};
-
-#endif  // BASE_JSON_WRITER_H_
deleted file mode 100644
--- a/ipc/chromium/src/base/json_writer_unittest.cc
+++ /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.
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "base/json_writer.h"
-#include "base/values.h"
-
-TEST(JSONWriterTest, Writing) {
-  // Test null
-  Value* root = Value::CreateNullValue();
-  std::string output_js;
-  JSONWriter::Write(root, false, &output_js);
-  ASSERT_EQ("null", output_js);
-  delete root;
-
-  // Test empty dict
-  root = new DictionaryValue;
-  JSONWriter::Write(root, false, &output_js);
-  ASSERT_EQ("{}", output_js);
-  delete root;
-
-  // Test empty list
-  root = new ListValue;
-  JSONWriter::Write(root, false, &output_js);
-  ASSERT_EQ("[]", output_js);
-  delete root;
-
-  // Test Real values should always have a decimal or an 'e'.
-  root = Value::CreateRealValue(1.0);
-  JSONWriter::Write(root, false, &output_js);
-  ASSERT_EQ("1.0", output_js);
-  delete root;
-
-  // Test Real values in the the range (-1, 1) must have leading zeros
-  root = Value::CreateRealValue(0.2);
-  JSONWriter::Write(root, false, &output_js);
-  ASSERT_EQ("0.2", output_js);
-  delete root;
-
-  // Test Real values in the the range (-1, 1) must have leading zeros
-  root = Value::CreateRealValue(-0.8);
-  JSONWriter::Write(root, false, &output_js);
-  ASSERT_EQ("-0.8", output_js);
-  delete root;
-  
-  // Writer unittests like empty list/dict nesting,
-  // list list nesting, etc.
-  DictionaryValue root_dict;
-  ListValue* list = new ListValue;
-  root_dict.Set(L"list", list);
-  DictionaryValue* inner_dict = new DictionaryValue;
-  list->Append(inner_dict);
-  inner_dict->SetInteger(L"inner int", 10);
-  ListValue* inner_list = new ListValue;
-  list->Append(inner_list);
-  list->Append(Value::CreateBooleanValue(true));
-
-  JSONWriter::Write(&root_dict, false, &output_js);
-  ASSERT_EQ("{\"list\":[{\"inner int\":10},[],true]}", output_js);
-  JSONWriter::Write(&root_dict, true, &output_js);
-  ASSERT_EQ("{\r\n"
-            "   \"list\": [ {\r\n"
-            "      \"inner int\": 10\r\n"
-            "   }, [  ], true ]\r\n"
-            "}\r\n",
-            output_js);
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/accessibility_types.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2006-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 CHROME_COMMON_ACCESSIBILITY_TYPES_H_
-#define CHROME_COMMON_ACCESSIBILITY_TYPES_H_
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// AccessibilityTypes
-//
-// Provides enumerations used to preserve platform-independence in accessibility
-// functions used in various Views, both in Browser\Views and Views.
-//
-////////////////////////////////////////////////////////////////////////////////
-class AccessibilityTypes {
- public:
-  // This defines an enumeration of the supported accessibility roles in our
-  // Views (e.g. used in View::GetAccessibleRole). Any interface using roles
-  // must provide a conversion to its own roles (see e.g.
-  // ViewAccessibility::get_accRole and ViewAccessibility::MSAARole).
-  enum Role {
-    ROLE_APPLICATION,
-    ROLE_BUTTONDROPDOWN,
-    ROLE_CLIENT,
-    ROLE_GROUPING,
-    ROLE_PAGETAB,
-    ROLE_PUSHBUTTON,
-    ROLE_TEXT,
-    ROLE_TOOLBAR
-  };
-
-  // This defines an enumeration of the supported accessibility roles in our
-  // Views (e.g. used in View::GetAccessibleState). Any interface using roles
-  // must provide a conversion to its own roles (see e.g.
-  // ViewAccessibility::get_accState and ViewAccessibility::MSAAState).
-  enum State {
-    STATE_HASPOPUP,
-    STATE_READONLY
-  };
-
- private:
-  // Do not instantiate this class.
-  AccessibilityTypes() {}
-  ~AccessibilityTypes() {}
-};
-
-#endif  // CHROME_COMMON_ACCESSIBILITY_TYPES_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/app_cache/app_cache_context_impl.cc
+++ /dev/null
@@ -1,84 +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 "chrome/common/app_cache/app_cache_context_impl.h"
-
-#include "base/logging.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/child_thread.h"
-#include "googleurl/src/gurl.h"
-
-IDMap<AppCacheContextImpl> AppCacheContextImpl::all_contexts;
-
-// static
-AppCacheContextImpl* AppCacheContextImpl::FromContextId(int id) {
-  return all_contexts.Lookup(id);
-}
-
-AppCacheContextImpl::AppCacheContextImpl(IPC::Message::Sender *sender)
-  : context_id_(kNoAppCacheContextId),
-    app_cache_id_(kUnknownAppCacheId),
-    pending_select_request_id_(0),
-    sender_(sender) {
-  DCHECK(sender_);
-}
-
-AppCacheContextImpl::~AppCacheContextImpl() {
-  UnInitializeContext();
-}
-
-void AppCacheContextImpl::Initialize(ContextType context_type,
-                                     WebAppCacheContext *parent) {
-  DCHECK(context_id_ == kNoAppCacheContextId);
-  DCHECK(((context_type == MAIN_FRAME) && !parent) ||
-         ((context_type != MAIN_FRAME) && parent));
-
-  context_id_ = all_contexts.Add(this);
-  CHECK(context_id_ != kNoAppCacheContextId);
-
-  sender_->Send(new AppCacheMsg_ContextCreated(context_type,
-                                               context_id_,
-                                               parent ? parent->GetContextID()
-                                                      : kNoAppCacheContextId));
-}
-
-void AppCacheContextImpl::UnInitializeContext() {
-  if (context_id_ != kNoAppCacheContextId) {
-    sender_->Send(new AppCacheMsg_ContextDestroyed(context_id_));
-    all_contexts.Remove(context_id_);
-    context_id_ = kNoAppCacheContextId;
-  }
-}
-
-void AppCacheContextImpl::SelectAppCacheWithoutManifest(
-                              const GURL &document_url,
-                              int64_t cache_document_was_loaded_from) {
-  DCHECK(context_id_ != kNoAppCacheContextId);
-  app_cache_id_ = kUnknownAppCacheId;  // unknown until we get a response
-  sender_->Send(new AppCacheMsg_SelectAppCache(
-                         context_id_, ++pending_select_request_id_,
-                         document_url, cache_document_was_loaded_from,
-                         GURL::EmptyGURL()));
-}
-
-void AppCacheContextImpl::SelectAppCacheWithManifest(
-                              const GURL &document_url,
-                              int64_t cache_document_was_loaded_from,
-                              const GURL &manifest_url) {
-  DCHECK(context_id_ != kNoAppCacheContextId);
-  app_cache_id_ = kUnknownAppCacheId;  // unknown until we get a response
-  sender_->Send(new AppCacheMsg_SelectAppCache(
-                         context_id_, ++pending_select_request_id_,
-                         document_url, cache_document_was_loaded_from,
-                         manifest_url));
-}
-
-void AppCacheContextImpl::OnAppCacheSelected(int select_request_id,
-                                             int64_t app_cache_id) {
-  if (select_request_id == pending_select_request_id_) {
-    DCHECK(app_cache_id_ == kUnknownAppCacheId);
-    DCHECK(app_cache_id != kUnknownAppCacheId);
-    app_cache_id_ = app_cache_id;
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/app_cache/app_cache_context_impl.h
+++ /dev/null
@@ -1,48 +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 CHROME_COMMON_APP_CACHE_APP_CACHE_CONTEXT_IMPL_H_
-#define CHROME_COMMON_APP_CACHE_APP_CACHE_CONTEXT_IMPL_H_
-
-#include "base/id_map.h"
-#include "chrome/common/ipc_message.h"
-#include "webkit/glue/webappcachecontext.h"
-
-// A concrete implemenation of WebAppCacheContext for use in a child process.
-class AppCacheContextImpl : public WebAppCacheContext {
- public:
-  // Returns the context having given id or NULL if there is no such context.
-  static AppCacheContextImpl* FromContextId(int id);
-
-  AppCacheContextImpl(IPC::Message::Sender* sender);
-  virtual ~AppCacheContextImpl();
-
-  // WebAppCacheContext implementation
-  virtual int GetContextID() { return context_id_; }
-  virtual int64_t GetAppCacheID() { return app_cache_id_; }
-  virtual void Initialize(WebAppCacheContext::ContextType context_type,
-                          WebAppCacheContext* opt_parent);
-  virtual void SelectAppCacheWithoutManifest(
-                                     const GURL& document_url,
-                                     int64_t cache_document_was_loaded_from);
-  virtual void SelectAppCacheWithManifest(
-                                     const GURL& document_url,
-                                     int64_t cache_document_was_loaded_from,
-                                     const GURL& manifest_url);
-
-  // Called by AppCacheDispatcher when the browser has selected an appcache.
-  void OnAppCacheSelected(int select_request_id, int64_t app_cache_id);
-
- private:
-  void UnInitializeContext();
-
-  int context_id_;
-  int64_t app_cache_id_;
-  int pending_select_request_id_;
-  IPC::Message::Sender* sender_;
-
-  static IDMap<AppCacheContextImpl> all_contexts;
-};
-
-#endif  // CHROME_COMMON_APP_CACHE_APP_CACHE_CONTEXT_IMPL_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher.cc
+++ /dev/null
@@ -1,26 +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 "chrome/common/app_cache/app_cache_dispatcher.h"
-
-#include "chrome/common/app_cache/app_cache_context_impl.h"
-#include "chrome/common/render_messages.h"
-
-bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) {
-  bool handled = true;
-  IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcher, msg)
-    IPC_MESSAGE_HANDLER(AppCacheMsg_AppCacheSelected, OnAppCacheSelected)
-    IPC_MESSAGE_UNHANDLED(handled = false)
-  IPC_END_MESSAGE_MAP()
-  return handled;
-}
-
-void AppCacheDispatcher::OnAppCacheSelected(int context_id,
-                                            int select_request_id,
-                                            int64_t app_cache_id) {
-  AppCacheContextImpl *context = AppCacheContextImpl::FromContextId(context_id);
-  if (context) {
-    context->OnAppCacheSelected(select_request_id, app_cache_id);
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher.h
+++ /dev/null
@@ -1,26 +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 CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_H_
-#define CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_H_
-
-#include "base/basictypes.h"
-#include "chrome/common/ipc_message.h"
-
-// Dispatches app cache related messages sent to a child process from the
-// main browser process. There is one instance per child process. Messages
-// are dispatched on the main child thread. The ChildThread base class
-// creates an instance and delegates calls to it.
-class AppCacheDispatcher {
- public:
-  bool OnMessageReceived(const IPC::Message& msg);
-
- private:
-  // AppCacheContextImpl related messages
-  void OnAppCacheSelected(int context_id,
-                          int select_request_id,
-                          int64_t app_cache_id);
-};
-
-#endif  // CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher_host.cc
+++ /dev/null
@@ -1,60 +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 "chrome/common/app_cache/app_cache_dispatcher_host.h"
-
-#include "chrome/common/render_messages.h"
-
-AppCacheDispatcherHost::~AppCacheDispatcherHost() {
-  if (sender_) {
-    // TODO(michaeln): plumb to request_context_->app_cache_service
-    // to remove contexts for the child process that is going away.
-  }
-}
-
-void AppCacheDispatcherHost::Initialize(IPC::Message::Sender* sender) {
-  DCHECK(sender);
-  sender_ = sender;
-  // TODO(michaeln): plumb to request_context_->app_cache_service to
-  // tell it about this child process coming into existance
-}
-
-bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& msg,
-                                               bool *msg_ok) {
-  DCHECK(sender_);
-  *msg_ok = true;
-  bool handled = true;
-  IPC_BEGIN_MESSAGE_MAP_EX(AppCacheDispatcherHost, msg, *msg_ok)
-    IPC_MESSAGE_HANDLER(AppCacheMsg_ContextCreated, OnContextCreated);
-    IPC_MESSAGE_HANDLER(AppCacheMsg_ContextDestroyed, OnContextDestroyed);
-    IPC_MESSAGE_HANDLER(AppCacheMsg_SelectAppCache, OnSelectAppCache);
-    IPC_MESSAGE_UNHANDLED(handled = false)
-  IPC_END_MESSAGE_MAP_EX()
-  return handled;
-}
-
-void AppCacheDispatcherHost::OnContextCreated(
-                                 WebAppCacheContext::ContextType context_type,
-                                 int context_id,
-                                 int opt_parent_id) {
-  // TODO(michaeln): implement me, plumb to request_context->app_cache_service
-  DCHECK(context_id != WebAppCacheContext::kNoAppCacheContextId);
-}
-
-void AppCacheDispatcherHost::OnContextDestroyed(int context_id) {
-  // TODO(michaeln): implement me, plumb to request_context->app_cache_service
-  DCHECK(context_id != WebAppCacheContext::kNoAppCacheContextId);
-}
-
-void AppCacheDispatcherHost::OnSelectAppCache(
-                                int context_id,
-                                int select_request_id,
-                                const GURL& document_url,
-                                int64_t cache_document_was_loaded_from,
-                                const GURL& opt_manifest_url) {
-  // TODO(michaeln): implement me, plumb to request_context->app_cache_service
-  DCHECK(context_id != WebAppCacheContext::kNoAppCacheContextId);
-  Send(new AppCacheMsg_AppCacheSelected(context_id, select_request_id,
-                                        WebAppCacheContext::kNoAppCacheId));
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/app_cache/app_cache_dispatcher_host.h
+++ /dev/null
@@ -1,43 +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 CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_HOST_H_
-#define CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_HOST_H_
-
-#include "base/id_map.h"
-#include "chrome/common/ipc_message.h"
-#include "webkit/glue/webappcachecontext.h"
-
-class GURL;
-
-// Handles app cache related messages sent to the main browser process from
-// its child processes. There is a distinct host for each child process.
-// Messages are handled on the IO thread. The ResourceMessageFilter creates
-// an instance and delegates calls to it.
-class AppCacheDispatcherHost {
- public:
-  AppCacheDispatcherHost() : sender_(NULL) {}
-  ~AppCacheDispatcherHost();
-  void Initialize(IPC::Message::Sender* sender);
-  bool OnMessageReceived(const IPC::Message& msg, bool* msg_is_ok);
-
- private:
-  // AppCacheContextImpl related messages
-  void OnContextCreated(WebAppCacheContext::ContextType context_type,
-                        int context_id, int opt_parent_id);
-  void OnContextDestroyed(int context_id);
-  void OnSelectAppCache(int context_id,
-                        int select_request_id,
-                        const GURL& document_url,
-                        int64_t cache_document_was_loaded_from,
-                        const GURL& opt_manifest_url);
-
-  bool Send(IPC::Message* msg) {
-    return sender_->Send(msg);
-  }
-
-  IPC::Message::Sender* sender_;
-};
-
-#endif  // CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_HOST_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/chrome_plugin_api.h
+++ /dev/null
@@ -1,525 +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 header specifies the Chrome Plugin API.  It is based heavily on NPAPI.
-// The key difference is that Chrome plugins can be loaded for the lifetime
-// of the browser, and are not tied to a specific web page.
-//
-// NOTE: This API is not final and may change or go away at any point.
-//
-// All strings in the API are UTF8-encoded unless otherwise noted.
-
-#ifndef CHROME_COMMON_CHROME_PLUGIN_API_H__
-#define CHROME_COMMON_CHROME_PLUGIN_API_H__
-
-#include "base/basictypes.h"
-
-#ifndef STDCALL
-#ifdef WIN32
-#define STDCALL __stdcall
-#else
-#define STDCALL
-#endif // WIN32
-#endif // STDCALL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// The current version of the API, used by the 'version' field of CPPluginFuncs
-// and CPBrowserFuncs.
-#define CP_MAJOR_VERSION 0
-#define CP_MINOR_VERSION 9
-#define CP_VERSION       ((CP_MAJOR_VERSION << 8) | (CP_MINOR_VERSION))
-
-#define CP_GET_MAJOR_VERSION(version) ((version & 0xff00) >> 8)
-#define CP_GET_MINOR_VERSION(version) (version & 0x00ff)
-
-typedef unsigned char CPBool;
-
-// Chrome plugins can be loaded into different process types.
-typedef enum {
-  CP_PROCESS_BROWSER = 0,
-  CP_PROCESS_PLUGIN,
-  CP_PROCESS_RENDERER,
-} CPProcessType;
-
-// Return codes.  Error values are negative.
-typedef enum {
-  // No error
-  CPERR_SUCCESS = 0,
-
-  // (network) An asynchronous IO operation is not complete
-  CPERR_IO_PENDING = -1,
-
-  // Generic failure
-  CPERR_FAILURE = -2,
-
-  // The API versions used by plugin and host are incompatible
-  CPERR_INVALID_VERSION = -3,
-
-  // The operation was cancelled
-  CPERR_CANCELLED = -4,
-
-  // An invalid parameter was passed
-  CPERR_INVALID_PARAMETER = -5,
-} CPError;
-
-// Types of response info metadata to query using CPP_GetResponseInfo.
-typedef enum {
-  // HTTP status code.
-  CPRESPONSEINFO_HTTP_STATUS = 0,
-
-  // Raw headers from the server, including the status line.  Headers should
-  // be delimited by "\0", and end with "\0\0" (a blank line).
-  CPRESPONSEINFO_HTTP_RAW_HEADERS = 1,
-} CPResponseInfoType;
-
-// An identifier for the plugin used by the browser.
-typedef struct _CPID_t {
-  int unused;
-} CPID_t;
-typedef struct _CPID_t* CPID;
-
-// An identifier that encapsulates the browsing context needed by various APIs.
-// This includes information about what tab a request was made from, and what
-// profile is active.  Note that this ID is global to all processes, so it can
-// be passed from one process to another.  The value 0 is reserved for an
-// undefined context.
-typedef uint32_t CPBrowsingContext;
-
-// Types of context info to query using CPB_GetBrowsingContextInfo.
-typedef enum {
-  // The data directory for the profile associated with this context as a
-  // pointer to a null-terminated string.  The plugin can save persistent data
-  // to this directory.  The returned pointer should be freed using CPB_Free.
-  CPBROWSINGCONTEXT_DATA_DIR_PTR = 0,
-
-  // The locale language code used for the browser UI.  The returned pointer
-  // should be freed using CPB_Free.
-  CPBROWSINGCONTEXT_UI_LOCALE_PTR = 1,
-} CPBrowsingContextInfoType;
-
-// A network request object.
-typedef struct _CPRequest {
-  void* pdata;  // plugin private data
-  const char* url;  // the URL being requested
-  const char* method;  // the request method as an uppercase string (ex: "GET")
-  CPBrowsingContext context;  // context in which this request was made
-} CPRequest;
-
-typedef enum {
-  CPREQUESTLOAD_NORMAL = 0,
-
-  // This is "normal reload", meaning an if-none-match/if-modified-since query
-  CPREQUESTLOAD_VALIDATE_CACHE = 1 << 0,
-
-  // This is "shift-reload", meaning a "pragma: no-cache" end-to-end fetch
-  CPREQUESTLOAD_BYPASS_CACHE = 1 << 1,
-
-  // This is a back/forward style navigation where the cached content should
-  // be preferred over any protocol specific cache validation.
-  CPREQUESTLOAD_PREFERRING_CACHE = 1 << 2,
-
-  // This is a navigation that will fail if it cannot serve the requested
-  // resource from the cache (or some equivalent local store).
-  CPREQUESTLOAD_ONLY_FROM_CACHE = 1 << 3,
-
-  // This is a navigation that will not use the cache at all.  It does not
-  // impact the HTTP request headers.
-  CPREQUESTLOAD_DISABLE_CACHE = 1 << 4,
-
-  // This navigation should not be intercepted by plugins.
-  CPREQUESTLOAD_DISABLE_INTERCEPT = 1 << 5,
-
-  // This request should be loaded synchronously.  What this means is that
-  // CPR_StartRequest and CPR_Read will never return CPERR_IO_PENDING - they
-  // will block until a response is available, and return success or failure.
-  CPREQUESTLOAD_SYNCHRONOUS = 1 << 20,
-} CPRequestLoadFlags;
-
-//
-// Functions provided by plugin to host.
-//
-
-// Called when the browser is unloading the plugin.
-typedef CPError (STDCALL *CPP_ShutdownFunc)(void);
-
-// Returns true if the plugin is interested in handling this request.
-typedef CPBool (STDCALL *CPP_ShouldInterceptRequestFunc)(CPRequest* request);
-
-// Called when an HTML dialog was closed.  json_retval is the JSON string
-// containing the return value sent back by the dialog (using Chrome's
-// JavaScript DOM bindings).
-typedef void (STDCALL *CPP_HtmlDialogClosedFunc)(
-    void* plugin_context, const char* json_retval);
-
-// Asks the plugin to handle the given command.  'command_data' is command-
-// specific data used for some builtin commands: see gears_api.h for
-// possible types.  It is only valid for the duration of this call.
-typedef CPError (STDCALL *CPP_HandleCommandFunc)(
-    CPBrowsingContext context, int command, void* command_data);
-
-//
-// Functions provided by host to plugin.
-//
-
-// Asks the host to handle the given command.  'command_data' is
-// command-specific data used for some builtin commands: see gears_api.h for
-// possible types.  It is only valid for the duration of this call.
-typedef CPError (STDCALL *CPB_HandleCommandFunc)(
-    CPID id, CPBrowsingContext context, int command, void* command_data);
-
-// Asks the browser to enable/disable request interception for this plugin for
-// the given schemes.  'schemes' is an array of strings containing the scheme
-// names the plugin wishes to handle; case is ignored.  If 'schemes' is NULL or
-// empty, request interception is disabled for this plugin.  Multiple calls to
-// this function will add to the existing set of enabled schemes. The browser
-// should call the plugin's CPP_ShouldInterceptRequestFunc for any network
-// requests it makes that match a given scheme.  The browser may choose not to
-// allow the plugin to intercept certain protocols.
-typedef void (STDCALL *CPB_EnableRequestInterceptFunc)(
-    CPID id, const char** schemes, uint32_t num_schemes);
-
-// Asks the browser to create a request object for the given method/url.
-// Returns CPERR_SUCCESS and puts the new object into the 'request' field on
-// success, or an error code on failure.  The plugin must call CPR_EndRequest
-// to clean up the request object when it is done with it.
-typedef CPError (STDCALL *CPB_CreateRequestFunc)(
-    CPID id, CPBrowsingContext context, const char* method, const char* url,
-    CPRequest** request);
-
-// Queries the browser's cookie store for cookies set for the given URL.
-// Sets 'cookies' to an allocated string containing the cookies as
-// semicolon-delimited "name=value" pairs on success, NULL on failure.
-// The memory should be freed using CPB_Free when done.
-typedef CPError (STDCALL *CPB_GetCookiesFunc)(
-    CPID id, CPBrowsingContext context, const char* url, char** cookies);
-
-// Allocates memory for the given size using the browser's allocator.  Call
-// CPB_Free when done.
-typedef void* (STDCALL *CPB_AllocFunc)(uint32_t size);
-
-// Frees a pointer allocated by CPB_Alloc.
-typedef void (STDCALL *CPB_FreeFunc)(void* memory);
-
-
-// Sets a flag that influences when the plugin process created to host
-// the plugin is shutdown. Generally, the plugin process is terminated
-// when no more plugin instances exist, this is the default behavior.
-// If keep_alive is non-zero, the process will not be terminated when
-// the instance count goes to zero. Note: a non-zero keep_alive value
-// does not prevent the plugin process from being terminated upon
-// overall browser shutdown.
-typedef void (STDCALL *CPB_SetKeepProcessAliveFunc)(CPID id,
-                                                    CPBool keep_alive);
-
-// Asks the browser to show an HTML dialog to the user.  The dialog contents
-// should be loaded from the given URL.  The 'json_arguments' is a JSON string
-// that the dialog can fetch using Chrome's JavaScript DOM bindings.  This call
-// will block until the dialog is closed.  On success, 'json_retval' will
-// contain the JSON string sent back by the dialog (using Chrome's JavaScript
-// DOM bindings), and CPERR_SUCCESS is returned.  'json_retval' should be freed
-// using CPB_Free when done.
-typedef CPError (STDCALL *CPB_ShowHtmlDialogModalFunc)(
-    CPID id, CPBrowsingContext context, const char* url, int width, int height,
-    const char* json_arguments, char** json_retval);
-
-// Similar to CPB_ShowHtmlDialogModalFunc, but does not block.  When the dialog
-// is closed, CPP_HtmlDialogClosed is called with the JSON return value and the
-// given 'plugin_context', which may be used by the plugin to associate other
-// data with the dialog.
-typedef CPError (STDCALL *CPB_ShowHtmlDialogFunc)(
-    CPID id, CPBrowsingContext context, const char* url, int width, int height,
-    const char* json_arguments, void* plugin_context);
-
-// Get the browsing context associated with the given NPAPI instance.
-typedef CPBrowsingContext (STDCALL *CPB_GetBrowsingContextFromNPPFunc)(
-    struct _NPP* npp);
-
-// Queries for some meta data associated with the given browsing context.  See
-// CPBrowsingContextInfoType for possible queries.  If buf_size is too small to
-// contain the entire data, the return value will indicate the size required.
-// Otherwise, the return value is a CPError or CPERR_SUCCESS.
-typedef int (STDCALL *CPB_GetBrowsingContextInfoFunc)(
-    CPID id, CPBrowsingContext context, CPBrowsingContextInfoType type,
-    void* buf, uint32_t buf_size);
-
-// Given an URL string, returns the string of command-line arguments that should
-// be passed to start the browser at the given URL.  'arguments' should be freed
-// using CPB_Free when done.
-typedef CPError (STDCALL *CPB_GetCommandLineArgumentsFunc)(
-    CPID id, CPBrowsingContext context, const char* url, char** arguments);
-
-// Asks the browser to let the plugin handle the given UI command.  When the
-// command is invoked, the browser will call CPP_HandleCommand.  'command'
-// should be an integer identifier.  Currently only builtin commands are
-// supported, but in the future we may want to let plugins add custom menu
-// commands with their own descriptions.
-typedef CPError (STDCALL *CPB_AddUICommandFunc)(CPID id, int command);
-
-//
-// Functions related to making network requests.
-// Both the host and plugin will implement their own versions of these.
-//
-
-// Starts the request.  Returns CPERR_SUCCESS if the request could be started
-// immediately, at which point the response info is available to be read.
-// Returns CPERR_IO_PENDING if an asynchronous operation was started, and the
-// caller should wait for CPRR_StartCompleted to be called before reading the
-// response info.  Returns an error code on failure.
-typedef CPError (STDCALL *CPR_StartRequestFunc)(CPRequest* request);
-
-// Stops or cancels the request.  The caller should not access the request
-// object after this call.  If an asynchronous IO operation is pending, the
-// operation is aborted and the caller will not receive a callback for it.
-typedef void (STDCALL *CPR_EndRequestFunc)(CPRequest* request, CPError reason);
-
-// Sets the additional request headers to append to the standard headers that
-// would normally be made with this request.  Headers should be \r\n-delimited,
-// with no terminating \r\n.  Extra headers are not checked against the standard
-// headers for duplicates. Must be called before CPRR_StartCompletedFunc.
-// Plugins should avoid setting the following headers: User-Agent,
-// Content-Length.
-typedef void (STDCALL *CPR_SetExtraRequestHeadersFunc)(CPRequest* request,
-                                                       const char* headers);
-
-// Sets the load flags for this request. 'flags' is a bitwise-OR of
-// CPRequestLoadFlags.  Must be called before CPRR_StartCompletedFunc.
-typedef void (STDCALL *CPR_SetRequestLoadFlagsFunc)(CPRequest* request,
-                                                    uint32_t flags);
-
-// Appends binary data to the request body of a POST or PUT request.  The caller
-// should set the "Content-Type" header to the appropriate mime type using
-// CPR_SetExtraRequestHeadersFunc.  This can be called multiple times to append
-// a sequence of data segments to upload.  Must be called before
-// CPR_StartRequestFunc.
-typedef void (STDCALL *CPR_AppendDataToUploadFunc)(
-    CPRequest* request, const char* bytes, int bytes_len);
-
-// Appends the contents of a file to the request body of a POST or PUT request.
-// 'offset' and 'length' can be used to append a subset of the file. Pass zero
-// for 'length' and 'offset' to upload the entire file. 'offset'
-// indicates where the data to upload begins in the file. 'length' indicates
-// how much of the file to upload. A 'length' of zero is interpretted as to
-// end-of-file. If 'length' and 'offset' indicate a range beyond end of file,
-// the amount sent is clipped at eof.
-// See CPR_AppendDataToUploadFunc for additional usage information.
-// (added in v0.4)
-typedef CPError (STDCALL *CPR_AppendFileToUploadFunc)(
-    CPRequest* request, const char* filepath, uint64_t offset, uint64_t length);
-
-// Queries for some response meta data.  See CPResponseInfoType for possible
-// queries.  If buf_size is too small to contain the entire data, the return
-// value will indicate the size required.  Otherwise, the return value is a
-// CPError or CPERR_SUCCESS.
-typedef int (STDCALL *CPR_GetResponseInfoFunc)(
-    CPRequest* request, CPResponseInfoType type,
-    void* buf, uint32_t buf_size);
-
-// Attempts to read a request's response data.  The number of bytes read is
-// returned; 0 indicates an EOF.  CPERR_IO_PENDING is returned if an
-// asynchronous operation was started, and CPRR_ReadCompletedFunc will be called
-// when it completes; 'buf' must be available until the operation completes.
-// Returns an error code on failure.
-typedef int (STDCALL *CPR_ReadFunc)(
-    CPRequest* request, void* buf, uint32_t buf_size);
-
-//
-// Functions related to serving network requests.
-// Both the host and plugin will implement their own versions of these.
-//
-
-// Called upon a server-initiated redirect.  The request will still hold the
-// original URL, and 'new_url' will be the redirect destination.
-typedef void (STDCALL *CPRR_ReceivedRedirectFunc)(CPRequest* request,
-                                                  const char* new_url);
-
-// Called when an asynchronous CPR_StartRequest call has completed, once all
-// redirects are followed.  On success, 'result' holds CPERR_SUCCESS and the
-// response info is available to be read via CPR_GetResponseInfo.  On error,
-// 'result' holds the error code.
-typedef void (STDCALL *CPRR_StartCompletedFunc)(CPRequest* request,
-                                                CPError result);
-
-// Called when an asynchronous CPR_Read call has completed.  On success,
-// 'bytes_read' will hold the number of bytes read into the buffer that was
-// passed to CPR_Read; 0 indicates an EOF, and the request object will be
-// destroyed after the call completes.  On failure, 'bytes_read' holds the error
-// code.
-typedef void (STDCALL *CPRR_ReadCompletedFunc)(CPRequest* request,
-                                               int bytes_read);
-
-// Called as upload progress is being made for async POST requests.
-// (added in v0.5)
-typedef void (STDCALL *CPRR_UploadProgressFunc)(CPRequest* request,
-                                                uint64_t position,
-                                                uint64_t size);
-
-//
-// Functions to support the sending and receipt of messages between processes.
-//
-
-// Returns true if the plugin process is running
-typedef CPBool (STDCALL *CPB_IsPluginProcessRunningFunc)(CPID id);
-
-// Returns the type of the current process.
-typedef CPProcessType (STDCALL *CPB_GetProcessTypeFunc)(CPID id);
-
-// Asks the browser to send raw data to the other process hosting an instance of
-// this plugin. If needed, the plugin process will be started prior to sending
-// the message.
-typedef CPError (STDCALL *CPB_SendMessageFunc)(CPID id,
-                                               const void *data,
-                                               uint32_t data_len);
-
-// Asks the browser to send raw data to the other process hosting an instance of
-// this plugin. This function only works from the plugin or renderer process.
-// This function blocks until the message is processed.  The memory should be
-// freed using CPB_Free when done.
-typedef CPError (STDCALL *CPB_SendSyncMessageFunc)(CPID id,
-                                                   const void *data,
-                                                   uint32_t data_len,
-                                                   void **retval,
-                                                   uint32_t *retval_len);
-
-// This function asynchronously calls the provided function on the plugin
-// thread.  user_data is passed as the argument to the function.
-typedef CPError (STDCALL *CPB_PluginThreadAsyncCallFunc)(CPID id,
-                                                         void (*func)(void *),
-                                                         void *user_data);
-
-// This function creates an open file dialog.  The process is granted access
-// to any files that are selected.  |multiple_files| determines if more than
-// one file can be selected.
-typedef CPError (STDCALL *CPB_OpenFileDialogFunc)(CPID id,
-                                                  CPBrowsingContext context,
-                                                  bool multiple_files,
-                                                  const char *title,
-                                                  const char *filter,
-                                                  void *user_data);
-
-// Informs the plugin of raw data having been sent from another process.
-typedef void (STDCALL *CPP_OnMessageFunc)(void *data, uint32_t data_len);
-
-// Informs the plugin of raw data having been sent from another process.
-typedef void (STDCALL *CPP_OnSyncMessageFunc)(void *data, uint32_t data_len,
-                                              void **retval,
-                                              uint32_t *retval_len);
-
-// Informs the plugin that the file dialog has completed, and contains the
-// results.
-typedef void (STDCALL *CPP_OnFileDialogResultFunc)(void *data,
-                                                   const char **files,
-                                                   uint32_t files_len);
-
-// Function table for issuing requests using via the other side's network stack.
-// For the plugin, this functions deal with issuing requests through the
-// browser.  For the browser, these functions deal with allowing the plugin to
-// intercept requests.
-typedef struct _CPRequestFuncs {
-  uint16_t size;
-  CPR_SetExtraRequestHeadersFunc set_extra_request_headers;
-  CPR_SetRequestLoadFlagsFunc set_request_load_flags;
-  CPR_AppendDataToUploadFunc append_data_to_upload;
-  CPR_StartRequestFunc start_request;
-  CPR_EndRequestFunc end_request;
-  CPR_GetResponseInfoFunc get_response_info;
-  CPR_ReadFunc read;
-  CPR_AppendFileToUploadFunc append_file_to_upload;
-} CPRequestFuncs;
-
-// Function table for handling requests issued by the other side.  For the
-// plugin, these deal with serving requests that the plugin has intercepted. For
-// the browser, these deal with serving requests that the plugin has issued
-// through us.
-typedef struct _CPResponseFuncs {
-  uint16_t size;
-  CPRR_ReceivedRedirectFunc received_redirect;
-  CPRR_StartCompletedFunc start_completed;
-  CPRR_ReadCompletedFunc read_completed;
-  CPRR_UploadProgressFunc upload_progress;
-} CPResponseFuncs;
-
-// Function table of CPP functions (functions provided by plugin to host). This
-// structure is filled in by the plugin in the CP_Initialize call, except for
-// the 'size' field, which is set by the browser.  The version fields should be
-// set to those that the plugin was compiled using.
-typedef struct _CPPluginFuncs {
-  uint16_t size;
-  uint16_t version;
-  CPRequestFuncs* request_funcs;
-  CPResponseFuncs* response_funcs;
-  CPP_ShutdownFunc shutdown;
-  CPP_ShouldInterceptRequestFunc should_intercept_request;
-  CPP_OnMessageFunc on_message;
-  CPP_HtmlDialogClosedFunc html_dialog_closed;
-  CPP_HandleCommandFunc handle_command;
-  CPP_OnSyncMessageFunc on_sync_message;
-  CPP_OnFileDialogResultFunc on_file_dialog_result;
-} CPPluginFuncs;
-
-// Function table CPB functions (functions provided by host to plugin).
-// This structure is filled in by the browser and provided to the plugin.  The
-// plugin will likely want to save a copy of this structure to make calls
-// back to the browser.
-typedef struct _CPBrowserFuncs {
-  uint16_t size;
-  uint16_t version;
-  CPRequestFuncs* request_funcs;
-  CPResponseFuncs* response_funcs;
-  CPB_EnableRequestInterceptFunc enable_request_intercept;
-  CPB_CreateRequestFunc create_request;
-  CPB_GetCookiesFunc get_cookies;
-  CPB_AllocFunc alloc;
-  CPB_FreeFunc free;
-  CPB_SetKeepProcessAliveFunc set_keep_process_alive;
-  CPB_ShowHtmlDialogModalFunc show_html_dialog_modal;
-  CPB_ShowHtmlDialogFunc show_html_dialog;
-  CPB_IsPluginProcessRunningFunc is_plugin_process_running;
-  CPB_GetProcessTypeFunc get_process_type;
-  CPB_SendMessageFunc send_message;
-  CPB_GetBrowsingContextFromNPPFunc get_browsing_context_from_npp;
-  CPB_GetBrowsingContextInfoFunc get_browsing_context_info;
-  CPB_GetCommandLineArgumentsFunc get_command_line_arguments;
-  CPB_AddUICommandFunc add_ui_command;
-  CPB_HandleCommandFunc handle_command;
-  CPB_SendSyncMessageFunc send_sync_message;
-  CPB_PluginThreadAsyncCallFunc plugin_thread_async_call;
-  CPB_OpenFileDialogFunc open_file_dialog;
-} CPBrowserFuncs;
-
-
-//
-// DLL exports
-//
-
-// This export is optional.
-// Prior to calling CP_Initialize, the browser may negotiate with the plugin
-// regarding which version of the CPAPI to utilize. 'min_version' is the
-// lowest version of the interface supported by the browser, 'max_version' is
-// the highest supported version. The plugin can specify which version within
-// the range should be used. This version will be reflected in the version field
-// of the CPBrowserFuncs struct passed to CP_Initialize. If this function
-// returns an error code, CP_Initialize will not be called. If function is not
-// exported by the chrome plugin module, CP_Initiailize will be called with
-// a version of the host's choosing.
-typedef CPError (STDCALL *CP_VersionNegotiateFunc)(
-  uint16_t min_version, uint16_t max_version, uint16_t *selected_version);
-
-// 'bfuncs' are the browser functions provided to the plugin. 'id' is the
-// plugin identifier that the plugin should use when calling browser functions.
-// The plugin should initialize 'pfuncs' with pointers to its own functions,
-// or return an error code.
-// All functions and entry points should be called on the same thread.  The
-// plugin should not attempt to call a browser function from a thread other
-// than the one CP_InitializeFunc is called from.
-typedef CPError (STDCALL *CP_InitializeFunc)(
-    CPID id, const CPBrowserFuncs* bfuncs, CPPluginFuncs* pfuncs);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // CHROME_COMMON_CHROME_PLUGIN_API_H__
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/chrome_plugin_lib.cc
+++ /dev/null
@@ -1,306 +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 "chrome/common/chrome_plugin_lib.h"
-
-#include "base/command_line.h"
-#include "base/hash_tables.h"
-#include "base/histogram.h"
-#include "base/message_loop.h"
-#include "base/path_service.h"
-#include "base/perftimer.h"
-#include "base/thread.h"
-#if defined(OS_WIN)
-#include "base/registry.h"
-#endif
-#include "base/string_util.h"
-#include "chrome/common/chrome_counters.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/notification_service.h"
-#include "chrome/common/chrome_paths.h"
-#include "webkit/glue/plugins/plugin_list.h"
-
-using base::TimeDelta;
-
-// TODO(port): revisit when plugins happier
-#if defined(OS_WIN)
-const TCHAR ChromePluginLib::kRegistryChromePlugins[] =
-    _T("Software\\Google\\Chrome\\Plugins");
-static const TCHAR kRegistryLoadOnStartup[] = _T("LoadOnStartup");
-static const TCHAR kRegistryPath[] = _T("Path");
-#endif
-
-typedef base::hash_map<FilePath, scoped_refptr<ChromePluginLib> >
-    PluginMap;
-
-// A map of all the instantiated plugins.
-static PluginMap* g_loaded_libs;
-
-// The thread plugins are loaded and used in, lazily initialized upon
-// the first creation call.
-static PlatformThreadId g_plugin_thread_id = 0;
-static MessageLoop* g_plugin_thread_loop = NULL;
-
-#ifdef GEARS_STATIC_LIB
-// defined in gears/base/chrome/module_cr.cc
-CPError STDCALL Gears_CP_Initialize(CPID id, const CPBrowserFuncs *bfuncs,
-                                    CPPluginFuncs *pfuncs);
-#endif
-
-static bool IsSingleProcessMode() {
-  // We don't support ChromePlugins in single-process mode.
-  return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
-}
-
-// static
-bool ChromePluginLib::IsInitialized() {
-  return (g_loaded_libs != NULL);
-}
-
-// static
-ChromePluginLib* ChromePluginLib::Create(const FilePath& filename,
-                                         const CPBrowserFuncs* bfuncs) {
-  // Keep a map of loaded plugins to ensure we only load each library once.
-  if (!g_loaded_libs) {
-    g_loaded_libs = new PluginMap();
-    g_plugin_thread_id = PlatformThread::CurrentId();
-    g_plugin_thread_loop = MessageLoop::current();
-  }
-  DCHECK(IsPluginThread());
-
-  PluginMap::const_iterator iter = g_loaded_libs->find(filename);
-  if (iter != g_loaded_libs->end())
-    return iter->second;
-
-  scoped_refptr<ChromePluginLib> plugin(new ChromePluginLib(filename));
-  if (!plugin->CP_Initialize(bfuncs))
-    return NULL;
-
-  (*g_loaded_libs)[filename] = plugin;
-  return plugin;
-}
-
-// static
-ChromePluginLib* ChromePluginLib::Find(const FilePath& filename) {
-  if (g_loaded_libs) {
-    PluginMap::const_iterator iter = g_loaded_libs->find(filename);
-    if (iter != g_loaded_libs->end())
-      return iter->second;
-  }
-  return NULL;
-}
-
-// static
-void ChromePluginLib::Destroy(const FilePath& filename) {
-  DCHECK(g_loaded_libs);
-  PluginMap::iterator iter = g_loaded_libs->find(filename);
-  if (iter != g_loaded_libs->end()) {
-    iter->second->Unload();
-    g_loaded_libs->erase(iter);
-  }
-}
-
-// static
-bool ChromePluginLib::IsPluginThread() {
-  return PlatformThread::CurrentId() == g_plugin_thread_id;
-}
-
-// static
-MessageLoop* ChromePluginLib::GetPluginThreadLoop() {
-  return g_plugin_thread_loop;
-}
-
-// static
-void ChromePluginLib::RegisterPluginsWithNPAPI() {
-  // We don't support ChromePlugins in single-process mode.
-  if (IsSingleProcessMode())
-    return;
-
-  FilePath path;
-  if (!PathService::Get(chrome::FILE_GEARS_PLUGIN, &path))
-    return;
-  // Note: we can only access the NPAPI list because the PluginService has done
-  // the locking for us.  We should not touch it anywhere else.
-  NPAPI::PluginList::AddExtraPluginPath(path);
-}
-
-static void LogPluginLoadTime(const TimeDelta &time) {
-  UMA_HISTOGRAM_TIMES("Gears.LoadTime", time);
-}
-
-// static
-void ChromePluginLib::LoadChromePlugins(const CPBrowserFuncs* bfuncs) {
-  static bool loaded = false;
-  if (loaded)
-    return;
-  loaded = true;
-
-  // We don't support ChromePlugins in single-process mode.
-  if (IsSingleProcessMode())
-    return;
-
-  FilePath path;
-  if (!PathService::Get(chrome::FILE_GEARS_PLUGIN, &path))
-    return;
-
-  PerfTimer timer;
-  ChromePluginLib::Create(path, bfuncs);
-  LogPluginLoadTime(timer.Elapsed());
-
-  // TODO(mpcomplete): disabled loading of plugins from the registry until we
-  // phase out registry keys from the gears installer.
-#if 0
-  for (RegistryKeyIterator iter(HKEY_CURRENT_USER, kRegistryChromePlugins);
-       iter.Valid(); ++iter) {
-    // Use the registry to gather plugin across the file system.
-    std::wstring reg_path = kRegistryChromePlugins;
-    reg_path.append(L"\\");
-    reg_path.append(iter.Name());
-    RegKey key(HKEY_CURRENT_USER, reg_path.c_str());
-
-    DWORD is_persistent;
-    if (key.ReadValueDW(kRegistryLoadOnStartup, &is_persistent) &&
-        is_persistent) {
-      std::wstring path;
-      if (key.ReadValue(kRegistryPath, &path)) {
-        ChromePluginLib::Create(path, bfuncs);
-      }
-    }
-  }
-#endif
-}
-
-// static
-void ChromePluginLib::UnloadAllPlugins() {
-  if (g_loaded_libs) {
-    PluginMap::iterator it;
-    for (PluginMap::iterator it = g_loaded_libs->begin();
-         it != g_loaded_libs->end(); ++it) {
-      it->second->Unload();
-    }
-    delete g_loaded_libs;
-    g_loaded_libs = NULL;
-  }
-}
-
-const CPPluginFuncs& ChromePluginLib::functions() const {
-  DCHECK(initialized_);
-  DCHECK(IsPluginThread());
-  return plugin_funcs_;
-}
-
-ChromePluginLib::ChromePluginLib(const FilePath& filename)
-    : filename_(filename),
-#if defined(OS_WIN)
-      module_(0),
-#endif
-      initialized_(false),
-      CP_VersionNegotiate_(NULL),
-      CP_Initialize_(NULL) {
-  memset((void*)&plugin_funcs_, 0, sizeof(plugin_funcs_));
-}
-
-ChromePluginLib::~ChromePluginLib() {
-}
-
-bool ChromePluginLib::CP_Initialize(const CPBrowserFuncs* bfuncs) {
-  LOG(INFO) << "ChromePluginLib::CP_Initialize(" << filename_.value() <<
-               "): initialized=" << initialized_;
-  if (initialized_)
-    return true;
-
-  if (!Load())
-    return false;
-
-  if (CP_VersionNegotiate_) {
-    uint16_t selected_version = 0;
-    CPError rv = CP_VersionNegotiate_(CP_VERSION, CP_VERSION,
-                                      &selected_version);
-    if ( (rv != CPERR_SUCCESS) || (selected_version != CP_VERSION))
-      return false;
-  }
-
-  plugin_funcs_.size = sizeof(plugin_funcs_);
-  CPError rv = CP_Initialize_(cpid(), bfuncs, &plugin_funcs_);
-  initialized_ = (rv == CPERR_SUCCESS) &&
-      (CP_GET_MAJOR_VERSION(plugin_funcs_.version) == CP_MAJOR_VERSION) &&
-      (CP_GET_MINOR_VERSION(plugin_funcs_.version) <= CP_MINOR_VERSION);
-  LOG(INFO) << "ChromePluginLib::CP_Initialize(" << filename_.value() <<
-               "): initialized=" << initialized_ <<
-               "): result=" << rv;
-
-  return initialized_;
-}
-
-void ChromePluginLib::CP_Shutdown() {
-  DCHECK(initialized_);
-  functions().shutdown();
-  initialized_ = false;
-  memset((void*)&plugin_funcs_, 0, sizeof(plugin_funcs_));
-}
-
-int ChromePluginLib::CP_Test(void* param) {
-  DCHECK(initialized_);
-  if (!CP_Test_)
-    return -1;
-  return CP_Test_(param);
-}
-
-bool ChromePluginLib::Load() {
-#if !defined(OS_WIN)
-  // TODO(port): plugins not yet implemented
-  NOTIMPLEMENTED() << " -- gears loading code.";
-  return false;
-#else
-  DCHECK(module_ == 0);
-#ifdef GEARS_STATIC_LIB
-  FilePath path;
-  if (filename_.BaseName().value().find(FILE_PATH_LITERAL("gears")) == 0) {
-    CP_Initialize_ = &Gears_CP_Initialize;
-    return true;
-  }
-#endif
-
-  module_ = LoadLibrary(filename_.value().c_str());
-  if (module_ == 0)
-    return false;
-
-  // required initialization function
-  CP_Initialize_ = reinterpret_cast<CP_InitializeFunc>
-      (GetProcAddress(module_, "CP_Initialize"));
-
-  if (!CP_Initialize_) {
-    FreeLibrary(module_);
-    module_ = 0;
-    return false;
-  }
-
-  // optional version negotiation function
-  CP_VersionNegotiate_ = reinterpret_cast<CP_VersionNegotiateFunc>
-      (GetProcAddress(module_, "CP_VersionNegotiate"));
-
-  // optional test function
-  CP_Test_ = reinterpret_cast<CP_TestFunc>
-      (GetProcAddress(module_, "CP_Test"));
-
-  return true;
-#endif
-}
-
-void ChromePluginLib::Unload() {
-  NotificationService::current()->Notify(
-      NotificationType::CHROME_PLUGIN_UNLOADED,
-      Source<ChromePluginLib>(this),
-      NotificationService::NoDetails());
-
-  if (initialized_)
-    CP_Shutdown();
-
-#if defined(OS_WIN)
-  if (module_) {
-    FreeLibrary(module_);
-    module_ = 0;
-  }
-#endif
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/chrome_plugin_lib.h
+++ /dev/null
@@ -1,106 +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 CHROME_COMMON_CHROME_PLUGIN_LIB_H_
-#define CHROME_COMMON_CHROME_PLUGIN_LIB_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/file_path.h"
-#include "base/ref_counted.h"
-#include "chrome/common/chrome_plugin_api.h"
-
-class MessageLoop;
-
-// A ChromePluginLib is a single Chrome Plugin Library.
-// This class is used in the browser process (IO thread), and the plugin process
-// (plugin thread).  It should not be accessed on other threads, because it
-// issues a NOTIFY_CHROME_PLUGIN_UNLOADED notification.
-class ChromePluginLib : public base::RefCounted<ChromePluginLib>  {
- public:
-  static bool IsInitialized();
-  static ChromePluginLib* Create(const FilePath& filename,
-                                 const CPBrowserFuncs* bfuncs);
-  static ChromePluginLib* Find(const FilePath& filename);
-  static void Destroy(const FilePath& filename);
-  static bool IsPluginThread();
-  static MessageLoop* GetPluginThreadLoop();
-
-  static ChromePluginLib* FromCPID(CPID id) {
-    return reinterpret_cast<ChromePluginLib*>(id);
-  }
-
-  // Adds Chrome plugins to the NPAPI plugin list.
-  static void RegisterPluginsWithNPAPI();
-
-  // Loads all the plugins that are marked as "LoadOnStartup" in the
-  // registry. This should only be called in the browser process.
-  static void LoadChromePlugins(const CPBrowserFuncs* bfuncs);
-
-  // Unloads all the loaded plugins and cleans up the plugin map.
-  static void UnloadAllPlugins();
-
-  // Returns true if the plugin is currently loaded.
-  const bool is_loaded() const { return initialized_; }
-
-  // Get the Plugin's function pointer table.
-  const CPPluginFuncs& functions() const;
-
-  CPID cpid() { return reinterpret_cast<CPID>(this); }
-
-  const FilePath& filename() { return filename_; }
-
-  // Plugin API functions
-
-  // Method to call a test function in the plugin, used for unit tests.
-  int CP_Test(void* param);
-
-#if defined(OS_WIN)
-  // The registry path to search for Chrome Plugins/
-  static const TCHAR kRegistryChromePlugins[];
-#endif  // defined(OS_WIN)
-
- private:
-  friend class base::RefCounted<ChromePluginLib>;
-
-  ChromePluginLib(const FilePath& filename);
-  ~ChromePluginLib();
-
-  // Method to initialize a Plugin.
-  // Initialize can be safely called multiple times.
-  bool CP_Initialize(const CPBrowserFuncs* bfuncs);
-
-  // Method to shutdown a Plugin.
-  void CP_Shutdown();
-
-  // Attempts to load the plugin.
-  // Returns true if it is a legitimate plugin, false otherwise
-  bool Load();
-
-  // Unloads the plugin.
-  void Unload();
-
-  FilePath filename_;  // the path to the plugin
-#if defined(OS_WIN)
-  // TODO(port): Remove ifdefs when we have portable replacement for HMODULE.
-  HMODULE module_;  // the opened plugin handle
-#endif  // defined(OS_WIN)
-  bool initialized_;  // is the plugin initialized
-
-  // Exported symbols from the plugin, looked up by name.
-  CP_VersionNegotiateFunc CP_VersionNegotiate_;
-  CP_InitializeFunc CP_Initialize_;
-
-  // Additional function pointers provided by the plugin.
-  CPPluginFuncs plugin_funcs_;
-
-  // Used for unit tests.
-  typedef int (STDCALL *CP_TestFunc)(void*);
-  CP_TestFunc CP_Test_;
-
-  DISALLOW_COPY_AND_ASSIGN(ChromePluginLib);
-};
-
-#endif  // CHROME_COMMON_CHROME_PLUGIN_LIB_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/chrome_plugin_unittest.cc
+++ /dev/null
@@ -1,287 +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.
-// Tests exercising the Chrome Plugin API.
-
-#include "base/file_util.h"
-#include "base/path_service.h"
-#include "base/string_util.h"
-#include "chrome/browser/chrome_plugin_host.h"
-#include "chrome/browser/profile.h"
-#include "chrome/common/chrome_plugin_lib.h"
-#include "chrome/test/chrome_plugin/test_chrome_plugin.h"
-#include "net/base/io_buffer.h"
-#include "net/http/http_response_headers.h"
-#include "net/url_request/url_request_test_job.h"
-#include "net/url_request/url_request_unittest.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-const wchar_t kDocRoot[] = L"chrome/test/data";
-const char kPluginFilename[] = "test_chrome_plugin.dll";
-const int kResponseBufferSize = 4096;
-
-class ChromePluginTest : public testing::Test, public URLRequest::Delegate {
- public:
-  ChromePluginTest()
-      : request_(NULL),
-        response_buffer_(new net::IOBuffer(kResponseBufferSize)),
-        plugin_(NULL),
-        expected_payload_(NULL),
-        request_context_(new TestURLRequestContext()) {
-  }
-
-  // Loads/unloads the chrome test plugin.
-  void LoadPlugin();
-  void UnloadPlugin();
-
-  // Runs the test and expects the given payload as a response.  If expectation
-  // is NULL, the request is expected to fail.
-  void RunTest(const GURL& url, const TestResponsePayload* expected_payload);
-
-  // URLRequest::Delegate implementations
-  virtual void OnReceivedRedirect(URLRequest* request,
-                                  const GURL& new_url) { }
-  virtual void OnResponseStarted(URLRequest* request);
-  virtual void OnReadCompleted(URLRequest* request, int bytes_read);
-
-  // Helper called when the URLRequest is done.
-  void OnURLRequestComplete();
-
-  // testing::Test
-  virtual void SetUp() {
-    LoadPlugin();
-    URLRequest::RegisterProtocolFactory("test", &URLRequestTestJob::Factory);
-
-    // We need to setup a default request context in order to issue HTTP
-    // requests.
-    DCHECK(!Profile::GetDefaultRequestContext());
-    Profile::set_default_request_context(request_context_.get());
-  }
-  virtual void TearDown() {
-    UnloadPlugin();
-    URLRequest::RegisterProtocolFactory("test", NULL);
-
-    Profile::set_default_request_context(NULL);
-
-    // Clear the request before flushing the message loop since killing the
-    // request can result in the generation of more tasks.
-    request_.reset();
-
-    // Flush the message loop to make Purify happy.
-    message_loop_.RunAllPending();
-  }
- protected:
-  MessageLoopForIO message_loop_;
-
-  // Note: we use URLRequest (instead of URLFetcher) because this allows the
-  // request to be intercepted.
-  scoped_ptr<URLRequest> request_;
-  scoped_refptr<net::IOBuffer> response_buffer_;
-  std::string response_data_;
-
-  ChromePluginLib* plugin_;
-  TestFuncParams::PluginFuncs test_funcs_;
-  const TestResponsePayload* expected_payload_;
-  scoped_refptr<URLRequestContext> request_context_;
-};
-
-static void STDCALL CPT_Complete(CPRequest* request, bool success,
-                                 const std::string& raw_headers,
-                                 const std::string& body) {
-  GURL url(request->url);
-  if (url == GURL(kChromeTestPluginPayloads[0].url)) {
-    // This URL should fail, because the plugin should not have intercepted it.
-    EXPECT_FALSE(success);
-    MessageLoop::current()->Quit();
-    return;
-  }
-
-  scoped_refptr<net::HttpResponseHeaders> headers(
-      new net::HttpResponseHeaders(raw_headers));
-  EXPECT_TRUE(success);
-  EXPECT_EQ(200, headers->response_code());
-
-  if (url == URLRequestTestJob::test_url_1()) {
-    EXPECT_EQ(URLRequestTestJob::test_data_1(), body);
-  } else if (url == URLRequestTestJob::test_url_2()) {
-    EXPECT_EQ(URLRequestTestJob::test_data_2(), body);
-  } else if (url.spec().find("echo") != std::string::npos) {
-    EXPECT_EQ(kChromeTestPluginPostData, body);
-  }
-
-  MessageLoop::current()->Quit();
-}
-
-static void STDCALL CPT_InvokeLater(TestFuncParams::CallbackFunc callback,
-                                    void* callback_data, int delay_ms) {
-  MessageLoop::current()->PostDelayedTask(FROM_HERE,
-      NewRunnableFunction(callback, callback_data), delay_ms);
-}
-
-void ChromePluginTest::LoadPlugin() {
-  FilePath path;
-  PathService::Get(base::DIR_EXE, &path);
-  path = path.AppendASCII(kPluginFilename);
-  plugin_ = ChromePluginLib::Create(path, GetCPBrowserFuncsForBrowser());
-
-  // Exchange test APIs with the plugin.
-  TestFuncParams params;
-  params.bfuncs.test_complete = CPT_Complete;
-  params.bfuncs.invoke_later = CPT_InvokeLater;
-  EXPECT_EQ(CPERR_SUCCESS, plugin_->CP_Test(&params));
-  test_funcs_ = params.pfuncs;
-
-  EXPECT_TRUE(plugin_);
-}
-
-void ChromePluginTest::UnloadPlugin() {
-  ChromePluginLib::UnloadAllPlugins();
-  plugin_ = NULL;
-}
-
-void ChromePluginTest::RunTest(const GURL& url,
-                               const TestResponsePayload* expected_payload) {
-  expected_payload_ = expected_payload;
-
-  response_data_.clear();
-  request_.reset(new URLRequest(url, this));
-  request_->set_context(new TestURLRequestContext());
-  request_->Start();
-
-  MessageLoop::current()->Run();
-}
-
-void ChromePluginTest::OnResponseStarted(URLRequest* request) {
-  DCHECK(request == request_);
-
-  int bytes_read = 0;
-  if (request_->status().is_success())
-    request_->Read(response_buffer_, kResponseBufferSize, &bytes_read);
-  OnReadCompleted(request_.get(), bytes_read);
-}
-
-void ChromePluginTest::OnReadCompleted(URLRequest* request, int bytes_read) {
-  DCHECK(request == request_);
-
-  do {
-    if (!request_->status().is_success() || bytes_read <= 0)
-      break;
-    response_data_.append(response_buffer_->data(), bytes_read);
-  } while (request_->Read(response_buffer_, kResponseBufferSize, &bytes_read));
-
-  if (!request_->status().is_io_pending()) {
-    OnURLRequestComplete();
-  }
-}
-
-void ChromePluginTest::OnURLRequestComplete() {
-  if (expected_payload_) {
-    EXPECT_TRUE(request_->status().is_success());
-
-    EXPECT_EQ(expected_payload_->status, request_->GetResponseCode());
-    if (expected_payload_->mime_type) {
-      std::string mime_type;
-      EXPECT_TRUE(request_->response_headers()->GetMimeType(&mime_type));
-      EXPECT_EQ(expected_payload_->mime_type, mime_type);
-    }
-    if (expected_payload_->body) {
-      EXPECT_EQ(expected_payload_->body, response_data_);
-    }
-  } else {
-    EXPECT_FALSE(request_->status().is_success());
-  }
-
-  MessageLoop::current()->Quit();
-  // If MessageLoop::current() != main_loop_, it will be shut down when the
-  // main loop returns and this thread subsequently goes out of scope.
-}
-
-};  // namespace
-
-// Tests that the plugin can intercept URLs.
-TEST_F(ChromePluginTest, DoesIntercept) {
-  for (int i = 0; i < arraysize(kChromeTestPluginPayloads); ++i) {
-    RunTest(GURL(kChromeTestPluginPayloads[i].url),
-            &kChromeTestPluginPayloads[i]);
-  }
-}
-
-// Tests that non-intercepted URLs are handled normally.
-TEST_F(ChromePluginTest, DoesNotIntercept) {
-  TestResponsePayload about_blank = {
-    "about:blank",
-    false,
-    -1,
-    NULL,
-    ""
-  };
-  RunTest(GURL(about_blank.url), &about_blank);
-}
-
-// Tests that unloading the plugin correctly unregisters URL interception.
-TEST_F(ChromePluginTest, UnregisterIntercept) {
-  UnloadPlugin();
-
-  RunTest(GURL(kChromeTestPluginPayloads[0].url), NULL);
-}
-
-static void ProcessAllPendingMessages() {
-  while (URLRequestTestJob::ProcessOnePendingMessage());
-}
-
-// Tests that the plugin can issue a GET request and receives the data when
-// it comes back synchronously.
-TEST_F(ChromePluginTest, CanMakeGETRequestSync) {
-  // test_url_1 has a synchronous response
-  EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request(
-      "GET", URLRequestTestJob::test_url_1()));
-
-  // Note: we must add this task after we make the request, so that
-  // URLRequestTestJob's StartAsync task is added and run first.
-  MessageLoop::current()->PostTask(FROM_HERE,
-      NewRunnableFunction(&ProcessAllPendingMessages));
-  MessageLoop::current()->Run();
-}
-
-// Tests that the plugin can issue a GET request and receives the data when
-// it comes back asynchronously.
-TEST_F(ChromePluginTest, CanMakeGETRequestAsync) {
-  // test_url_2 has an asynchronous response
-  EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request(
-        "GET", URLRequestTestJob::test_url_2()));
-
-  // Note: we must add this task after we make the request, so that
-  // URLRequestTestJob's StartAsync task is added and run first.
-  MessageLoop::current()->PostTask(FROM_HERE,
-      NewRunnableFunction(&ProcessAllPendingMessages));
-  MessageLoop::current()->Run();
-}
-
-// Tests that the plugin can issue a POST request.
-TEST_F(ChromePluginTest, CanMakePOSTRequest) {
-  scoped_refptr<HTTPTestServer> server =
-      HTTPTestServer::CreateServer(kDocRoot, NULL);
-  ASSERT_TRUE(NULL != server.get());
-
-  GURL url = server->TestServerPage("echo");
-
-  EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request("POST", url));
-
-  // Note: we must add this task after we make the request, so that
-  // URLRequestTestJob's StartAsync task is added and run first.
-  MessageLoop::current()->PostTask(FROM_HERE,
-      NewRunnableFunction(&ProcessAllPendingMessages));
-  MessageLoop::current()->Run();
-}
-
-// Tests that the plugin does not intercept its own requests.
-TEST_F(ChromePluginTest, DoesNotInterceptOwnRequest) {
-  const TestResponsePayload& payload = kChromeTestPluginPayloads[0];
-
-  EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request(
-      "GET", GURL(payload.url)));
-
-  MessageLoop::current()->Run();
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/chrome_plugin_util.cc
+++ /dev/null
@@ -1,165 +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 "chrome/common/chrome_plugin_util.h"
-
-#include "base/command_line.h"
-#include "base/file_util.h"
-#include "base/message_loop.h"
-#include "base/string_util.h"
-#include "chrome/common/chrome_plugin_lib.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/notification_service.h"
-#include "net/base/load_flags.h"
-#include "net/http/http_response_headers.h"
-
-//
-// ScopableCPRequest
-//
-
-ScopableCPRequest::ScopableCPRequest(const char* u, const char* m,
-                                     CPBrowsingContext c) {
-  pdata = NULL;
-  data = NULL;
-#if defined(OS_WIN)
-  url = _strdup(u);
-  method = _strdup(m);
-#else
-  url = strdup(u);
-  method = strdup(m);
-#endif
-  context = c;
-}
-
-ScopableCPRequest::~ScopableCPRequest() {
-  pdata = NULL;
-  data = NULL;
-  free(const_cast<char*>(url));
-  free(const_cast<char*>(method));
-}
-
-//
-// PluginHelper
-//
-
-// static
-void PluginHelper::DestroyAllHelpersForPlugin(ChromePluginLib* plugin) {
-  NotificationService::current()->Notify(
-      NotificationType::CHROME_PLUGIN_UNLOADED,
-      Source<ChromePluginLib>(plugin),
-      NotificationService::NoDetails());
-}
-
-PluginHelper::PluginHelper(ChromePluginLib* plugin) : plugin_(plugin) {
-  DCHECK(CalledOnValidThread());
-  NotificationService::current()->AddObserver(
-      this, NotificationType::CHROME_PLUGIN_UNLOADED,
-      Source<ChromePluginLib>(plugin_));
-}
-
-PluginHelper::~PluginHelper() {
-  DCHECK(CalledOnValidThread());
-  NotificationService::current()->RemoveObserver(
-      this, NotificationType::CHROME_PLUGIN_UNLOADED,
-      Source<ChromePluginLib>(plugin_));
-}
-
-void PluginHelper::Observe(NotificationType type,
-                           const NotificationSource& source,
-                           const NotificationDetails& details) {
-  DCHECK(CalledOnValidThread());
-  DCHECK(type == NotificationType::CHROME_PLUGIN_UNLOADED);
-  DCHECK(plugin_ == Source<ChromePluginLib>(source).ptr());
-
-  delete this;
-}
-
-//
-// PluginResponseUtils
-//
-
-uint32_t PluginResponseUtils::CPLoadFlagsToNetFlags(uint32_t flags) {
-  uint32_t net_flags = 0;
-#define HANDLE_FLAG(name) \
-  if (flags & CPREQUEST##name) \
-  net_flags |= net::name
-
-  HANDLE_FLAG(LOAD_VALIDATE_CACHE);
-  HANDLE_FLAG(LOAD_BYPASS_CACHE);
-  HANDLE_FLAG(LOAD_PREFERRING_CACHE);
-  HANDLE_FLAG(LOAD_ONLY_FROM_CACHE);
-  HANDLE_FLAG(LOAD_DISABLE_CACHE);
-  HANDLE_FLAG(LOAD_DISABLE_INTERCEPT);
-
-  net_flags |= net::LOAD_ENABLE_UPLOAD_PROGRESS;
-
-  return net_flags;
-}
-
-int PluginResponseUtils::GetResponseInfo(
-    const net::HttpResponseHeaders* response_headers,
-    CPResponseInfoType type, void* buf, size_t buf_size) {
-  if (!response_headers)
-    return CPERR_FAILURE;
-
-  switch (type) {
-  case CPRESPONSEINFO_HTTP_STATUS:
-    if (buf && buf_size) {
-      int status = response_headers->response_code();
-      memcpy(buf, &status, std::min(buf_size, sizeof(int)));
-    }
-    break;
-  case CPRESPONSEINFO_HTTP_RAW_HEADERS: {
-    const std::string& headers = response_headers->raw_headers();
-    if (buf_size < headers.size()+1)
-      return static_cast<int>(headers.size()+1);
-    if (buf)
-      memcpy(buf, headers.c_str(), headers.size()+1);
-    break;
-    }
-  default:
-    return CPERR_INVALID_VERSION;
-  }
-
-  return CPERR_SUCCESS;
-}
-
-CPError CPB_GetCommandLineArgumentsCommon(const char* url,
-                                          std::string* arguments) {
-  const CommandLine cmd = *CommandLine::ForCurrentProcess();
-  std::wstring arguments_w;
-
-  // Use the same UserDataDir for new launches that we currently have set.
-  std::wstring user_data_dir = cmd.GetSwitchValue(switches::kUserDataDir);
-  if (!user_data_dir.empty()) {
-    // Make sure user_data_dir is an absolute path.
-    if (file_util::AbsolutePath(&user_data_dir) &&
-        file_util::PathExists(user_data_dir)) {
-      arguments_w += std::wstring(L"--") + switches::kUserDataDir +
-                     L"=\"" + user_data_dir + L"\" ";
-    }
-  }
-
-  // Use '--app=url' instead of just 'url' to launch the browser with minimal
-  // chrome.
-  // Note: Do not change this flag!  Old Gears shortcuts will break if you do!
-  std::wstring url_w = UTF8ToWide(url);
-  arguments_w += std::wstring(L"--") + switches::kApp + L'=' + url_w;
-
-  *arguments = WideToUTF8(arguments_w);
-
-  return CPERR_SUCCESS;
-}
-
-//
-// Host functions shared by browser and plugin processes
-//
-
-void* STDCALL CPB_Alloc(uint32_t size) {
-  return malloc(size);
-}
-
-void STDCALL CPB_Free(void* memory) {
-  free(memory);
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/chrome_plugin_util.h
+++ /dev/null
@@ -1,85 +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 CHROME_COMMON_CHROME_PLUGIN_UTIL_H_
-#define CHROME_COMMON_CHROME_PLUGIN_UTIL_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/non_thread_safe.h"
-#include "base/ref_counted.h"
-#include "chrome/common/chrome_plugin_api.h"
-#include "chrome/common/notification_observer.h"
-
-class ChromePluginLib;
-class MessageLoop;
-namespace net {
-class HttpResponseHeaders;
-}
-
-// A helper struct to ensure the CPRequest data is cleaned up when done.
-// This class is reused for requests made by the browser (and intercepted by the
-// plugin) as well as those made by the plugin.
-struct ScopableCPRequest : public CPRequest {
-  template<class T>
-  static T GetData(CPRequest* request) {
-    return static_cast<T>(static_cast<ScopableCPRequest*>(request)->data);
-  }
-
-  ScopableCPRequest(const char* url, const char* method,
-                    CPBrowsingContext context);
-  ~ScopableCPRequest();
-
-  void* data;
-};
-
-// This is a base class for plugin-related objects that need to go away when
-// the plugin unloads.  This object also verifies that it is created and
-// destroyed on the same thread.
-class PluginHelper : public NotificationObserver, public NonThreadSafe {
- public:
-  static void DestroyAllHelpersForPlugin(ChromePluginLib* plugin);
-
-  PluginHelper(ChromePluginLib* plugin);
-  virtual ~PluginHelper();
-
-  // NotificationObserver
-  virtual void Observe(NotificationType type,
-                       const NotificationSource& source,
-                       const NotificationDetails& details);
-
- protected:
-  scoped_refptr<ChromePluginLib> plugin_;
-
-  DISALLOW_COPY_AND_ASSIGN(PluginHelper);
-};
-
-// A class of utility functions for dealing with request responses.
-class PluginResponseUtils {
-public:
-  // Helper to convert request load flags from the plugin API to the net API
-  // versions.
-  static uint32_t CPLoadFlagsToNetFlags(uint32_t flags);
-
-  // Common implementation of a CPR_GetResponseInfo call.
-  static int GetResponseInfo(
-      const net::HttpResponseHeaders* response_headers,
-      CPResponseInfoType type, void* buf, size_t buf_size);
-};
-
-// Helper to allocate a string using the given CPB_Alloc function.
-inline char* CPB_StringDup(CPB_AllocFunc alloc, const std::string& str) {
-  char* cstr = static_cast<char*>(alloc(static_cast<uint32_t>(str.length() + 1)));
-  memcpy(cstr, str.c_str(), str.length() + 1);  // Include null terminator.
-  return cstr;
-}
-
-CPError CPB_GetCommandLineArgumentsCommon(const char* url,
-                                          std::string* arguments);
-
-void* STDCALL CPB_Alloc(uint32_t size);
-void STDCALL CPB_Free(void* memory);
-
-#endif  // CHROME_COMMON_CHROME_PLUGIN_UTIL_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/classfactory.cc
+++ /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.
-
-#include "classfactory.h"
-
-
-GenericClassFactory::GenericClassFactory() :
-  reference_count_(1)
-{
-  InterlockedIncrement(&object_count_);
-}
-
-
-GenericClassFactory::~GenericClassFactory() {
-  InterlockedDecrement(&object_count_);
-}
-
-
-LONG GenericClassFactory::object_count_ = 0;
-
-
-STDMETHODIMP GenericClassFactory::QueryInterface(REFIID riid,
-                                                 LPVOID* ppobject) {
-  *ppobject = NULL;
-
-  if (IsEqualIID(riid, IID_IUnknown) ||
-      IsEqualIID(riid, IID_IClassFactory))
-    *ppobject = static_cast<IClassFactory*>(this);
-  else
-    return E_NOINTERFACE;
-
-  this->AddRef();
-  return S_OK;
-}
-
-
-STDMETHODIMP_(ULONG) GenericClassFactory::AddRef() {
-  return InterlockedIncrement(&reference_count_);
-}
-
-
-STDMETHODIMP_(ULONG) GenericClassFactory::Release() {
-  if(0 == InterlockedDecrement(&reference_count_)) {
-    delete this;
-    return 0;
-  }
-  return reference_count_;
-}
-
-
-STDMETHODIMP GenericClassFactory::LockServer(BOOL) {
-  return E_NOTIMPL;
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/classfactory.h
+++ /dev/null
@@ -1,71 +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.
-
-// ClassFactory<class>
-// is a simple class factory object for the parameterized class.
-//
-#ifndef _CLASSFACTORY_H_
-#define _CLASSFACTORY_H_
-
-#include <unknwn.h>
-
-// GenericClassFactory
-// provides the basic COM plumbing to implement IClassFactory, and
-// maintains a static count on the number of these objects in existence.
-// It remains for subclasses to implement CreateInstance.
-class GenericClassFactory : public IClassFactory {
-public:
-  GenericClassFactory();
-  ~GenericClassFactory();
-
-  //IUnknown methods
-  STDMETHOD(QueryInterface)(REFIID iid, LPVOID* ppvObject);
-  STDMETHOD_(ULONG, AddRef)();
-  STDMETHOD_(ULONG, Release)();
-
-  //IClassFactory methods
-  STDMETHOD(CreateInstance)(LPUNKNOWN pUnkOuter, REFIID riid,
-                            LPVOID* ppvObject) = 0;
-  STDMETHOD(LockServer)(BOOL fLock);
-
-  // generally handy for DllUnloadNow -- count of existing descendant objects
-  static LONG GetObjectCount() { return object_count_; }
-
-protected:
-  LONG reference_count_; // mind the reference counting for this object
-  static LONG object_count_; // count of all these objects
-};
-
-
-// OneClassFactory<T>
-// Knows how to be a factory for T's
-template <class T>
-class OneClassFactory : public GenericClassFactory
-{
-public:
-  //IClassFactory methods
-  STDMETHOD(CreateInstance)(LPUNKNOWN pUnkOuter, REFIID riid, void** ppvObject);
-};
-
-
-template <class T>
-STDMETHODIMP OneClassFactory<T>::CreateInstance(LPUNKNOWN pUnkOuter,
-                                                REFIID riid, void** result) {
-  *result = NULL;
-
-  if(pUnkOuter != NULL)
-    return CLASS_E_NOAGGREGATION;
-
-  T* const obj = new T();
-  if(!obj)
-    return E_OUTOFMEMORY;
-
-  obj->AddRef();
-  HRESULT const hr = obj->QueryInterface(riid, result);
-  obj->Release();
-
-  return hr;
-}
-
-#endif
--- a/ipc/chromium/src/chrome/common/common.vcproj
+++ b/ipc/chromium/src/chrome/common/common.vcproj
@@ -141,48 +141,16 @@
 				>
 			</File>
 			<File
 				RelativePath=".\net\url_request_intercept_job.h"
 				>
 			</File>
 		</Filter>
 		<Filter
-			Name="gfx"
-			>
-			<File
-				RelativePath=".\gfx\color_utils.cc"
-				>
-			</File>
-			<File
-				RelativePath=".\gfx\color_utils.h"
-				>
-			</File>
-			<File
-				RelativePath=".\gfx\emf.cc"
-				>
-			</File>
-			<File
-				RelativePath=".\gfx\emf.h"
-				>
-			</File>
-			<File
-				RelativePath=".\gfx\text_elider.cc"
-				>
-			</File>
-			<File
-				RelativePath=".\gfx\text_elider.h"
-				>
-			</File>
-			<File
-				RelativePath=".\gfx\utils.h"
-				>
-			</File>
-		</Filter>
-		<Filter
 			Name="ipc"
 			>
 			<File
 				RelativePath=".\ipc_channel.h"
 				>
 			</File>
 			<File
 				RelativePath=".\ipc_channel_proxy.cc"
@@ -261,36 +229,16 @@
 				>
 			</File>
 			<File
 				RelativePath=".\worker_messages_internal.h"
 				>
 			</File>
 		</Filter>
 		<Filter
-			Name="extensions"
-			>
-			<File
-				RelativePath=".\extensions\url_pattern.cc"
-				>
-			</File>
-			<File
-				RelativePath=".\extensions\url_pattern.h"
-				>
-			</File>
-			<File
-				RelativePath=".\extensions\user_script.cc"
-				>
-			</File>
-			<File
-				RelativePath=".\extensions\user_script.h"
-				>
-			</File>
-		</Filter>
-		<Filter
 			Name="app_cache"
 			>
 			<File
 				RelativePath=".\app_cache\app_cache_context_impl.cc"
 				>
 			</File>
 			<File
 				RelativePath=".\app_cache\app_cache_context_impl.h"
@@ -309,20 +257,16 @@
 				>
 			</File>
 			<File
 				RelativePath=".\app_cache\app_cache_dispatcher_host.h"
 				>
 			</File>
 		</Filter>
 		<File
-			RelativePath=".\accessibility_types.h"
-			>
-		</File>
-		<File
 			RelativePath=".\bindings_policy.h"
 			>
 		</File>
 		<File
 			RelativePath=".\child_process.cc"
 			>
 		</File>
 		<File
@@ -553,32 +497,16 @@
 			RelativePath=".\notification_source.h"
 			>
 		</File>
 		<File
 			RelativePath=".\notification_type.h"
 			>
 		</File>
 		<File
-			RelativePath=".\page_action.cc"
-			>
-		</File>
-		<File
-			RelativePath=".\page_action.h"
-			>
-		</File>
-		<File
-			RelativePath=".\page_transition_types.h"
-			>
-		</File>
-		<File
-			RelativePath=".\page_zoom.h"
-			>
-		</File>
-		<File
 			RelativePath=".\platform_util.h"
 			>
 		</File>
 		<File
 			RelativePath=".\platform_util_win.cc"
 			>
 		</File>
 		<File
@@ -593,40 +521,16 @@
 				/>
 			</FileConfiguration>
 		</File>
 		<File
 			RelativePath="..\tools\build\win\precompiled.h"
 			>
 		</File>
 		<File
-			RelativePath=".\pref_member.cc"
-			>
-		</File>
-		<File
-			RelativePath=".\pref_member.h"
-			>
-		</File>
-		<File
-			RelativePath=".\pref_names.cc"
-			>
-		</File>
-		<File
-			RelativePath=".\pref_names.h"
-			>
-		</File>
-		<File
-			RelativePath=".\pref_service.cc"
-			>
-		</File>
-		<File
-			RelativePath=".\pref_service.h"
-			>
-		</File>
-		<File
 			RelativePath=".\process_watcher.h"
 			>
 		</File>
 		<File
 			RelativePath=".\process_watcher_win.cc"
 			>
 		</File>
 		<File
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/extensions/url_pattern.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (c) 2006-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 "chrome/common/extensions/url_pattern.h"
-
-#include "base/string_piece.h"
-#include "base/string_util.h"
-#include "chrome/common/url_constants.h"
-
-// TODO(aa): Consider adding chrome-extension? What about more obscure ones
-// like data: and javascript: ?
-static const char* kValidSchemes[] = {
-  chrome::kHttpScheme,
-  chrome::kHttpsScheme,
-  chrome::kFileScheme,
-  chrome::kFtpScheme,
-  chrome::kChromeUIScheme,
-};
-
-static const char kPathSeparator[] = "/";
-
-static bool IsValidScheme(const std::string& scheme) {
-  for (size_t i = 0; i < arraysize(kValidSchemes); ++i) {
-    if (scheme == kValidSchemes[i])
-      return true;
-  }
-
-  return false;
-}
-
-bool URLPattern::Parse(const std::string& pattern) {
-  size_t scheme_end_pos = pattern.find(chrome::kStandardSchemeSeparator);
-  if (scheme_end_pos == std::string::npos)
-    return false;
-
-  scheme_ = pattern.substr(0, scheme_end_pos);
-  if (!IsValidScheme(scheme_))
-    return false;
-
-  size_t host_start_pos = scheme_end_pos +
-      strlen(chrome::kStandardSchemeSeparator);
-  if (host_start_pos >= pattern.length())
-    return false;
-
-  // Parse out the host and path.
-  size_t path_start_pos = 0;
-
-  // File URLs are special because they have no host. There are other schemes
-  // with the same structure, but we don't support them (yet).
-  if (scheme_ == "file") {
-    path_start_pos = host_start_pos;
-  } else {
-    size_t host_end_pos = pattern.find(kPathSeparator, host_start_pos);
-    if (host_end_pos == std::string::npos)
-      return false;
-
-    host_ = pattern.substr(host_start_pos, host_end_pos - host_start_pos);
-
-    // The first component can optionally be '*' to match all subdomains.
-    std::vector<std::string> host_components;
-    SplitString(host_, '.', &host_components);
-    if (host_components[0] == "*") {
-      match_subdomains_ = true;
-      host_components.erase(host_components.begin(),
-                            host_components.begin() + 1);
-    }
-    host_ = JoinString(host_components, '.');
-
-    // No other '*' can occur in the host, though. This isn't necessary, but is
-    // done as a convenience to developers who might otherwise be confused and
-    // think '*' works as a glob in the host.
-    if (host_.find('*') != std::string::npos)
-      return false;
-
-    path_start_pos = host_end_pos;
-  }
-
-  path_ = pattern.substr(path_start_pos);
-  return true;
-}
-
-bool URLPattern::MatchesUrl(const GURL &test) {
-  if (test.scheme() != scheme_)
-    return false;
-
-  if (!MatchesHost(test))
-    return false;
-
-  if (!MatchesPath(test))
-    return false;
-
-  return true;
-}
-
-bool URLPattern::MatchesHost(const GURL& test) {
-  if (test.host() == host_)
-    return true;
-
-  if (!match_subdomains_ || test.HostIsIPAddress())
-    return false;
-
-  // If we're matching subdomains, and we have no host, that means the pattern
-  // was <scheme>://*/<whatever>, so we match anything.
-  if (host_.empty())
-    return true;
-
-  // Check if the test host is a subdomain of our host.
-  if (test.host().length() <= (host_.length() + 1))
-    return false;
-
-  if (test.host().compare(test.host().length() - host_.length(),
-                          host_.length(), host_) != 0)
-    return false;
-
-  return test.host()[test.host().length() - host_.length() - 1] == '.';
-}
-
-bool URLPattern::MatchesPath(const GURL& test) {
-  if (path_escaped_.empty()) {
-    path_escaped_ = path_;
-    ReplaceSubstringsAfterOffset(&path_escaped_, 0, "\\", "\\\\");
-    ReplaceSubstringsAfterOffset(&path_escaped_, 0, "?", "\\?");
-  }
-
-  if (!MatchPattern(test.PathForRequest(), path_escaped_))
-    return false;
-
-  return true;
-}
-
-std::string URLPattern::GetAsString() const {
-  std::string spec = scheme_ + chrome::kStandardSchemeSeparator;
-
-  if (match_subdomains_) {
-    spec += "*";
-    if (!host_.empty())
-      spec += ".";
-  }
-
-  if (!host_.empty())
-    spec += host_;
-
-  if (!path_.empty())
-    spec += path_;
-
-  return spec;
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/extensions/url_pattern.h
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2006-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 CHROME_BROWSER_EXTENSIONS_MATCH_PATTERN_H_
-#define CHROME_BROWSER_EXTENSIONS_MATCH_PATTERN_H_
-
-#include "googleurl/src/gurl.h"
-
-// A pattern that can be used to match URLs. A URLPattern is a very restricted
-// subset of URL syntax:
-//
-// <url-pattern> := <scheme>://<host><path>
-// <scheme> := 'http' | 'https' | 'file' | 'ftp' | 'chrome'
-// <host> := '*' | '*.' <anychar except '/' and '*'>+
-// <path> := '/' <any chars>
-//
-// * Host is not used when the scheme is 'file'.
-// * The path can have embedded '*' characters which act as glob wildcards.
-//
-// Examples of valid patterns:
-// - http://*/*
-// - http://*/foo*
-// - https://*.google.com/foo*bar
-// - chrome://foo/bar
-// - file://monkey*
-// - http://127.0.0.1/*
-//
-// Examples of invalid patterns:
-// - http://* -- path not specified
-// - http://*foo/bar -- * not allowed as substring of host component
-// - http://foo.*.bar/baz -- * must be first component
-// - http:/bar -- scheme separator not found
-// - foo://* -- invalid scheme
-//
-// Design rationale:
-// * We need to be able to tell users what 'sites' a given URLPattern will
-//   affect. For example "This extension will interact with the site
-//   'www.google.com'.
-// * We'd like to be able to convert as many existing Greasemonkey @include
-//   patterns to URLPatterns as possible. Greasemonkey @include patterns are
-//   simple globs, so this won't be perfect.
-// * Although we would like to support any scheme, it isn't clear what to tell
-//   users about URLPatterns that affect data or javascript URLs, and saying
-//   something useful about chrome-extension URLs is more work, so those are
-//   left out for now.
-//
-// From a 2008-ish crawl of userscripts.org, the following patterns were found
-// in @include lines:
-// - total lines                    : 24471
-// - @include *                     :   919
-// - @include http://[^\*]+?/       : 11128 (no star in host)
-// - @include http://\*\.[^\*]+?/   :  2325 (host prefixed by *.)
-// - @include http://\*[^\.][^\*]+?/:  1524 (host prefixed by *, no dot -- many
-//                                           appear to only need subdomain
-//                                           matching, not real prefix matching)
-// - @include http://[^\*/]+\*/     :   320 (host suffixed by *)
-// - @include contains .tld         :   297 (host suffixed by .tld -- a special
-//                                           Greasemonkey domain component that
-//                                           tries to match all valid registry-
-//                                           controlled suffixes)
-// - @include http://\*/            :   228 (host is * exactly, but there is
-//                                           more to the pattern)
-//
-// So, we can support at least half of current @include lines without supporting
-// subdomain matching. We can pick up at least another 10% by supporting
-// subdomain matching. It is probably possible to coerce more of the existing
-// patterns to URLPattern, but the resulting pattern will be more restrictive
-// than the original glob, which is probably better than nothing.
-class URLPattern {
- public:
-  URLPattern() : match_subdomains_(false) {}
-
-  // Initializes this instance by parsing the provided string. On failure, the
-  // instance will have some intermediate values and is in an invalid state.
-  bool Parse(const std::string& pattern_str);
-
-  // Returns true if this instance matches the specified URL.
-  bool MatchesUrl(const GURL& url);
-
-  std::string GetAsString() const;
-
-  // Get the scheme the pattern matches. This will always return a valid scheme
-  // if is_valid() returns true.
-  std::string scheme() const { return scheme_; }
-
-  // Gets the host the pattern matches. This can be an empty string if the
-  // pattern matches all hosts (the input was <scheme>://*/<whatever>).
-  std::string host() const { return host_; }
-
-  // Gets whether to match subdomains of host().
-  bool match_subdomains() const { return match_subdomains_; }
-
-  // Gets the path the pattern matches with the leading slash. This can have
-  // embedded asterisks which are interpreted using glob rules.
-  std::string path() const { return path_; }
-
- private:
-  // Returns true if |test| matches our host.
-  bool MatchesHost(const GURL& test);
-
-  // Returns true if |test| matches our path.
-  bool MatchesPath(const GURL& test);
-
-  // The scheme for the pattern.
-  std::string scheme_;
-
-  // The host without any leading "*" components.
-  std::string host_;
-
-  // Whether we should match subdomains of the host. This is true if the first
-  // component of the pattern's host was "*".
-  bool match_subdomains_;
-
-  // The path to match. This is everything after the host of the URL, or
-  // everything after the scheme in the case of file:// URLs.
-  std::string path_;
-
-  // The path with "?" and "\" characters escaped for use with the
-  // MatchPattern() function. This is populated lazily, the first time it is
-  // needed.
-  std::string path_escaped_;
-};
-
-#endif  // CHROME_BROWSER_EXTENSIONS_MATCH_PATTERN_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/extensions/url_pattern_unittest.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) 2006-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 "chrome/common/extensions/url_pattern.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-// See url_pattern.h for examples of valid and invalid patterns.
-
-TEST(URLPatternTest, ParseInvalid) {
-  const char* kInvalidPatterns[] = {
-    "http",  // no scheme
-    "http://",  // no path separator
-    "http://foo",  // no path separator
-    "http://*foo/bar",  // not allowed as substring of host component
-    "http://foo.*.bar/baz",  // must be first component
-    "http:/bar",  // scheme separator not found
-    "foo://*",  // invalid scheme
-  };
-
-  for (size_t i = 0; i < arraysize(kInvalidPatterns); ++i) {
-    URLPattern pattern;
-    EXPECT_FALSE(pattern.Parse(kInvalidPatterns[i]));
-  }
-};
-
-// all pages for a given scheme
-TEST(URLPatternTest, Match1) {
-  URLPattern pattern;
-  EXPECT_TRUE(pattern.Parse("http://*/*"));
-  EXPECT_EQ("http", pattern.scheme());
-  EXPECT_EQ("", pattern.host());
-  EXPECT_TRUE(pattern.match_subdomains());
-  EXPECT_EQ("/*", pattern.path());
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("http://google.com")));
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("http://yahoo.com")));
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("http://google.com/foo")));
-  EXPECT_FALSE(pattern.MatchesUrl(GURL("https://google.com")));
-}
-
-// all domains
-TEST(URLPatternTest, Match2) {
-  URLPattern pattern;
-  EXPECT_TRUE(pattern.Parse("https://*/foo*"));
-  EXPECT_EQ("https", pattern.scheme());
-  EXPECT_EQ("", pattern.host());
-  EXPECT_TRUE(pattern.match_subdomains());
-  EXPECT_EQ("/foo*", pattern.path());
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("https://www.google.com/foo")));
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("https://www.google.com/foobar")));
-  EXPECT_FALSE(pattern.MatchesUrl(GURL("http://www.google.com/foo")));
-  EXPECT_FALSE(pattern.MatchesUrl(GURL("https://www.google.com/")));
-}
-
-// subdomains
-TEST(URLPatternTest, Match3) {
-  URLPattern pattern;
-  EXPECT_TRUE(pattern.Parse("http://*.google.com/foo*bar"));
-  EXPECT_EQ("http", pattern.scheme());
-  EXPECT_EQ("google.com", pattern.host());
-  EXPECT_TRUE(pattern.match_subdomains());
-  EXPECT_EQ("/foo*bar", pattern.path());
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("http://google.com/foobar")));
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("http://www.google.com/foo?bar")));
-  EXPECT_TRUE(pattern.MatchesUrl(
-      GURL("http://monkey.images.google.com/foooobar")));
-  EXPECT_FALSE(pattern.MatchesUrl(GURL("http://yahoo.com/foobar")));
-}
-
-// odd schemes and normalization
-TEST(URLPatternTest, Match4) {
-  URLPattern pattern;
-  EXPECT_TRUE(pattern.Parse("chrome://thinger/*"));
-  EXPECT_EQ("chrome", pattern.scheme());
-  EXPECT_EQ("thinger", pattern.host());
-  EXPECT_FALSE(pattern.match_subdomains());
-  EXPECT_EQ("/*", pattern.path());
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("chrome://thinger/foobar")));
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("CHROME://thinger/")));
-  EXPECT_FALSE(pattern.MatchesUrl(GURL("http://thinger/")));
-}
-
-// glob escaping
-TEST(URLPatternTest, Match5) {
-  URLPattern pattern;
-  EXPECT_TRUE(pattern.Parse("file:///foo?bar\\*baz"));
-  EXPECT_EQ("file", pattern.scheme());
-  EXPECT_EQ("", pattern.host());
-  EXPECT_FALSE(pattern.match_subdomains());
-  EXPECT_EQ("/foo?bar\\*baz", pattern.path());
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("file:///foo?bar\\hellobaz")));
-  EXPECT_FALSE(pattern.MatchesUrl(GURL("file:///fooXbar\\hellobaz")));
-}
-
-// ip addresses
-TEST(URLPatternTest, Match6) {
-  URLPattern pattern;
-  EXPECT_TRUE(pattern.Parse("http://127.0.0.1/*"));
-  EXPECT_EQ("http", pattern.scheme());
-  EXPECT_EQ("127.0.0.1", pattern.host());
-  EXPECT_FALSE(pattern.match_subdomains());
-  EXPECT_EQ("/*", pattern.path());
-  EXPECT_TRUE(pattern.MatchesUrl(GURL("http://127.0.0.1")));
-}
-
-// subdomain matching with ip addresses
-TEST(URLPatternTest, Match7) {
-  URLPattern pattern;
-  EXPECT_TRUE(pattern.Parse("http://*.0.0.1/*")); // allowed, but useless
-  EXPECT_EQ("http", pattern.scheme());
-  EXPECT_EQ("0.0.1", pattern.host());
-  EXPECT_TRUE(pattern.match_subdomains());
-  EXPECT_EQ("/*", pattern.path());
-  // Subdomain matching is never done if the argument has an IP address host.
-  EXPECT_FALSE(pattern.MatchesUrl(GURL("http://127.0.0.1")));
-};
-
-// unicode
-TEST(URLPatternTest, Match8) {
-  URLPattern pattern;
-  // The below is the ASCII encoding of the following URL:
-  // http://*.\xe1\x80\xbf/a\xc2\x81\xe1*
-  EXPECT_TRUE(pattern.Parse("http://*.xn--gkd/a%C2%81%E1*"));
-  EXPECT_EQ("http", pattern.scheme());
-  EXPECT_EQ("xn--gkd", pattern.host());
-  EXPECT_TRUE(pattern.match_subdomains());
-  EXPECT_EQ("/a%C2%81%E1*", pattern.path());
-  EXPECT_TRUE(pattern.MatchesUrl(
-      GURL("http://abc.\xe1\x80\xbf/a\xc2\x81\xe1xyz")));
-  EXPECT_TRUE(pattern.MatchesUrl(
-      GURL("http://\xe1\x80\xbf/a\xc2\x81\xe1\xe1")));
-};
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/extensions/user_script.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 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 "chrome/common/extensions/user_script.h"
-
-#include "base/pickle.h"
-#include "base/string_util.h"
-
-bool UserScript::MatchesUrl(const GURL& url) {
-  for (std::vector<std::string>::const_iterator glob = globs_.begin();
-       glob != globs_.end(); ++glob) {
-    if (MatchPattern(url.spec(), *glob))
-      return true;
-  }
-
-  for (std::vector<URLPattern>::iterator pattern = url_patterns_.begin();
-       pattern != url_patterns_.end(); ++pattern) {
-    if (pattern->MatchesUrl(url))
-      return true;
-  }
-
-  return false;
-}
-
-void UserScript::File::Pickle(::Pickle* pickle) const {
-  pickle->WriteString(url_.spec());
-  // Do not write path. It's not needed in the renderer.
-  // Do not write content. It will be serialized by other means.
-}
-
-void UserScript::File::Unpickle(const ::Pickle& pickle, void** iter) {
-  // Read url.
-  std::string url;
-  CHECK(pickle.ReadString(iter, &url));
-  set_url(GURL(url));
-}
-
-void UserScript::Pickle(::Pickle* pickle) const {
-  // Write the run location.
-  pickle->WriteInt(run_location());
-
-  // Write the extension id.
-  pickle->WriteString(extension_id());
-
-  // Write globs.
-  pickle->WriteSize(globs_.size());
-  for (std::vector<std::string>::const_iterator glob = globs_.begin();
-       glob != globs_.end(); ++glob) {
-    pickle->WriteString(*glob);
-  }
-
-  // Write url patterns.
-  pickle->WriteSize(url_patterns_.size());
-  for (std::vector<URLPattern>::const_iterator pattern = url_patterns_.begin();
-       pattern != url_patterns_.end(); ++pattern) {
-    pickle->WriteString(pattern->GetAsString());
-  }
-
-  // Write js scripts.
-  pickle->WriteSize(js_scripts_.size());
-  for (FileList::const_iterator file = js_scripts_.begin();
-    file != js_scripts_.end(); ++file) {
-    file->Pickle(pickle);
-  }
-
-  // Write css scripts.
-  pickle->WriteSize(css_scripts_.size());
-  for (FileList::const_iterator file = css_scripts_.begin();
-    file != css_scripts_.end(); ++file) {
-    file->Pickle(pickle);
-  }
-}
-
-void UserScript::Unpickle(const ::Pickle& pickle, void** iter) {
-  // Read the run location.
-  int run_location = 0;
-  CHECK(pickle.ReadInt(iter, &run_location));
-  CHECK(run_location >= 0 && run_location < RUN_LOCATION_LAST);
-  run_location_ = static_cast<RunLocation>(run_location);
-
-  // Read the extension ID.
-  CHECK(pickle.ReadString(iter, &extension_id_));
-
-  // Read globs.
-  size_t num_globs = 0;
-  CHECK(pickle.ReadSize(iter, &num_globs));
-
-  globs_.clear();
-  for (size_t i = 0; i < num_globs; ++i) {
-    std::string glob;
-    CHECK(pickle.ReadString(iter, &glob));
-    globs_.push_back(glob);
-  }
-
-  // Read url patterns.
-  size_t num_patterns = 0;
-  CHECK(pickle.ReadSize(iter, &num_patterns));
-
-  url_patterns_.clear();
-  for (size_t i = 0; i < num_patterns; ++i) {
-    std::string pattern_str;
-    URLPattern pattern;
-    CHECK(pickle.ReadString(iter, &pattern_str));
-    CHECK(pattern.Parse(pattern_str));
-    url_patterns_.push_back(pattern);
-  }
-
-  // Read js scripts.
-  size_t num_js_files = 0;
-  CHECK(pickle.ReadSize(iter, &num_js_files));
-  js_scripts_.clear();
-  for (size_t i = 0; i < num_js_files; ++i) {
-    File file;
-    file.Unpickle(pickle, iter);
-    js_scripts_.push_back(file);
-  }
-
-  // Read css scripts.
-  size_t num_css_files = 0;
-  CHECK(pickle.ReadSize(iter, &num_css_files));
-  css_scripts_.clear();
-  for (size_t i = 0; i < num_css_files; ++i) {
-    File file;
-    file.Unpickle(pickle, iter);
-    css_scripts_.push_back(file);
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/extensions/user_script.h
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 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 CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_
-#define CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_
-
-#include <vector>
-#include <string>
-
-#include "base/file_path.h"
-#include "base/string_piece.h"
-#include "chrome/common/extensions/url_pattern.h"
-#include "googleurl/src/gurl.h"
-
-class Pickle;
-
-// Represents a user script, either a standalone one, or one that is part of an
-// extension.
-class UserScript {
- public:
-  // Locations that user scripts can be run inside the document.
-  enum RunLocation {
-    DOCUMENT_START,  // After the documentElemnet is created, but before
-                     // anything else happens.
-    DOCUMENT_END,  // After the entire document is parsed. Same as
-                   // DOMContentLoaded.
-
-    RUN_LOCATION_LAST  // Leave this as the last item.
-  };
-
-  // Holds actual script file info.
-  class File {
-   public:
-    File(const FilePath& path, const GURL& url):
-         path_(path),
-         url_(url) {
-    }
-    File() {}
-
-    const FilePath& path() const { return path_; }
-    void set_path(const FilePath& path) { path_ = path; }
-
-    const GURL& url() const { return url_; }
-    void set_url(const GURL& url) { url_ = url; }
-
-    // If external_content_ is set returns it as content otherwise it returns
-    // content_
-    const StringPiece GetContent() const {
-      if (external_content_.data())
-        return external_content_;
-      else
-        return content_;
-    }
-    void set_external_content(const StringPiece& content) {
-      external_content_ = content;
-    }
-    const void set_content(const StringPiece& content) {
-      content_.assign(content.begin(), content.end());
-    }
-
-    // Serialization support. The content and path_ member will not be
-    // serialized!
-    void Pickle(::Pickle* pickle) const;
-    void Unpickle(const ::Pickle& pickle, void** iter);
-
-   private:
-    // Where is the script file lives on the disk.
-    FilePath path_;
-
-    // The url to this scipt file.
-    GURL url_;
-
-    // The script content. It can be set to either loaded_content_ or
-    // externally allocated string.
-    StringPiece external_content_;
-
-    // Set when the content is loaded by LoadContent
-    std::string content_;
-  };
-
-  typedef std::vector<File> FileList;
-
-  // Constructor. Default the run location to document end, which is like
-  // Greasemonkey and probably more useful for typical scripts.
-  UserScript() : run_location_(DOCUMENT_END) {}
-
-  // The place in the document to run the script.
-  RunLocation run_location() const { return run_location_; }
-  void set_run_location(RunLocation location) { run_location_ = location; }
-
-  // The globs, if any, that determine which pages this script runs against.
-  // These are only used with "standalone" Greasemonkey-like user scripts.
-  const std::vector<std::string>& globs() const { return globs_; }
-  void add_glob(const std::string& glob) { globs_.push_back(glob); }
-  void clear_globs() { globs_.clear(); }
-
-  // The URLPatterns, if any, that determine which pages this script runs
-  // against.
-  const std::vector<URLPattern>& url_patterns() const { return url_patterns_; }
-  void add_url_pattern(const URLPattern& pattern) {
-    url_patterns_.push_back(pattern);
-  }
-  void clear_url_patterns() { url_patterns_.clear(); }
-
-  // List of js scripts for this user script
-  FileList& js_scripts() { return js_scripts_; }
-  const FileList& js_scripts() const { return js_scripts_; }
-
-  // List of css scripts for this user script
-  FileList& css_scripts() { return css_scripts_; }
-  const FileList& css_scripts() const { return css_scripts_; }
-
-  const std::string& extension_id() const { return extension_id_; }
-  void set_extension_id(const std::string& id) { extension_id_ = id; }
-
-  bool is_standalone() { return extension_id_.empty(); }
-
-  // Returns true if the script should be applied to the specified URL, false
-  // otherwise.
-  bool MatchesUrl(const GURL& url);
-
-  // Serialize the UserScript into a pickle. The content of the scripts and
-  // paths to UserScript::Files will not be serialized!
-  void Pickle(::Pickle* pickle) const;
-
-  // Deserialize the script from a pickle. Note that this always succeeds
-  // because presumably we were the one that pickled it, and we did it
-  // correctly.
-  void Unpickle(const ::Pickle& pickle, void** iter);
-
- private:
-  // The location to run the script inside the document.
-  RunLocation run_location_;
-
-  // Greasemonkey-style globs that determine pages to inject the script into.
-  // These are only used with standalone scripts.
-  std::vector<std::string> globs_;
-
-  // URLPatterns that determine pages to inject the script into. These are
-  // only used with scripts that are part of extensions.
-  std::vector<URLPattern> url_patterns_;
-
-  // List of js scripts defined in content_scripts
-  FileList js_scripts_;
-
-  // List of css scripts defined in content_scripts
-  FileList css_scripts_;
-
-  // The ID of the extension this script is a part of, if any. Can be empty if
-  // the script is a "standlone" user script.
-  std::string extension_id_;
-};
-
-typedef std::vector<UserScript> UserScriptList;
-
-#endif  // CHROME_COMMON_EXTENSIONS_USER_SCRIPT_H_
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/extensions/user_script_unittest.cc
+++ /dev/null
@@ -1,123 +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/file_path.h"
-#include "base/pickle.h"
-#include "chrome/common/extensions/user_script.h"
-#include "googleurl/src/gurl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(UserScriptTest, Match1) {
-  UserScript script;
-  script.add_glob("*mail.google.com*");
-  script.add_glob("*mail.yahoo.com*");
-  script.add_glob("*mail.msn.com*");
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.google.com")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.google.com/foo")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("https://mail.google.com/foo")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("ftp://mail.google.com/foo")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://woo.mail.google.com/foo")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.yahoo.com/bar")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.msn.com/baz")));
-  EXPECT_FALSE(script.MatchesUrl(GURL("http://www.hotmail.com")));
-}
-
-TEST(UserScriptTest, Match2) {
-  UserScript script;
-  script.add_glob("*mail.google.com/");
-  // GURL normalizes the URL to have a trailing "/"
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.google.com")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.google.com/")));
-  EXPECT_FALSE(script.MatchesUrl(GURL("http://mail.google.com/foo")));
-}
-
-TEST(UserScriptTest, Match3) {
-  UserScript script;
-  script.add_glob("http://mail.google.com/*");
-  // GURL normalizes the URL to have a trailing "/"
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.google.com")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://mail.google.com/foo")));
-  EXPECT_FALSE(script.MatchesUrl(GURL("https://mail.google.com/foo")));
-}
-
-TEST(UserScriptTest, Match4) {
-  UserScript script;
-  script.add_glob("*");
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://foo.com/bar")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://hot.com/dog")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("https://hot.com/dog")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("file:///foo/bar")));
-}
-
-TEST(UserScriptTest, Match5) {
-  UserScript script;
-  script.add_glob("*foo*");
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://foo.com/bar")));
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://baz.org/foo/bar")));
-  EXPECT_FALSE(script.MatchesUrl(GURL("http://baz.org")));
-}
-
-TEST(UserScriptTest, Match6) {
-  URLPattern pattern;
-  ASSERT_TRUE(pattern.Parse("http://*/foo*"));
-
-  UserScript script;
-  script.add_url_pattern(pattern);
-  EXPECT_TRUE(script.MatchesUrl(GURL("http://monkey.com/foobar")));
-  EXPECT_FALSE(script.MatchesUrl(GURL("http://monkey.com/hotdog")));
-
-  // NOTE: URLPattern is tested more extensively in url_pattern_unittest.cc.
-}
-
-TEST(UserScriptTest, Pickle) {
-  URLPattern pattern1;
-  URLPattern pattern2;
-  ASSERT_TRUE(pattern1.Parse("http://*/foo*"));
-  ASSERT_TRUE(pattern2.Parse("http://bar/baz*"));
-
-  UserScript script1;
-  script1.js_scripts().push_back(UserScript::File(
-      FilePath(FILE_PATH_LITERAL("c:\\foo\\foo.user.js")),
-      GURL("chrome-user-script:/foo.user.js")));
-  script1.css_scripts().push_back(UserScript::File(
-      FilePath(FILE_PATH_LITERAL("c:\\foo\\foo.user.css")),
-      GURL("chrome-user-script:/foo.user.css")));
-  script1.css_scripts().push_back(UserScript::File(
-      FilePath(FILE_PATH_LITERAL("c:\\foo\\foo2.user.css")),
-      GURL("chrome-user-script:/foo2.user.css")));
-  script1.set_run_location(UserScript::DOCUMENT_START);
-
-  script1.add_url_pattern(pattern1);
-  script1.add_url_pattern(pattern2);
-
-  Pickle pickle;
-  script1.Pickle(&pickle);
-
-  void* iter = NULL;
-  UserScript script2;
-  script2.Unpickle(pickle, &iter);
-
-  EXPECT_EQ(1U, script2.js_scripts().size());
-  EXPECT_EQ(script1.js_scripts()[0].url(), script2.js_scripts()[0].url());
-
-  EXPECT_EQ(2U, script2.css_scripts().size());
-  for (size_t i = 0; i < script2.js_scripts().size(); ++i) {
-    EXPECT_EQ(script1.css_scripts()[i].url(), script2.css_scripts()[i].url());
-  }
-
-  ASSERT_EQ(script1.globs().size(), script2.globs().size());
-  for (size_t i = 0; i < script1.globs().size(); ++i) {
-    EXPECT_EQ(script1.globs()[i], script2.globs()[i]);
-  }
-  ASSERT_EQ(script1.url_patterns().size(), script2.url_patterns().size());
-  for (size_t i = 0; i < script1.url_patterns().size(); ++i) {
-    EXPECT_EQ(script1.url_patterns()[i].GetAsString(),
-              script2.url_patterns()[i].GetAsString());
-  }
-}
-
-TEST(UserScriptTest, Defaults) {
-  UserScript script;
-  ASSERT_EQ(UserScript::DOCUMENT_END, script.run_location());
-}
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/gfx/DEPS
+++ /dev/null
@@ -1,7 +0,0 @@
-include_rules = [
-  "+skia/include",
-  "+skia/ext",
-
-  # FIXME - refactor code and remove these dependencies
-  "+chrome/views",
-];
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/gfx/color_utils.cc
+++ /dev/null
@@ -1,268 +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"
-
-#include <math.h>
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
-
-#include "chrome/common/gfx/color_utils.h"
-
-#include "base/basictypes.h"
-#include "base/logging.h"
-#include "skia/include/SkBitmap.h"
-
-#if defined(OS_WIN)
-#include "skia/ext/skia_utils_win.h"
-#endif
-
-namespace color_utils {
-
-// These transformations are based on the equations in:
-// http://en.wikipedia.org/wiki/Lab_color
-// http://en.wikipedia.org/wiki/SRGB_color_space#Specification_of_the_transformation
-// See also:
-// http://www.brucelindbloom.com/index.html?ColorCalculator.html
-
-static const double kCIEConversionAlpha = 0.055;
-static const double kCIEConversionGamma = 2.2;
-static const double kE = 0.008856;
-static const double kK = 903.3;
-
-static double CIEConvertNonLinear(uint8_t color_component) {
-  double color_component_d = static_cast<double>(color_component) / 255.0;
-  if (color_component_d > 0.04045) {
-    double base = (color_component_d + kCIEConversionAlpha) /
-                      (1 + kCIEConversionAlpha);
-    return pow(base, kCIEConversionGamma);
-  } else {
-    return color_component_d / 12.92;
-  }
-}
-
-// Note: this works only for sRGB.
-void SkColorToCIEXYZ(SkColor c, CIE_XYZ* xyz) {
-  uint8_t r = SkColorGetR(c);
-  uint8_t g = SkColorGetG(c);
-  uint8_t b = SkColorGetB(c);
-
-  xyz->X =
-    0.4124 * CIEConvertNonLinear(r) +
-    0.3576 * CIEConvertNonLinear(g) +
-    0.1805 * CIEConvertNonLinear(b);
-  xyz->Y =
-    0.2126 * CIEConvertNonLinear(r) +
-    0.7152 * CIEConvertNonLinear(g) +
-    0.0722 * CIEConvertNonLinear(g);
-  xyz->Z =
-    0.0193 * CIEConvertNonLinear(r) +
-    0.1192 * CIEConvertNonLinear(g) +
-    0.9505 * CIEConvertNonLinear(b);
-}
-
-static double LabConvertNonLinear(double value) {
-  if (value > 0.008856) {
-    double goat = pow(value, static_cast<double>(1) / 3);
-    return goat;
-  }
-  return (kK * value + 16) / 116;
-}
-
-void CIEXYZToLabColor(const CIE_XYZ& xyz, LabColor* lab) {
-  CIE_XYZ white_xyz;
-  SkColorToCIEXYZ(SkColorSetRGB(255, 255, 255), &white_xyz);
-  double fx = LabConvertNonLinear(xyz.X / white_xyz.X);
-  double fy = LabConvertNonLinear(xyz.Y / white_xyz.Y);
-  double fz = LabConvertNonLinear(xyz.Z / white_xyz.Z);
-  lab->L = static_cast<int>(116 * fy) - 16;
-  lab->a = static_cast<int>(500 * (fx - fy));
-  lab->b = static_cast<int>(200 * (fy - fz));
-}
-
-static uint8_t sRGBColorComponentFromLinearComponent(double component) {
-  double result;
-  if (component <= 0.0031308) {
-    result = 12.92 * component;
-  } else {
-    result = (1 + kCIEConversionAlpha) *
-                 pow(component, (static_cast<double>(1) / 2.4)) -
-                 kCIEConversionAlpha;
-  }
-  return std::min(static_cast<uint8_t>(255), static_cast<uint8_t>(result * 255));
-}
-
-SkColor CIEXYZToSkColor(SkAlpha alpha, const CIE_XYZ& xyz) {
-  double r_linear = 3.2410 * xyz.X - 1.5374 * xyz.Y - 0.4986 * xyz.Z;
-  double g_linear = -0.9692 * xyz.X + 1.8760 * xyz.Y + 0.0416 * xyz.Z;
-  double b_linear = 0.0556 * xyz.X - 0.2040 * xyz.Y + 1.0570 * xyz.Z;
-  uint8_t r = sRGBColorComponentFromLinearComponent(r_linear);
-  uint8_t g = sRGBColorComponentFromLinearComponent(g_linear);
-  uint8_t b = sRGBColorComponentFromLinearComponent(b_linear);
-  return SkColorSetARGB(alpha, r, g, b);
-}
-
-static double gen_yr(const LabColor& lab) {
-  if (lab.L > (kE * kK))
-    return pow((lab.L + 16.0) / 116, 3.0);
-  return static_cast<double>(lab.L) / kK;
-}
-
-static double fy(const LabColor& lab) {
-  double yr = gen_yr(lab);
-  if (yr > kE)
-    return (lab.L + 16.0) / 116;
-  return (kK * yr + 16.0) / 116;
-}
-
-static double fx(const LabColor& lab) {
-  return (static_cast<double>(lab.a) / 500) + fy(lab);
-}
-
-static double gen_xr(const LabColor& lab) {
-  double x = fx(lab);
-  double x_cubed = pow(x, 3.0);
-  if (x_cubed > kE)
-    return x_cubed;
-  return (116.0 * x - 16.0) / kK;
-}
-
-static double fz(const LabColor& lab) {
-  return fy(lab) - (static_cast<double>(lab.b) / 200);
-}
-
-static double gen_zr(const LabColor& lab) {
-  double z = fz(lab);
-  double z_cubed = pow(z, 3.0);
-  if (z_cubed > kE)
-    return z_cubed;
-  return (116.0 * z - 16.0) / kK;
-}
-
-void LabColorToCIEXYZ(const LabColor& lab, CIE_XYZ* xyz) {
-  CIE_XYZ result;
-
-  CIE_XYZ white_xyz;
-  SkColorToCIEXYZ(SkColorSetRGB(255, 255, 255), &white_xyz);
-
-  result.X = gen_xr(lab) * white_xyz.X;
-  result.Y = gen_yr(lab) * white_xyz.Y;
-  result.Z = gen_zr(lab) * white_xyz.Z;
-
-  *xyz = result;
-}
-
-void SkColorToLabColor(SkColor c, LabColor* lab) {
-  CIE_XYZ xyz;
-  SkColorToCIEXYZ(c, &xyz);
-  CIEXYZToLabColor(xyz, lab);
-}
-
-SkColor LabColorToSkColor(const LabColor& lab, SkAlpha alpha) {
-  CIE_XYZ xyz;
-  LabColorToCIEXYZ(lab, &xyz);
-  return CIEXYZToSkColor(alpha, xyz);
-}
-
-static const int kCloseToBoundary = 64;
-static const int kAverageBoundary = 15;
-
-bool IsColorCloseToTransparent(SkAlpha alpha) {
-  return alpha < kCloseToBoundary;
-}
-
-bool IsColorCloseToGrey(int r, int g, int b) {
-  int average = (r + g + b) / 3;
-  return (abs(r - average) < kAverageBoundary) &&
-         (abs(g - average) < kAverageBoundary) &&
-         (abs(b - average) < kAverageBoundary);
-}
-
-SkColor GetAverageColorOfFavicon(SkBitmap* favicon, SkAlpha alpha) {
-  int r = 0, g = 0, b = 0;
-
-  SkAutoLockPixels favicon_lock(*favicon);
-  SkColor* pixels = static_cast<SkColor*>(favicon->getPixels());
-  // Assume ARGB_8888 format.
-  DCHECK(favicon->getConfig() == SkBitmap::kARGB_8888_Config);
-  SkColor* current_color = pixels;
-
-  DCHECK(favicon->width() <= 16 && favicon->height() <= 16);
-
-  int pixel_count = favicon->width() * favicon->height();
-  int color_count = 0;
-  for (int i = 0; i < pixel_count; ++i, ++current_color) {
-    // Disregard this color if it is close to black, close to white, or close
-    // to transparent since any of those pixels do not contribute much to the
-    // color makeup of this icon.
-    int cr = SkColorGetR(*current_color);
-    int cg = SkColorGetG(*current_color);
-    int cb = SkColorGetB(*current_color);
-
-    if (IsColorCloseToTransparent(SkColorGetA(*current_color)) ||
-        IsColorCloseToGrey(cr, cg, cb))
-      continue;
-
-    r += cr;
-    g += cg;
-    b += cb;
-    ++color_count;
-  }
-
-  SkColor result;
-  if (color_count > 0) {
-    result = SkColorSetARGB(alpha,
-                            r / color_count,
-                            g / color_count,
-                            b / color_count);
-  } else {
-    result = SkColorSetARGB(alpha, 0, 0, 0);
-  }
-  return result;
-}
-
-inline int GetLumaForColor(SkColor* color) {
-  int r = SkColorGetR(*color);
-  int g = SkColorGetG(*color);
-  int b = SkColorGetB(*color);
-
-  int luma = static_cast<int>(0.3*r + 0.59*g + 0.11*b);
-  if (luma < 0)
-    luma = 0;
-  else if (luma > 255)
-    luma = 255;
-
-  return luma;
-}
-
-void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]) {
-  SkAutoLockPixels bitmap_lock(*bitmap);
-  // Assume ARGB_8888 format.
-  DCHECK(bitmap->getConfig() == SkBitmap::kARGB_8888_Config);
-
-  int pixel_width = bitmap->width();
-  int pixel_height = bitmap->height();
-  for (int y = 0; y < pixel_height; ++y) {
-    SkColor* current_color = static_cast<uint32_t*>(bitmap->getAddr32(0, y));
-    for (int x = 0; x < pixel_width; ++x, ++current_color) {
-      histogram[GetLumaForColor(current_color)]++;
-    }
-  }
-}
-
-SkColor SetColorAlpha(SkColor c, SkAlpha alpha) {
-  return SkColorSetARGB(alpha, SkColorGetR(c), SkColorGetG(c), SkColorGetB(c));
-}
-
-SkColor GetSysSkColor(int which) {
-#if defined(OS_WIN)
-  return skia::COLORREFToSkColor(::GetSysColor(which));
-#else
-  NOTIMPLEMENTED();
-  return SK_ColorLTGRAY;
-#endif
-}
-
-} // namespace color_utils
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/gfx/color_utils.h
+++ /dev/null
@@ -1,63 +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 CHROME_COMMON_GFX_COLOR_UTILS_H__
-#define CHROME_COMMON_GFX_COLOR_UTILS_H__
-
-#include "SkColor.h"
-
-class SkBitmap;
-
-namespace color_utils {
-
-// Represents set of CIE XYZ tristimulus values.
-struct CIE_XYZ {
-  double X;
-  double Y; // luminance
-  double Z;
-};
-
-// Represents a L*a*b* color value
-struct LabColor {
-  int L;
-  int a;
-  int b;
-};
-
-// Note: these transformations assume sRGB as the source color space
-
-// Convert between different color spaces
-void SkColorToCIEXYZ(SkColor c, CIE_XYZ* xyz);
-void CIEXYZToLabColor(const CIE_XYZ& xyz, LabColor* lab);
-
-SkColor CIEXYZToSkColor(SkAlpha alpha, const CIE_XYZ& xyz);
-void LabColorToCIEXYZ(const LabColor& lab, CIE_XYZ* xyz);
-
-void SkColorToLabColor(SkColor c, LabColor* lab);
-SkColor LabColorToSkColor(const LabColor& lab, SkAlpha alpha);
-
-// Determine if a given alpha value is nearly completely transparent.
-bool IsColorCloseToTransparent(SkAlpha alpha);
-
-// Determine if a color is near grey.
-bool IsColorCloseToGrey(int r, int g, int b);
-
-// Gets a color representing a bitmap. The definition of "representing" is the
-// average color in the bitmap. The color returned is modified to have the
-// specified alpha.
-SkColor GetAverageColorOfFavicon(SkBitmap* bitmap, SkAlpha alpha);
-
-// Builds a histogram based on the Y' of the Y'UV representation of
-// this image.
-void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]);
-
-// Create a color from a base color and a specific alpha value.
-SkColor SetColorAlpha(SkColor c, SkAlpha alpha);
-
-// Gets a Windows system color as a SkColor
-SkColor GetSysSkColor(int which);
-
-} // namespace color_utils
-
-#endif  // #ifndef CHROME_COMMON_GFX_COLOR_UTILS_H__
deleted file mode 100644
--- a/ipc/chromium/src/chrome/common/gfx/emf.cc
+++ /dev/null
@@ -1,317 +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 "chrome/common/gfx/emf.h"
-
-#include "base/gfx/rect.h"
-#include "base/logging.h"
-
-namespace gfx {
-
-Emf::Emf() : emf_(NULL), hdc_(NULL) {
-}
-
-Emf::~Emf() {
-  CloseEmf();
-  DCHECK(!emf_ && !hdc_);
-}
-
-bool Emf::CreateDc(HDC sibling, const RECT* rect) {
-  DCHECK(!emf_ && !hdc_);
-  hdc_ = CreateEnhMetaFile(sibling, NULL, rect, NULL);
-  DCHECK(hdc_);
-  return hdc_ != NULL;
-}
-
-bool Emf::CreateFromData(const void* buffer, size_t size) {
-  DCHECK(!emf_ && !hdc_);
-  emf_ = SetEnhMetaFileBits(static_cast<unsigned>(size),
-                            reinterpret_cast<const BYTE*>(buffer));
-  DCHECK(emf_);
-  return emf_ != NULL;
-}
-
-bool Emf::CloseDc() {
-  DCHECK(!emf_ && hdc_);
-  emf_ = CloseEnhMetaFile(hdc_);
-  DCHECK(emf_);
-  hdc_ = NULL;
-  return emf_ != NULL;
-}
-
-void Emf::CloseEmf() {
-  DCHECK(!hdc_);
-  if (emf_) {
-    DeleteEnhMetaFile(emf_);
-    emf_ = NULL;
-  }
-}
-
-bool Emf::Playback(HDC hdc, const RECT* rect) const {
-  DCHECK(emf_ && !hdc_);
-  RECT bounds;
-  if (!rect) {
-    // Get the natural bounds of the EMF buffer.
-    bounds = GetBounds().ToRECT();
-    rect = &bounds;
-  }
-  return PlayEnhMetaFile(hdc, emf_, rect) != 0;
-}
-
-bool Emf::SafePlayback(HDC context) const {
-  DCHECK(emf_ && !hdc_);
-  XFORM base_matrix;
-  if (!GetWorldTransform(context, &base_matrix)) {
-    NOTREACHED();
-    return false;
-  }
-
-  return EnumEnhMetaFile(context,
-                         emf_,
-                         &Emf::SafePlaybackProc,
-                         reinterpret_cast<void*>(&base_matrix),
-                         &GetBounds().ToRECT()) != 0;
-}
-
-gfx::Rect Emf::GetBounds() const {
-  DCHECK(emf_ && !hdc_);
-  ENHMETAHEADER header;
-  if (GetEnhMetaFileHeader(emf_, sizeof(header), &header) != sizeof(header)) {
-    NOTREACHED();
-    return gfx::Rect();
-  }
-  if (header.rclBounds.left == 0 &&
-      header.rclBounds.top == 0 &&
-      header.rclBounds.right == -1 &&
-      header.rclBounds.bottom == -1) {
-    // A freshly created EMF buffer that has no drawing operation has invalid
-    // bounds. Instead of having an (0,0) size, it has a (-1,-1) size. Detect
-    // this special case and returns an empty Rect instead of an invalid one.
-    return gfx::Rect();
-  }
-  return gfx::Rect(header.rclBounds.left,
-                   header.rclBounds.top,
-                   header.rclBounds.right - header.rclBounds.left,
-                   header.rclBounds.bottom - header.rclBounds.top);
-}
-
-unsigned Emf::GetDataSize() const {
-  DCHECK(emf_ && !hdc_);
-  return GetEnhMetaFileBits(emf_, 0, NULL);
-}
-
-bool Emf::GetData(void* buffer, size_t size) const {
-  DCHECK(emf_ && !hdc_);
-  DCHECK(buffer && size);
-  unsigned size2 = GetEnhMetaFileBits(emf_, static_cast<unsigned>(size),
-                                      reinterpret_cast<BYTE*>(buffer));
-  DCHECK(size2 == size);
-  return size2 == size && size2 != 0;
-}
-
-bool Emf::GetData(std::vector<uint8_t>* buffer) const {
-  unsigned size = GetDataSize();
-  if (!size)
-    return false;
-
-  buffer->resize(size);
-  if (!GetData(&buffer->front(), size))
-    return false;
-  return true;
-}
-
-bool Emf::SaveTo(const std::wstring& filename) const {
-  HANDLE file = CreateFile(filename.c_str(), GENERIC_WRITE,
-                           FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
-                           CREATE_ALWAYS, 0, NULL);
-  if (file == INVALID_HANDLE_VALUE)
-    return false;
-
-  bool success = false;
-  std::vector<uint8_t> buffer;
-  if (GetData(&buffer)) {
-    DWORD written = 0;
-    if (WriteFile(file, &*buffer.begin(), static_cast<DWORD>(buffer.size()),
-                  &written, NULL) &&
-        written == buffer.size()) {
-      success = true;
-    }
-  }
-  CloseHandle(file);
-  return success;
-}
-
-int CALLBACK Emf::SafePlaybackProc(HDC hdc,
-                                   HANDLETABLE* handle_table,
-                                   const ENHMETARECORD* record,
-                                   int objects_count,
-                                   LPARAM param) {
-  const XFORM* base_matrix = reinterpret_cast<const XFORM*>(param);
-  EnumerationContext context;
-  context.handle_table = handle_table;
-  context.objects_count = objects_count;
-  context.hdc = hdc;
-  Record record_instance(&context, record);
-  bool success = record_instance.SafePlayback(base_matrix);
-  DCHECK(success);
-  return 1;
-}
-
-Emf::Record::Record() {
-}
-
-Emf::Record::Record(const EnumerationContext* context,
-                    const ENHMETARECORD* record)
-    : record_(record),
-      context_(context) {
-  DCHECK(record_);
-}
-
-bool Emf::Record::Play() const {
-  return 0 != PlayEnhMetaFileRecord(context_->hdc,
-                                    context_->handle_table,
-                                    record_,
-                                    context_->objects_count);
-}
-
-bool Emf::Record::SafePlayback(const XFORM* base_matrix) const {
-  // For EMF field description, see [MS-EMF] Enhanced Metafile Format
-  // Specification.
-  //
-  // This is the second major EMF breakage I get; the first one being
-  // SetDCBrushColor/SetDCPenColor/DC_PEN/DC_BRUSH being silently ignored.
-  //
-  // This function is the guts of the fix for bug 1186598. Some printer drivers
-  // somehow choke on certain EMF records, but calling the corresponding
-  // function directly on the printer HDC is fine. Still, playing the EMF record
-  // fails. Go figure.
-  //
-  // The main issue is that SetLayout is totally unsupported on these printers
-  // (HP 4500/4700). I used to call SetLayout and I stopped. I found out this is
-  // not sufficient because GDI32!PlayEnhMetaFile internally calls SetLayout(!)
-  // Damn.
-  //
-  // So I resorted to manually parse the EMF records and play them one by one.
-  // The issue with this method compared to using PlayEnhMetaFile to play back
-  // an EMF buffer is that the later silently fixes the matrix to take in
-  // account the matrix currently loaded at the time of the call.
-  // The matrix magic is done transparently when using PlayEnhMetaFile but since
-  // I'm processing one field at a time, I need to do the fixup myself. Note
-  // that PlayEnhMetaFileRecord doesn't fix the matrix correctly even when
-  // called inside an EnumEnhMetaFile loop. Go figure (bis).
-  //
-  // So when I see a EMR_SETWORLDTRANSFORM and EMR_MODIFYWORLDTRANSFORM, I need
-  // to fix the matrix according to the matrix previously loaded before playing
-  // back the buffer. Otherwise, the previously loaded matrix would be ignored
-  // and the EMF buffer would always be played back at its native resolution.
-  // Duh.
-  //
-  // I also use this opportunity to skip over eventual EMR_SETLAYOUT record that
-  // could remain.
-  //
-  // Note: I should probably care about view ports and clipping, eventually.
-  bool res;
-  switch (record()->iType) {
-    case EMR_SETWORLDTRANSFORM: {
-      DCHECK_EQ(record()->nSize, sizeof(DWORD) * 2 + sizeof(XFORM));
-      const XFORM* xform = reinterpret_cast<const XFORM*>(record()->dParm);
-      HDC hdc = context_->hdc;
-      if (base_matrix) {
-        res = 0 != SetWorldTransform(hdc, base_matrix) &&
-                   ModifyWorldTransform(hdc, xform, MWT_LEFTMULTIPLY);
-      } else {
-        res = 0 != SetWorldTransform(hdc, xform);
-      }
-      break;
-    }
-    case EMR_MODIFYWORLDTRANSFORM: {
-      DCHECK_EQ(record()->nSize,
-                sizeof(DWORD) * 2 + sizeof(XFORM) + sizeof(DWORD));
-      const XFORM* xform = reinterpret_cast<const XFORM*>(record()->dParm);
-      const DWORD* option = reinterpret_cast<const DWORD*>(xform + 1);
-      HDC hdc = context_->hdc;
-      switch (*option) {
-        case MWT_IDENTITY:
-          if (base_matrix) {
-            res = 0 != SetWorldTransform(hdc, base_matrix);
<